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

Cubelist extract strict #3715

Merged
merged 6 commits into from
May 27, 2020
Merged

Conversation

pp-mo
Copy link
Member

@pp-mo pp-mo commented May 22, 2020

Replace "cubelist.extract(..., strict=True)" and the equivalent "cubelist.extract_strict(...)" with a newer-style API.

Closes #3695
As noted there, this is more in keeping with other facilities, and also addresses the slightly quirky return-type behaviour of the old style : The old method would return a cubelist for 0 or 2..N constraints/results, but just a cube for exactly one constraint.

@pp-mo pp-mo requested a review from trexfeathers May 22, 2020 14:01
@pp-mo
Copy link
Member Author

pp-mo commented May 22, 2020

I don't understand why it's just stopped testing in Travis.
TBD...

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.

Very nice work @pp-mo, especially with the Mixins! Just a couple of minor points for you to look at, but overall it seems pretty water-tight.

Regarding Travis: I pushed a copy of this PR up to my own fork and Travis gave the latest commits a full pass so no problems there 👍

lib/iris/tests/test_merge.py Show resolved Hide resolved
lib/iris/tests/unit/cube/test_CubeList.py Outdated Show resolved Hide resolved
lib/iris/tests/unit/cube/test_CubeList.py Show resolved Hide resolved
lib/iris/cube.py Show resolved Hide resolved
@trexfeathers
Copy link
Contributor

Everything has passed, LGTM, thanks @pp-mo

@trexfeathers trexfeathers merged commit d4fe713 into SciTools:master May 27, 2020
@pp-mo pp-mo added this to In Progress in Iris v3.0.0 via automation Jun 3, 2020
@pp-mo pp-mo added this to the v3.0.0 milestone Jun 3, 2020
@pp-mo pp-mo moved this from In Progress to Done in Iris v3.0.0 Jun 3, 2020
tkknight pushed a commit to tkknight/iris that referenced this pull request Jun 29, 2020
* Allow iterable of constraints.

* Add new cubelist extract methods, and tests.

* Remove old 'strict' cubelist extraction; add whatsnew.

* Tidy private routine interface, and replace use in unrelated test.

* Pointless tweak to re-try Travis.

* Review change.
@pp-mo pp-mo deleted the cubelist_extract_strict branch October 28, 2020 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Iris v3.0.0
  
Done
Development

Successfully merging this pull request may close these issues.

Bring cubelist "extract_strict" into line with other Iris methods
2 participants