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 ESMValTool Equilibrium Climate Sensitivity recipe #51

Merged
merged 4 commits into from
Jan 15, 2025

Conversation

bouweandela
Copy link
Contributor

@bouweandela bouweandela commented Jan 8, 2025

Description

Add Equilibrium Climate Sensitivity (ECS) to the ESMValTool metrics package.

Related to #32.

This works, but will result in many failures because of missing data and may be inaccurate because of missing cell areas. Ideas for further improvement:

  • Select only datasets that have both experiments and all four variables
  • Select only datasets that have a contiguous, shared, nonzero timerange
  • Add cell areas to the groups

Checklist

Please confirm that this pull request has done the following:

  • Tests added
  • Documentation added (where applicable)
  • Changelog item added to changelog/

Copy link

codecov bot commented Jan 10, 2025

@lewisjared
Copy link
Contributor

@bouweandela I had a go at resolving the conflicts due to renaming packages here: bouweandela#1

Is this ready for review? I had a quick look through and it's looking great, with a few extra TODO's to add to the list :D

@bouweandela
Copy link
Contributor Author

Is this ready for review?

It is ready if you are OK with postponing the TODOs to a next pull request.

@lewisjared
Copy link
Contributor

It is ready if you are OK with postponing the TODOs to a next pull request.

Have you seen how many TODOs we have 😆

@lewisjared lewisjared self-requested a review January 15, 2025 08:50
Copy link
Contributor

@lewisjared lewisjared left a comment

Choose a reason for hiding this comment

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

Nice stuff


Recipe = dict[str, Any]

OutputBundle = dict[str, Any]
Copy link
Contributor

Choose a reason for hiding this comment

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

We should make a common type and validation for this in due course

@@ -0,0 +1 @@
"""Tests for the ref-metrics-esmvaltool package."""
Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't typically made the test directory a python module. What are the pros of this?

Copy link
Contributor Author

@bouweandela bouweandela Jan 15, 2025

Choose a reason for hiding this comment

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

I removed the files for now and we can talk about it later. In my experience, it is safer to put __init__.py files everywhere to avoid running into unexpected errors because some development tooling (e.g. documentation builder, test runner, etc) interprets the files as namespace packages.

It is also a common practice to ship the tests with the software. This has the advantage that you can even run the tests when installing the package from PyPI. This is e.g. useful when checking that the package is correctly building on conda-forge. To do this, I would move the tests folder into the src/cmip_ref_metrics_esmvaltool folder and add __init__.py files.

@bouweandela bouweandela merged commit 6dd6995 into CMIP-REF:main Jan 15, 2025
13 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.

2 participants