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

add_TCO_60S60N to default lat-lon variables #879

Merged
merged 1 commit into from
Oct 29, 2024
Merged

Conversation

chengzhuzhang
Copy link
Contributor

Description

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

If applicable:

  • New and existing unit tests pass with my changes (locally and CI/CD build)
  • I have added tests that prove my fix is effective or that my feature works
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have noted that this is a breaking change for a major release (fix or feature that would cause existing functionality to not work as expected)

@chengzhuzhang
Copy link
Contributor Author

@tangq based on our discussion, I added a new entry to the default lat-lon variable configuration file. This way both global TCO and 60S60N TCO that is consistent to observation record are created. Here is an example run. https://web.lcrc.anl.gov/public/e3sm/diagnostic_output/zhang40/tco/viewer/lat_lon/index.html Notice that all metrics from the diff plots matches except that mean is -2.67 vs -2.68. I suspect the difference was caused by the way how region was subset is slightly different. I'm leaving a note here and later I can check if xarray/xcdat version of e3sm_diags v3 will present the same issue.

@chengzhuzhang
Copy link
Contributor Author

chengzhuzhang commented Oct 29, 2024

The CI/CD tests are having a bunch of Numpy 2.0 related error: e.g. https://github.com/E3SM-Project/e3sm_diags/actions/runs/11564567326/job/32189994750

I think the tests start to pick up numpy 2.0.2. and cdms3.1.5 build 23 (py39h4a6e4dc_23). @xylar there seem to be remaining issues with numpy 2 compatibility for cdms..

@xylar
Copy link
Contributor

xylar commented Oct 29, 2024

@chengzhuzhang, okay, please explicitly constrain to numpy<2.0 for now. Hopefully, the logs will persistent long enough for me to use them for more patching. (What fun!)

@xylar
Copy link
Contributor

xylar commented Oct 29, 2024

All errors seem to be the same and from a single line in cdms2. Conda-forge (via Azure) isn't able to build packages right now but I will patch and make a new build as soon as Azure is back up.

@xylar
Copy link
Contributor

xylar commented Oct 29, 2024

@xylar
Copy link
Contributor

xylar commented Oct 29, 2024

I ran the e3sm_diags pytest locally with a local build of the patched cdms2 package and it passed, so I think we'll be good once I can get that one little patch in.

@xylar
Copy link
Contributor

xylar commented Oct 29, 2024

We should be able to try CI again here in an hour or so to bring in a version of cdms2 with the remaining numpy 2.0 fix.

Copy link

@tangq tangq left a comment

Choose a reason for hiding this comment

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

@chengzhuzhang , the figures look good. The changes are straightforward - Adding TCO_60S60N as a new variable. I wouldn't worry too much about the small difference in averages (-2.67 vs -2.68).

@xylar
Copy link
Contributor

xylar commented Oct 29, 2024

Shoot! Clearly my local testing didn't catch all the numpy 2.0 issues. I'll try to figure out why and keep patching.

@chengzhuzhang
Copy link
Contributor Author

chengzhuzhang commented Oct 29, 2024

@xylar thank you for taking on this task!! And good thing that these CI/CD testing are in place to help inform the health of the patched builds. ..

@chengzhuzhang
Copy link
Contributor Author

@chengzhuzhang , the figures look good. The changes are straightforward - Adding TCO_60S60N as a new variable. I wouldn't worry too much about the small difference in averages (-2.67 vs -2.68).

Thank you for reviewing, @tangq !

@xylar
Copy link
Contributor

xylar commented Oct 29, 2024

@chengzhuzhang, I'm now able to reproduce the numpy errors locally. I'm re-testing with yet another patched cdms2 (conda-forge/cdms2-feedstock#97). I don't want to have to do another cycle so I will keep working locally until tests pass. Sorry for all the noise!

@chengzhuzhang
Copy link
Contributor Author

@chengzhuzhang, I'm now able to reproduce the numpy errors locally. I'm re-testing with yet another patched cdms2 (conda-forge/cdms2-feedstock#97). I don't want to have to do another cycle so I will keep working locally until tests pass. Sorry for all the noise!

No worries! Hope there aren't too many troubles patching.

@xylar
Copy link
Contributor

xylar commented Oct 29, 2024

@chengzhuzhang, we're finally good here, regarding numpy 2.0. I wouldn't be surprised if more thorough e3sm_diags or other testing reveals some edge cases, though. Keep me posted.

@chengzhuzhang
Copy link
Contributor Author

@chengzhuzhang, we're finally good here, regarding numpy 2.0. I wouldn't be surprised if more thorough e3sm_diags or other testing reveals some edge cases, though. Keep me posted.

Awesome! Thank you. Will let you know if more cases are found.

@chengzhuzhang chengzhuzhang merged commit 3f5b036 into main Oct 29, 2024
4 checks passed
@chengzhuzhang chengzhuzhang deleted the add_TCO_60S60N branch October 29, 2024 21:27
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.

[Bug]: lat-lon TCO calculations use inconsistent areas
3 participants