Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build #270

Merged
merged 10 commits into from
Jun 3, 2021
Merged

Fix build #270

merged 10 commits into from
Jun 3, 2021

Conversation

TomDufall
Copy link
Contributor

As discovered in #269, iris.util._array_slice_ifempty has been removed and this breaks iris-grib builds.

The PR that removed it from Iris said that it was no longer necessary so, I assume, it is also no longer necessary in iris-grib for the same reasons and I've removed it following the style of the Iris PR.

While I have the skill to technically implement this change, I don't have the requisite knowledge to say whether or not this is the correct decision - this is the bit that needs reviewing most!

@TomDufall
Copy link
Contributor Author

Removed the changes from the other PR I was working on that got caught in this.

@TomDufall
Copy link
Contributor Author

Last conflict seems to be a conflict at the dependency resolution stage. This probably explains why I'm struggling to get tests to run locally too (hence pushing them here to be tested.)

It seems to be unable to find mo_pack and I can't find it either - the install instruction of conda install -c scitools mo_pack doesn't work for me.

@TomDufall
Copy link
Contributor Author

On the plus side, the build using Iris from conda-forge rather than source is working.

@TomDufall
Copy link
Contributor Author

Okay, mo_pack I can't find because it doesn't support Windows (probably should have noticed that earlier.) Not sure why CI wasn't picking up the specified Black version while Iris's CI could. Re-running in the hope it's sorted itself out.

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.

Essentially this is great.
Many many thanks for seeing this + taking the trouble to fix @TomDufall 🚀

I probably should have seen this coming with SciTools/iris#4141. But I didn't 😞

But two slight questions remain for me...

(1) whether it would be better to leave the 'test_empty_slice' test in place,
as a kind of "behaviour regression" test.
The problem that this older code addressed is essentialy one of performance, but performance testing isn't really practical. So instead, you can (continue to) check that the data is not fetched when creating the lazy wrapper.

(2) whether we should change the Iris version requirement
The newer approach in iris._lazy_data should fix the performace hit.
That is now in v3.0.2, but I think not yet back in master.
Of course, a 'tidied' iris-grib would now get a nasty performance hit if used with an older Iris.

What do you think about this?
@lbdreyer @bjlittle

@@ -43,31 +43,5 @@ def test_bitmap__invalid_indicator(self):
data_proxy._bitmap(section_6)


class Test_emptyfetch(tests.IrisGribTest):
Copy link
Member

Choose a reason for hiding this comment

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

I'm just wondering if it would make sense to leave this in as a "regression" testcase ?

Copy link
Member

Choose a reason for hiding this comment

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

A difficult question! Maybe side with caution and leave it in? We can remove it later on if it causes problems.
On a side note I think we should ASV (aka performance) testing for this sort of thing. I had started thinking about it last week after SciTools/iris#4141.

Copy link
Member

Choose a reason for hiding this comment

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

if it would make sense to leave this in as a "regression" testcase ?

Ok sorry I didn't read this closely enough.

This test will now fail, as we no longer intercept zero-length slicing.
You could modify it to call iris._lazy_data._as_lazy_data + check that that didn't 'visit' the data, but that's really testing Iris (which we do elsewhere), so not really appropriate here.

So, let's scrap it, as you originally suggested. 👍

@bjlittle
Copy link
Member

bjlittle commented Jun 2, 2021

@pp-mo @lbdreyer

Okay sounds to me like we want to have a minimum requirement of iris>=3.0.2 and this should solve all our concerns here?

Also, looking over the codebase, it might make sense to rationalise the setup.py into setup.cfg and pin the PyPI package requirements akin to conda, and perhaps open the door on iris-grib testing for py38, but drop support for py36.

I'm happy to do all that, as I'm spinning that plate for iris also 👍

@TomDufall Are you working to a specific deadline or milestone?

Otherwise, we could quickly iterate on this and bank it all in an iris-grib 0.17.1 release... what do you think guys?

@TomDufall
Copy link
Contributor Author

My main motivation was getting tests to pass in master to mess about with Flake8/Pytest as CPD.
I then got back to work today and realised it was breaking our build 😂From our project's point of view, we're happy with anything that isn't broken - for now we've just pinned Iris to 3.0.1 in our reqs.

@lbdreyer
Copy link
Member

lbdreyer commented Jun 2, 2021

we could quickly iterate on this and bank it all in an iris-grib 0.17.1 release... what do you think guys?

Personally I'd prefer we move quickly on this. We have some users requiring the latest iris-grib soon, so I would lean more to a 0.17.1 release (and if we go for that, this PR should point at the v0.17.x branch)

@TomDufall
Copy link
Contributor Author

TomDufall commented Jun 2, 2021

I think the bigger urgency is that this breaks existing releases unless users work out that they can pin Iris to an older version themselves. The shortest possible fix would be to specify Iris < 3.0.2, I don't have strong opinions on which of the various suggestions is best.

@marqh marqh mentioned this pull request Jun 2, 2021
@lbdreyer lbdreyer changed the base branch from master to v0.17.x June 3, 2021 10:17
@@ -43,31 +43,5 @@ def test_bitmap__invalid_indicator(self):
data_proxy._bitmap(section_6)


class Test_emptyfetch(tests.IrisGribTest):
Copy link
Member

Choose a reason for hiding this comment

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

if it would make sense to leave this in as a "regression" testcase ?

Ok sorry I didn't read this closely enough.

This test will now fail, as we no longer intercept zero-length slicing.
You could modify it to call iris._lazy_data._as_lazy_data + check that that didn't 'visit' the data, but that's really testing Iris (which we do elsewhere), so not really appropriate here.

So, let's scrap it, as you originally suggested. 👍

@lbdreyer
Copy link
Member

lbdreyer commented Jun 3, 2021

It looks like everything has now been resolved, so I am going to merge this in, so we can cut and release 0.17.1 today

@lbdreyer lbdreyer merged commit 7d84c18 into SciTools:v0.17.x Jun 3, 2021
@lbdreyer
Copy link
Member

lbdreyer commented Jun 3, 2021

Note: I will be adding the pin in a follow up PR that updates the version number

@lbdreyer
Copy link
Member

lbdreyer commented Jun 3, 2021

Thanks @TomDufall !
And thank you @pp-mo and @bjlittle for your contributions on this :)

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