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 Change in existing functionality pr:removal Removes a feature 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 January 8, 2020 14:57
Copy link
Member

@pmli pmli left a comment

Choose a reason for hiding this comment

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

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
@sdrave sdrave merged commit 8dfedfd into master Jan 10, 2020
@sdrave sdrave deleted the simplify_cache branch January 10, 2020 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:change Change in existing functionality pr:removal Removes a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants