-
Notifications
You must be signed in to change notification settings - Fork 16
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 precomputed regridder save bug #462
Conversation
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.
@stephenworsley This looks ideal 👍
The only thing I'd ask you to consider is pushing the defensive esmf_version
logic up into the regridder instance, such that it defaults to a known "unknown" string value (defined by a suitable module constant e.g., ESMF_VERSION_DEFAULT: str = "unknown"
.
You can then control setting the esmf_version
to an actual esmf
version or nullify it for appropriate operations (like the user providing pre-computed weights). But in essence, it's always a string and never None
.
So esmf_version
will always be a string, thus loading/saving should always "just work"™️.
Perhaps also consider (not necessarily in this PR) what matadata on a regridder is read-only or mutable. I'd guess that esmf_version
is read-only 🤔
Anyways, have a ponder and I'm happy to go with whatever you recommend 💯
pre-commit.ci autofix |
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.
@stephenworsley LGTM 🎉
Addresses #433.