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

Improve handling of masks in concatenate #6187

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

bouweandela
Copy link
Member

🚀 Pull Request

Description

The following arrays compare equal in iris.util.array_equal, so they should also compare equal in the hash function used by concatenate:

  • np.array([1, 2]) and np.ma.array([1, 2], mask=np.ma.nomask)
  • np.array([1, 2]) and np.ma.array([1, 2], mask=[0, 0])
  • np.ma.array([1, 2], mask=[0, 0]) and np.ma.array([1, 2], mask=np.ma.nomask)

Consult Iris pull request check list


Add any of the below labels to trigger actions on this PR:

  • benchmark_this Request that this pull request be benchmarked to check if it introduces performance shifts

Copy link

codecov bot commented Oct 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.82%. Comparing base (dd0432e) to head (b79bdde).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6187   +/-   ##
=======================================
  Coverage   89.82%   89.82%           
=======================================
  Files          88       88           
  Lines       23185    23185           
  Branches     4314     4314           
=======================================
  Hits        20825    20825           
  Misses       1628     1628           
  Partials      732      732           

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

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.

Thanks @bouweandela, this makes sense to me

lib/iris/_concatenate.py Show resolved Hide resolved
@trexfeathers trexfeathers merged commit 8c213f0 into SciTools:main Oct 25, 2024
21 checks passed
@bouweandela bouweandela deleted the improve-nomask-hashing branch October 25, 2024 09:54
HGWright added a commit to HGWright/iris that referenced this pull request Oct 31, 2024
* upstream/main: (194 commits)
  Restore latest Whats New files.
  [pre-commit.ci] pre-commit autoupdate (SciTools#6205)
  correct major minor in whatsnew (SciTools#6202)
  What's new updates for v3.11.0rc0 . (SciTools#6201)
  Update CF standard names table. (SciTools#6200)
  Specify meta in dask.array.map_blocks (SciTools#5989)
  added in a vertical rule for surface fields (SciTools#5734)
  Updated environment lockfiles (SciTools#6197)
  Reduce duplication in cf.py spanning checks. (SciTools#6196)
  Fix attribute array comparison (SciTools#6181)
  Enable factory references to create new dimensions on load. (SciTools#6168) (SciTools#6194)
  Improve handling of masks in concatenate (SciTools#6187)
  Demo Numpy v2 (SciTools#6035)
  Bump scitools/workflows from 2024.10.1 to 2024.10.2 (SciTools#6186)
  Document use of new_axis to control merge (SciTools#6180)
  Updated environment lockfiles (SciTools#6184)
  [pre-commit.ci] pre-commit autoupdate (SciTools#6175)
  Updated environment lockfiles (SciTools#6183)
  Update to `cell_method` parsing (SciTools#6083)
  Bump scitools/workflows from 2024.10.0 to 2024.10.1 (SciTools#6179)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants