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

coords_as_attributes functionality #394

Merged
merged 1 commit into from
Jul 19, 2024
Merged

Conversation

EddyCMWF
Copy link
Contributor

This PR means that it is possible to convert coordinates/dimensions to variable attributes, only if the length of the coordinate = 1 (this requirement artificial and could be removed)

This means that it is possible to open variables which are on different levels (e.g. soil temperature variables) in a single dataset without loss of the metadata. i.e. without the change the depthBelowLandLayer is a coordinate of the dataset, therefore the different soil levels are incompatible. Now the depth is stored as t an attribute on each variable.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 41.39%. Comparing base (8b8e896) to head (5a9044c).

Files Patch % Lines
cfgrib/dataset.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #394      +/-   ##
==========================================
+ Coverage   41.26%   41.39%   +0.13%     
==========================================
  Files          26       26              
  Lines        2174     2184      +10     
  Branches      284      285       +1     
==========================================
+ Hits          897      904       +7     
- Misses       1277     1280       +3     

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

@EddyCMWF
Copy link
Contributor Author

Additional information, I chose to do it here as it will be useful to keep some level-types as dimensions (e.g. pressure/model level) but convert some level-types to attributes (e.g. soil-level/surface). Doing this earlier in the code meant that it would have been an all or nothing approach to including the vertical levels as a dimension

@iainrussell iainrussell merged commit c9d7ef9 into master Jul 19, 2024
86 checks passed
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.

3 participants