There are a number of Chaco classes which override __getstate__ and possibly __setstate__. Most of these seem to be removing traits from the state dict, which is now correctly handled by marking those traits as transient.
For example:
|
def __getstate__(self): |
|
state = super(LinePlot,self).__getstate__() |
|
for key in ['traits_view']: |
|
if key in state: |
|
del state[key] |
|
|
|
return state |
This is removing the traits_view trait from the state - under normal Traits, this will never be in the state because of special handling of Views, so this whole method can be removed.
Another example:
|
def __getstate__(self): |
|
state = super(PlotGrid,self).__getstate__() |
|
for key in ['_cache_valid', '_tick_list', '_tick_positions', '_tick_extents']: |
|
if key in state: |
|
del state[key] |
|
|
|
return state |
Here the traits _cache_valid, _tick_list, _tick_positions, _tick_extents are being removed from the state. These traits should be marked with transient=True metadata and then the __getstate__ method can be removed.
If it turns out that there are necessary things being done in a __getstate__, we should make sure that there is a super call.
There are a number of Chaco classes which override
__getstate__and possibly__setstate__. Most of these seem to be removing traits from the state dict, which is now correctly handled by marking those traits astransient.For example:
chaco/chaco/lineplot.py
Lines 415 to 421 in e342361
This is removing the
traits_viewtrait from the state - under normal Traits, this will never be in the state because of special handling of Views, so this whole method can be removed.Another example:
chaco/chaco/grid.py
Lines 413 to 419 in e342361
Here the traits
_cache_valid,_tick_list,_tick_positions,_tick_extentsare being removed from the state. These traits should be marked withtransient=Truemetadata and then the__getstate__method can be removed.If it turns out that there are necessary things being done in a
__getstate__, we should make sure that there is asupercall.