-
Notifications
You must be signed in to change notification settings - Fork 38
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
Missing 2m height coordinate and monotonicity for tasmin in CESM2 and CESM2-WACCM #2574
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2574 +/- ##
==========================================
- Coverage 94.66% 94.65% -0.01%
==========================================
Files 251 251
Lines 14286 14288 +2
==========================================
+ Hits 13524 13525 +1
- Misses 762 763 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, many thanks! Would you mind running pre-commit before hand please? Also, will approve and merge if you don't want to plug in the monotonicity fix here as well 🍺
Thanks @valeriupredoi and thanks for showing me a similar fix for the monotonicity too. I've added a fix for the monotonicity as well as adding tests for them and I ran pre-commit before sending pushing the changes. Let me know if there's anything else I need to change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
many thanks @Karen-A-Garcia 🍺 A few wiggles to fix (am not 100% sure of the baseclass for Tasmin for CESM2, I think it should be a generic Fix
class there, doesn't really matter that much). One general comment related to testing: it's great that you added tests, this is always a good thing to see from users, but wrt the testing framework, I'd suggest using the Pytest test classes/functions, and not use Unittest test classes anymore - these are old school and a tad harder to adapt inside a Pytest testing framework, plus, they need a lot more indentation 😁
@@ -286,3 +287,80 @@ def fix_metadata(self, cubes): | |||
if z_coord.standard_name is None: | |||
fix_ocean_depth_coord(cube) | |||
return cubes | |||
|
|||
|
|||
class Tasmin(Tas): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class Tasmin(Tas): | |
class Tasmin(Fix): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the base class should be Fix
here
def test_get(self): | ||
"""Test fix get.""" | ||
self.assertListEqual( | ||
Fix.get_fixes("CMIP6", "NCAR", "day", "tasmin"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix.get_fixes("CMIP6", "NCAR", "day", "tasmin"), | |
Fix.get_fixes("CMIP6", "CESM2", "day", "tasmin"), |
"""Test fix get.""" | ||
self.assertListEqual( | ||
Fix.get_fixes("CMIP6", "NCAR", "day", "tasmin"), | ||
[Tasmin(None)], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Tasmin(None)], | |
[Tasmin(None), GenericFix(None)], |
def test_get(self): | ||
"""Test fix get.""" | ||
self.assertListEqual( | ||
Fix.get_fixes("CMIP6", "NCAR", "day", "tasmin"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix.get_fixes("CMIP6", "NCAR", "day", "tasmin"), | |
Fix.get_fixes("CMIP6", "CESM2-WACCM", "day", "tasmin"), |
"""Test fix get.""" | ||
self.assertListEqual( | ||
Fix.get_fixes("CMIP6", "NCAR", "day", "tasmin"), | ||
[Tasmin(None)], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Tasmin(None)], | |
[Tasmin(None), GenericFix(None)], |
This is a follow up to issue #2573 for the height coordinates. Still looking into the time issue. There was already a fix for the 2m height previously done for tas and I simply applied the fix to tasmin in both CESM2 and CESM2-WACCM files. There were already tests written for the fixes so I didn't add anything to those files.
Checklist
It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.