Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/iris/fileformats/grib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def __init__(self, grib_message, grib_fh=None, auto_regularise=True):
# The byte offset requires to be reset back to the first byte
# of this message. The file pointer offset is always at the end
# of the current message due to the grib-api reading the message.
proxy = GribDataProxy(shape, np.zeros(0).dtype, np.nan,
proxy = GribDataProxy(shape, np.array([0.]).dtype, np.nan,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't understand why this needs to be done rather than np.float_ (as suggested in this comment). Surely it just needs a float datatype?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I spoke to Dan about this he suggested that this is because at some point in the future, numpy might mess about with np.float as a datatype, so this method is more robust.

grib_fh.name,
offset - message_length,
auto_regularise)
Expand Down