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

Allow MeshCoord to have a coord-system #6016

Merged
merged 7 commits into from
Jul 17, 2024

Conversation

pp-mo
Copy link
Member

@pp-mo pp-mo commented Jun 20, 2024

This makes a MeshCoord have the coord-system of the appropriate location coordinate.

Note though that, as loaded from NetCDF-CF, location coords can't actually have a coord-system at present.
Because the load rules only call build_auxiliary_coordinate in one place, and a coord-system (though supported) is never passed :

In CF terms, this is because mesh coords are (at best) aux-coords of the data variable, and never dimension coords.
And a grid-mapping can currently only apply to dim-coords, because we don't yet support the extended grid-mapping syntax

However ... this does fix the copy error caused by a manually added coord-system

@pp-mo pp-mo marked this pull request as draft June 20, 2024 16:20
Copy link

codecov bot commented Jun 20, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 89.76%. Comparing base (8604bb8) to head (b6209d6).

Files Patch % Lines
lib/iris/experimental/ugrid/mesh.py 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6016      +/-   ##
==========================================
- Coverage   89.77%   89.76%   -0.01%     
==========================================
  Files          90       90              
  Lines       22984    22991       +7     
  Branches     5031     5031              
==========================================
+ Hits        20634    20639       +5     
- Misses       1619     1621       +2     
  Partials      731      731              

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

@pp-mo pp-mo changed the title MeshCoord coord-system comes from location coords. Fix MeshCoord.cop… Allow MeshCoord to have a coord-system Jun 20, 2024
@pp-mo pp-mo marked this pull request as ready for review July 15, 2024 17:57
Copy link
Contributor

@stephenworsley stephenworsley left a comment

Choose a reason for hiding this comment

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

Looking good, I think the main thing I'd like to be sure of is that this point about the copy operation being fixed now is properly tested and documented.

lib/iris/experimental/ugrid/mesh.py Outdated Show resolved Hide resolved
lib/iris/experimental/ugrid/mesh.py Outdated Show resolved Hide resolved
lib/iris/experimental/ugrid/mesh.py Show resolved Hide resolved
@pp-mo
Copy link
Member Author

pp-mo commented Jul 17, 2024

Thanks @stephenworsley
Hopefully addressed those points now ?
Please re-review!

Copy link
Contributor

@stephenworsley stephenworsley left a comment

Choose a reason for hiding this comment

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

Looks good.

@stephenworsley stephenworsley merged commit 17dd34a into SciTools:main Jul 17, 2024
21 checks passed
tkknight added a commit to tkknight/iris that referenced this pull request Jul 18, 2024
* upstream/main:
  Quieter datum warning (SciTools#6050)
  Allow MeshCoord to have a coord-system (SciTools#6016)
  Bump scitools/workflows from 2024.07.1 to 2024.07.2 (SciTools#6053)
  Faster concatenation of cubes with `AuxCoordFactory`s (SciTools#6038)
  Shorten cube iterator tests (SciTools#6041)
  Bump scitools/workflows from 2024.07.0 to 2024.07.1 (SciTools#6045)
  Bump scitools/workflows from 2024.06.5 to 2024.07.0 (SciTools#6034)
  Update test_Saver__ugrid.py (SciTools#6017)
  NEP29 and NumPy v2 pins (SciTools#6039)
  Adapt setup.py for pypa/setuptools@2db55275f. (SciTools#6036)
  Replace DelegatedConda with Delegated (SciTools#5963)
  Enable type hint checking (SciTools#5956)
  Bump scitools/workflows from 2024.06.4 to 2024.06.5 (SciTools#6026)
  Do not realize cell measures and ancillary variables in concatenate (SciTools#6010)
  [pre-commit.ci] pre-commit autoupdate (SciTools#6022)
  Bump scitools/workflows from 2024.06.3 to 2024.06.4 (SciTools#6018)
stephenworsley added a commit to stephenworsley/iris that referenced this pull request Jul 18, 2024
* main:
  Quieter datum warning (SciTools#6050)
  Allow MeshCoord to have a coord-system (SciTools#6016)
  Bump scitools/workflows from 2024.07.1 to 2024.07.2 (SciTools#6053)
@pp-mo pp-mo deleted the meshcoord_crs branch July 23, 2024 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants