-
Notifications
You must be signed in to change notification settings - Fork 98
Deal with __getstate__ methods #633
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
Changes from all commits
078f382
3745495
b7f7210
72700bb
77c0e59
80a16b9
fae52fa
c7c93ab
f38cbcc
eeea965
6fc674f
ba66fc8
2152d9b
a984b40
6bfb912
c005b55
fd4b2c9
55893e0
f3395f0
14789fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,10 +54,10 @@ class BaseContourPlot(Base2DPlot): | |
| # ------------------------------------------------------------------------ | ||
|
|
||
| # Is the cached level data valid? | ||
| _level_cache_valid = Bool(False) | ||
| _level_cache_valid = Bool(False, transient=True) | ||
|
|
||
| # Is the cached color data valid? | ||
| _colors_cache_valid = Bool(False) | ||
| _colors_cache_valid = Bool(False, transient=True) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the cache valid flags arent transient, then the caches themselves should also be transient - I would think
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As you suggested, I printed
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Does this mean all private traits be transient?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sigh. I was afraid of that.
Let's not do that. Definitely not in this PR.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, I imagine the code will recreate the cache if a |
||
|
|
||
| # List of levels and their associated line properties. | ||
| _levels = List | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,16 +46,16 @@ class ContourLinePlot(BaseContourPlot): | |
| # ------------------------------------------------------------------------ | ||
|
|
||
| # Are the cached contours valid? If False, new ones need to be computed. | ||
| _contour_cache_valid = Bool(False) | ||
| _contour_cache_valid = Bool(False, transient=True) | ||
|
|
||
| # Cached collection of traces. | ||
| _cached_contours = Dict | ||
| _cached_contours = Dict(transient=True) | ||
|
|
||
| # Is the cached width data valid? | ||
| _widths_cache_valid = Bool(False) | ||
| _widths_cache_valid = Bool(False, transient=True) | ||
|
|
||
| # Is the cached style data valid? | ||
| _styles_cache_valid = Bool(False) | ||
| _styles_cache_valid = Bool(False, transient=True) | ||
|
|
||
| # Cached list of line widths | ||
| _widths = List | ||
|
Comment on lines
60
to
61
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks like this is technically a cache but like I said earlier, this will be ignored/recomputed because the |
||
|
|
||
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.
_cache_validis not a trait on this class or any of its base classesUh oh!
There was an error while loading. Please reload this page.
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.
sigh. but it is a trait on the subclasses e.g.
Base1DMapperso those need to be updatedUh oh!
There was an error while loading. Please reload this page.
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.
Ah you are right. TBH I believe that all related traits should be transient even if they weren't perviously involved in a
__getstate__method. For example other classes have_screen_cache_validor_selection_cache_validtraits. I think I will update all of these (to be specific I am going to update any privately named cache trait) to be transient as I can't see why they shouldn't all be soIt also doesn't make sense that for some objects the
_cache_validand similar traits would be transient traits but on others not