Skip to content

Conversation

rcomer
Copy link
Member

@rcomer rcomer commented Feb 26, 2024

🚀 Pull Request

Description

I'm glad this function exists publicly as it was the solution to my problem today but I found the docstring confusing: because it said it could convert an iterable of cubes, I tried passing a cubelist, which failed because cubelists have no shape attribute.

I also note that the target parameter does not appear to be used for anything, but I don't think I want to pull on that thread right now...


Consult Iris pull request check list

@rcomer
Copy link
Member Author

rcomer commented Feb 26, 2024

Renders like this

Copy link

codecov bot commented Feb 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.74%. Comparing base (0ef0bc5) to head (5c5dc18).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5783   +/-   ##
=======================================
  Coverage   89.74%   89.74%           
=======================================
  Files          92       92           
  Lines       22941    22942    +1     
  Branches     5463     5464    +1     
=======================================
+ Hits        20589    20590    +1     
  Misses       1620     1620           
  Partials      732      732           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pp-mo
Copy link
Member

pp-mo commented Feb 26, 2024

the target parameter does not appear to be used for anything

I chased this down. It used to have a role in "rules logging", which we got rid of a long time ago.

I'm also not sure how we go about tidying this.
Given how obscure this is, perhaps we could even just remove it (and the one in "as_fields"), and issue a warning in a whatsnew ?
I mean, maybe we don't need to be as seriously backwards-compatible as Iris.
@trexfeathers what do you reckon to this one ?

@pp-mo
Copy link
Member

pp-mo commented Feb 26, 2024

I'm glad this function exists publicly as it was the solution to my problem today
BTW maybe you can just as well use "as_fields" ? I'd be interested to know if not.

@rcomer
Copy link
Member Author

rcomer commented Feb 26, 2024

BTW maybe you can just as well use "as_fields" ? I'd be interested to know if not.

Yes I could and I think that would be cleaner - thanks! I got here by looking at the example in the user guide which I think could also use as_fields.

@trexfeathers
Copy link
Contributor

Given how obscure this is, perhaps we could even just remove it (and the one in "as_fields"), and issue a warning in a whatsnew ?

Yup, that's my preferred solution. We can always bugfix it back in if someone's calls are still expecting more arguments.

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.

OK it's backwards-breaking, but we've discussed that enough I think.
Let's run with it + see what happens!

@pp-mo pp-mo merged commit b1fb458 into SciTools:main Apr 4, 2024
@rcomer
Copy link
Member Author

rcomer commented Apr 4, 2024

Thanks @pp-mo!

tkknight added a commit to tkknight/iris that referenced this pull request Apr 4, 2024
* upstream/main:
  DOC: clarify save_pairs_from_cube docstring (SciTools#5783)
@rcomer rcomer deleted the pp-pairs branch April 5, 2024 13:22
tkknight added a commit to tkknight/iris that referenced this pull request Apr 10, 2024
…th_numpydoc

* upstream/main: (39 commits)
  Bump scitools/workflows from 2024.03.3 to 2024.04.0 (SciTools#5907)
  [pre-commit.ci] pre-commit autoupdate (SciTools#5906)
  Updated environment lockfiles (SciTools#5904)
  Ignore flaticon.com in linkchecks. (SciTools#5905)
  Implement lazy area weights (SciTools#5658)
  Add option to specify chunks in `iris.util.broadcast_to_shape` (SciTools#5620)
  Unpin sphinx (SciTools#5901)
  DOC: clarify save_pairs_from_cube docstring (SciTools#5783)
  Restore latest Whats New files.
  Whats new updates for `v3.9.0rc0` (SciTools#5899)
  nep29: drop py39 and support py312 (SciTools#5894)
  Support NetCDF v3 files in chunking control code. (SciTools#5897)
  Avoid computing lazy scalar coordinates when printing a Cube (v2) (SciTools#5896)
  Force pytest colour output on GitHub Actions (SciTools#5895)
  Make typing 3.9 compatible.
  Improve typing readability.
  Updated environment lockfiles (SciTools#5892)
  [pre-commit.ci] pre-commit autoupdate
  What's New entry for SciTools#5740 .
  Iris to GeoVista conversion (SciTools#5740)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants