Skip to content

Conversation

@pp-mo
Copy link
Member

@pp-mo pp-mo commented Oct 24, 2017

Bring iris_grib up-to-date with recent changes to Iris,
to use masked-arrays instead of nan masking in Dask (Dask v 0.13).

def __init__(self, grib_message, grib_fh=None):
"""Store the grib message and compute our extra keys."""
self.grib_message = grib_message
self.realised_dtype = np.array([0.]).dtype
Copy link
Member

Choose a reason for hiding this comment

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

API change

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, not if we never released the previous version, no ? ;-)

data = gribapi.grib_get_double_array(grib_message, 'values')
data = data.reshape(shape)

# Handle missing values in a sensible way.
Copy link
Member

Choose a reason for hiding this comment

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

Is this a hangover from not having masks?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not totally sure.
This is simply reflecting what is currently in Iris master.

Copy link
Member

Choose a reason for hiding this comment

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

I'd love to find out more...

min, max = cube.data.min(), cube.data.max()
fill_value = min - (max - min) * 0.1
# Prepare the unmasked data array, using fill_value as the MDI.
data = cube.data.filled(fill_value)
Copy link
Member

Choose a reason for hiding this comment

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

Again, is this a hangover?

Copy link
Member Author

Choose a reason for hiding this comment

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

As above...

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling c8d3636 on pp-mo:dask_masked_fix into ** on SciTools:master**.

@pelson pelson merged commit df881c9 into SciTools:master Oct 24, 2017
@pp-mo pp-mo deleted the dask_masked_fix branch June 8, 2018 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants