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

Simplify caching and remove state ids #841

Merged
merged 14 commits into from Jan 10, 2020
Merged

Simplify caching and remove state ids #841

merged 14 commits into from Jan 10, 2020

Conversation

sdrave
Copy link
Member

@sdrave sdrave commented Jan 8, 2020

Implements #838.

Note that this PR introduces an important change in the behavior of caching. When using with_, e.g.

m2 = m.with_(some_argument=new_value)

then the cache_region attribute (as well as the new cache_id attribute) of m2 will be reset to the default specified in the __dict__ of type(m2). This is a consequence of cache_region no longer being an __init__ argument. At least in the case of persistent disk caching, I think this is desirable, as m2 will probably require a cache_id different from m1.

@sdrave sdrave added pr:change pr:removal implementation labels Jan 8, 2020
@sdrave sdrave added this to the 2020.1 milestone Jan 8, 2020
@sdrave sdrave requested review from renefritze and pmli Jan 8, 2020
Copy link
Member

@pmli pmli left a comment

Below are some minor remarks.

Concerning PEP 8, maybe it's ok to also fix over-indentation in CacheableInterface._cached_method_call in this PR?

src/pymor/core/cache.py Outdated Show resolved Hide resolved
src/pymor/core/defaults.py Outdated Show resolved Hide resolved
src/pymor/core/defaults.py Outdated Show resolved Hide resolved
pmli
pmli approved these changes Jan 9, 2020
@sdrave sdrave merged commit 8dfedfd into master Jan 10, 2020
7 checks passed
@sdrave sdrave deleted the simplify_cache branch Jan 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:change pr:removal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants