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

Fix pp save of realization coordinate #5568

Merged
merged 4 commits into from
Nov 30, 2023

Conversation

rcomer
Copy link
Member

@rcomer rcomer commented Nov 8, 2023

🚀 Pull Request

Description

Fixes #4747 by adding some handling for the "realization" coordinate in pp_save_rules.py.

I followed the pattern of _general_time_rules in this module, and found the relevant field attribute by looking at the load code:

# Realization (aka ensemble) (--> scalar coordinates)
aux_coords_and_dims.extend(
_convert_scalar_realization_coords(lbrsvd4=f.lbrsvd[3])
)

Also updated some docstrings and comments. There seem to have been some copypasta errors going on.


Consult Iris pull request check list

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 @rcomer! Some comments for you

lib/iris/fileformats/pp_save_rules.py Outdated Show resolved Hide resolved
lib/iris/fileformats/pp_save_rules.py Outdated Show resolved Hide resolved
lib/iris/fileformats/pp_save_rules.py Show resolved Hide resolved
lib/iris/tests/unit/fileformats/pp/test_save.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented Nov 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e0850eb) 89.44% compared to head (20518b8) 89.68%.
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5568      +/-   ##
==========================================
+ Coverage   89.44%   89.68%   +0.24%     
==========================================
  Files          89       90       +1     
  Lines       22583    22818     +235     
  Branches     5386     5446      +60     
==========================================
+ Hits        20199    20465     +266     
+ Misses       1638     1619      -19     
+ Partials      746      734      -12     

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

@trexfeathers trexfeathers merged commit 5496ebc into SciTools:main Nov 30, 2023
17 checks passed
@rcomer
Copy link
Member Author

rcomer commented Nov 30, 2023

Thanks @trexfeathers!

@rcomer rcomer deleted the pp-save-realisation branch November 30, 2023 17:02
tkknight added a commit to tkknight/iris that referenced this pull request Dec 4, 2023
* 'numpydocs1' of github.com:tkknight/iris:
  Feedstock rc branch management in do-nothing script (SciTools#5515)
  Relocated the Technical Papers documentation to Further Topics.  (SciTools#5602)
  Fix pp save of realization coordinate (SciTools#5568)
  Bump actions/checkout from 3 to 4 (SciTools#5460)
  Bump actions/github-script from 6 to 7 (SciTools#5580)
  Bump conda-incubator/setup-miniconda from 2 to 3 (SciTools#5607)
  CI: specify matplotlib-base (SciTools#5606)
tkknight added a commit to tkknight/iris that referenced this pull request Dec 6, 2023
* main:
  DOCS: Numpydocs1 (SciTools#5578)
  add links to scitools-classroom repo. (SciTools#5609)
  Feedstock rc branch management in do-nothing script (SciTools#5515)
  Relocated the Technical Papers documentation to Further Topics.  (SciTools#5602)
  Fix pp save of realization coordinate (SciTools#5568)
  Bump actions/checkout from 3 to 4 (SciTools#5460)
  Bump actions/github-script from 6 to 7 (SciTools#5580)
  Bump conda-incubator/setup-miniconda from 2 to 3 (SciTools#5607)
  CI: specify matplotlib-base (SciTools#5606)
  Mergeback of `FEATURE_chunk_control` branch (SciTools#5588)
  [CI Bot] environment lockfiles auto-update (SciTools#5547)
  Mergeback of "Feature _split_attrs" branch (SciTools#5152)
  add whatsnew (SciTools#5596)
  Refactor area weighted regridding, improve performance (SciTools#5543)
  Allowing exemption to axis guessing on coords (SciTools#5551)
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.

PP round trip loses realization coordinate
2 participants