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

Add option to specify chunks in iris.util.broadcast_to_shape #5620

Merged
merged 2 commits into from
Apr 5, 2024

Conversation

bouweandela
Copy link
Member

@bouweandela bouweandela commented Dec 11, 2023

🚀 Pull Request

Description

Make it possible to specify the target chunks in iris.util.broadcast_to_shape.

This function is often used to broadcast auxiliary coordinate or cell measure data or weights to the same shape as the data from a cube. If the chunks of the broadcasted data do not match that of the cube, this leads to poor computational performance. Rechunking after broadcasting is less efficient, therefore it is really useful to be able to specify the chunks directly as part of the broadcast.

Closes #5456


Consult Iris pull request check list

Copy link

codecov bot commented Dec 11, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.76%. Comparing base (fa07442) to head (f12a80c).
Report is 105 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5620      +/-   ##
==========================================
+ Coverage   89.69%   89.76%   +0.07%     
==========================================
  Files          90       93       +3     
  Lines       22809    22990     +181     
  Branches     5440     5010     -430     
==========================================
+ Hits        20458    20638     +180     
- Misses       1618     1622       +4     
+ Partials      733      730       -3     

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

@bouweandela

This comment was marked as outdated.

@bouweandela bouweandela marked this pull request as ready for review December 11, 2023 10:16
@bouweandela bouweandela force-pushed the broadcast-to-shape-with-chunks branch 4 times, most recently from 4e5e5b1 to 479f021 Compare December 12, 2023 15:47
@HGWright HGWright requested a review from pp-mo December 13, 2023 10:28
@pp-mo pp-mo self-assigned this Dec 14, 2023
bouweandela added a commit to ESMValGroup/ESMValCore that referenced this pull request Jan 16, 2024
@trexfeathers
Copy link
Contributor

@pp-mo any update on this?

@pp-mo
Copy link
Member

pp-mo commented Jan 22, 2024

@pp-mo any update on this?

Sorry yes I am reviewing this, I have some queries + suggestions pending .
I has taken me quite a while to get my head around it -- should finally get to posting later today I think !

@trexfeathers trexfeathers assigned HGWright and unassigned pp-mo Feb 29, 2024
lib/iris/util.py Show resolved Hide resolved
Copy link
Contributor

@HGWright HGWright left a comment

Choose a reason for hiding this comment

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

Thanks for the changes @bouweandela! Looks good to me.

@HGWright HGWright merged commit f8ea86f into SciTools:main Apr 5, 2024
21 checks passed
@bouweandela bouweandela deleted the broadcast-to-shape-with-chunks branch April 5, 2024 10:50
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the ability to specify chunks to iris.util.broadcast_to_shape
4 participants