Skip to content

Conversation

@manishvenu
Copy link
Collaborator

The create_regridder function default looks for the reuse_weights file if it exists using an if statement, instead we can follow this: pangeo-data/xESMF#234 (comment), which uses os.path.isfile instead.

Fixes CROCODILE-CESM#58

@manishvenu manishvenu marked this pull request as draft July 9, 2025 16:45
@manishvenu manishvenu marked this pull request as ready for review July 9, 2025 16:54
@ashjbarnes ashjbarnes self-assigned this Jul 10, 2025
Copy link
Collaborator

@helenmacdonald helenmacdonald left a comment

Choose a reason for hiding this comment

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

Thanks @manishvenu - looks good to me but is there a place where we can put this warning back in:
Using existing weights file at {outfile} to save computing time. Delete weights file to regenerate weights
?

@manishvenu
Copy link
Collaborator Author

Hey Helen,

I added the warning back and added an arg to make sure the unmapped points become NaN, xesmf (or maybe ESMF) has this behavior of putting zeros if it's unmapped, which is just a mistake waiting to happen!

Copy link
Collaborator

@helenmacdonald helenmacdonald left a comment

Choose a reason for hiding this comment

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

Thanks - looks good to me

@manishvenu
Copy link
Collaborator Author

Awesome! Will merge

@manishvenu manishvenu merged commit 15afe46 into COSIMA:main Oct 7, 2025
6 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.

Reword regridding.py create_regridder

3 participants