-
Notifications
You must be signed in to change notification settings - Fork 3
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
Creating new cache used full ds instead of reduced ds #340
Conversation
Required to ensure that the cached function does not use data_vars that not explicitly required
What is the status of this PR? Are the errors in the documentation (for example https://nlmod--340.org.readthedocs.build/en/340/examples/03_local_grid_refinement.html) caused by this change? Also, the dev-branch itself gives other errors (for example https://nlmod.readthedocs.io/en/latest/examples/03_local_grid_refinement.html). Are these also related to caching? |
The problem here is that in the current implementation of the cache function, the cached function is called with the origional dataset and not with the stripped dataset. In this PR the line I think it is important to use the stripped dataset here, as only the checksum of the stripped dataset is checked. This ensures that the cached function may not use any variables that are not part of the stripped dataset. However, this requires us to be very exact with specifying which variables of the dataset need to be part of the stripped dataset. I presume that this results in errors of missing variables in cases where I did not specify this correctly. I haven't checked the tests though.. |
So |
Maybe the error could be made more helpful to excecute the function call ( |
@bdestombe, I have fixed the delr/delc error you describe by adding the delr/delc to the datavars in the This is a temporary fix, as we propose to remove these data variables entirely and compute them when necessary from x,y and extent. After that change caching should be more straightforward with minimal datasets. See #343. Additionally, I modified some |
Thanks! Is requiering botm part new code, that is not yet part of this PR's codebase? Or how come those tests didn't fail before? |
One thing we need to check is that coordinates that number from 1 to N do not have to be defined in |
Github CI doesn't test the notebooks. The notebooks test functionality in real models, which in some cases requires extra information compared to the CI tests, I think. |
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.
Great! Tests are fixed again.
@bdestombe, maybe you can do a final check and merge if you're happy with these changes? |
Required to ensure that the cached function does not use data_vars that not explicitly required