Skip to content

Conversation

stephenworsley
Copy link
Contributor

Fixes a few issues with #3483. Rellies upon #3548 and #3546 being merged to work properly.

@stephenworsley stephenworsley changed the title Ensure collapsed/aggregated_by/rolling_window treat ancillary variables properly (DO NOT MERGE)) Ensure collapsed/aggregated_by/rolling_window treat ancillary variables properly Nov 20, 2019
@stephenworsley
Copy link
Contributor Author

This has now been rebased to include #3548 and #3546.

Copy link
Contributor

@trexfeathers trexfeathers left a comment

Choose a reason for hiding this comment

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

Hi @stephenworsley. Sorry but I think the tests need more refactoring to fully account for your changes.

@trexfeathers
Copy link
Contributor

Also, since this is a change in behaviour for cell measures, there will need to be a what's new entry

@stephenworsley stephenworsley self-assigned this Nov 25, 2019
@trexfeathers trexfeathers self-requested a review November 25, 2019 13:37
Copy link
Contributor

@trexfeathers trexfeathers left a comment

Choose a reason for hiding this comment

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

Tests look good! You might have missed it but I also added a comment that there should be a what's new for the changed cell measure behaviour. Thanks 👍

@abooton abooton changed the title Ensure collapsed/aggregated_by/rolling_window treat ancillary variables properly PI:3483: Ensure collapsed/aggregated_by/rolling_window treat ancillary variables properly Nov 26, 2019
@abooton abooton changed the title PI:3483: Ensure collapsed/aggregated_by/rolling_window treat ancillary variables properly PI3483: Ensure collapsed/aggregated_by/rolling_window treat ancillary variables properly Nov 26, 2019
@abooton abooton changed the title PI3483: Ensure collapsed/aggregated_by/rolling_window treat ancillary variables properly PI-3483: Ensure collapsed/aggregated_by/rolling_window treat ancillary variables properly Nov 26, 2019
lib/iris/util.py Outdated
del cube.attributes[key]


def _remove_ancils_and_cms_mapping_dims(cube, dims):
Copy link
Member

Choose a reason for hiding this comment

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

After some consideration, I guess this is a reasonable place for it, as we already have other general-purpose private routines here.
I know it was my proposal, but can you think of a handier short name ?
(Anticipating complaint from @bjlittle as on this one !)

npts = cube.shape[i_dim]
coord = DimCoord(np.arange(npts), long_name=name)
cube.add_dim_coord(coord, i_dim)
self.ancillary_variable = AncillaryVariable([0, 1], long_name="foo")
Copy link
Member

Choose a reason for hiding this comment

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

I think adding this to a testclass called specifically Test_collapsed__lazy is a bit cheeky !
The actual (pre-existing) testcases show that this class is specifically to test operation with lazy data.

So I think we should instead add a new testclass to be the home for these new tests.
As we don't have a "Test_collapsed", and we're not even aiming to do that here+now, I would just call it something like 'Test_collapsed__cellmeasure_ancils` + keep it minimal for this purpose.

By contrast, I think the changes to rolling-window and aggregated-by classes below are fine as they are.

@pp-mo
Copy link
Member

pp-mo commented Nov 27, 2019

Hi @stephenworsley, reviewed what is left to do, so here is my list of what's outstanding :

Copy link
Member

@pp-mo pp-mo left a comment

Choose a reason for hiding this comment

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

Hi @stephenworsley
One more small point came up.
Otherwise all done, great !

@pp-mo pp-mo merged commit 3c4dd16 into SciTools:master Nov 28, 2019
@pp-mo
Copy link
Member

pp-mo commented Nov 28, 2019

Nice work @stephenworsley, thanks for patience !!

@abooton abooton changed the title PI-3483: Ensure collapsed/aggregated_by/rolling_window treat ancillary variables properly GH-3483: Ensure collapsed/aggregated_by/rolling_window treat ancillary variables properly Nov 30, 2019
@abooton abooton changed the title GH-3483: Ensure collapsed/aggregated_by/rolling_window treat ancillary variables properly #3483: Ensure collapsed/aggregated_by/rolling_window treat ancillary variables properly Nov 30, 2019
@abooton abooton changed the title #3483: Ensure collapsed/aggregated_by/rolling_window treat ancillary variables properly #3483 : Ensure collapsed/aggregated_by/rolling_window treat ancillary variables properly Nov 30, 2019
@abooton abooton changed the title #3483 : Ensure collapsed/aggregated_by/rolling_window treat ancillary variables properly PI-3483: Ensure collapsed/aggregated_by/rolling_window treat ancillary variables properly Nov 30, 2019
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.

4 participants