-
Notifications
You must be signed in to change notification settings - Fork 4
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 caching options #412
base: dev
Are you sure you want to change the base?
Add caching options #412
Conversation
- define NLMOD_CACHE_OPTIONS - set defaults (identical to current caching defaults) - add context manager for cache options - add functions to set, get and reset options.
- add check for setting NLMOD_CACHING_OPTIONS - add logging when global config modifies default - do not check hashes if global option overrides cache decorator setting - add explicit dataset coordinate check, useful if hash checks are disabled.
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.
Just one comment and then you are good to go, should be an easy fix
- use assert_identical - invalidate cache when explicit check fails
I went for full debug level logging in the excplicit check. Also, I removed "area" from the data set variables in I think this is good to go now. |
This allows overriding caching behavior using
nlmod.config.NLMOD_CACHE_OPTIONS
. This allows you to turn off the hash checks, and optionally activate an explicit dataset coordinate comparison. This allows some more flexibility when running into issue #389.Recommended usage:
add config submodule
in cache.py