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

Deal with __getstate__ methods #633

Merged
merged 20 commits into from
Apr 15, 2021
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
078f382
remove __getstate__ in abstract_data_source.py
aaronayres35 Apr 7, 2021
3745495
remove __getstate__ from axis.py
aaronayres35 Apr 7, 2021
b7f7210
remove __getstate__ from grid.py
aaronayres35 Apr 7, 2021
72700bb
remove __getstate__ from base_xy_plot.py
aaronayres35 Apr 7, 2021
77c0e59
remove __getstate__ from cross_plot_frame.py, also delete commented o…
aaronayres35 Apr 7, 2021
80a16b9
remove __getstate__ from lineplot.py
aaronayres35 Apr 7, 2021
fae52fa
remove __getstate__ from multi_line_plot.py
aaronayres35 Apr 7, 2021
c7c93ab
remove __getstate__ from tools/simple_zoom.py
aaronayres35 Apr 7, 2021
f38cbcc
remove __getstate__ from simple_plot_frame.py
aaronayres35 Apr 7, 2021
eeea965
remove __getstate__ from abstract_mapper.py (_cache_valid is not a tr…
aaronayres35 Apr 7, 2021
6fc674f
fix array_data_source.py __getstate__ and its tests
aaronayres35 Apr 7, 2021
ba66fc8
update plot_containers.py
aaronayres35 Apr 7, 2021
2152d9b
delete commented out test skip
aaronayres35 Apr 7, 2021
a984b40
delete _pickles commented out code
aaronayres35 Apr 7, 2021
6bfb912
make all private cache related traits transient (might be overrkill)
aaronayres35 Apr 13, 2021
c005b55
Merge branch 'master' into audit-dunder-state-methods
aaronayres35 Apr 13, 2021
fd4b2c9
Merge branch 'master' into audit-dunder-state-methods
aaronayres35 Apr 14, 2021
55893e0
fix merge conflict issues
aaronayres35 Apr 15, 2021
f3395f0
bring back #:
aaronayres35 Apr 15, 2021
14789fd
Merge branch 'master' into audit-dunder-state-methods
aaronayres35 Apr 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions chaco/tools/simple_zoom.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,13 @@ class SimpleZoom(AbstractOverlay, ToolHistoryMixin, BaseZoomTool):
#: Perform a "box" selection on two axes.
tool_mode = Enum("box", "range")

<<<<<<< HEAD
# Is the tool always "on"? If True, left-clicking always initiates
# a zoom operation; if False, the user must press a key to enter zoom mode.
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like you lost the #: because of the merge conflicts.

always_on = Bool(False, transient=True)

# Defines a meta-key, that works with always_on to set the zoom mode. This
# is useful when the zoom tool is used in conjunction with the pan tool.
always_on_modifier = Enum(None, "shift", "control", "alt", transient=True)
=======
#: Is the tool always "on"? If True, left-clicking always initiates
#: a zoom operation; if False, the user must press a key to enter zoom mode.
always_on = Bool(False)

#: Defines a meta-key, that works with always_on to set the zoom mode. This
#: is useful when the zoom tool is used in conjunction with the pan tool.
always_on_modifier = Enum(None, "shift", "control", "alt")
>>>>>>> master

# -------------------------------------------------------------------------
# Zoom control
Expand All @@ -78,48 +68,27 @@ class SimpleZoom(AbstractOverlay, ToolHistoryMixin, BaseZoomTool):
#: Conversion ratio from wheel steps to zoom factors.
wheel_zoom_step = Float(1.0)

<<<<<<< HEAD
# The key press to enter zoom mode, if **always_on** is False. Has no effect
# if **always_on** is True.
enter_zoom_key = Instance(KeySpec, args=("z",), transient=True)

# The key press to leave zoom mode, if **always_on** is False. Has no effect
# if **always_on** is True.
exit_zoom_key = Instance(KeySpec, args=("z",), transient=True)
=======
#: The key press to enter zoom mode, if **always_on** is False. Has no effect
#: if **always_on** is True.
enter_zoom_key = Instance(KeySpec, args=("z",))

#: The key press to leave zoom mode, if **always_on** is False. Has no effect
#: if **always_on** is True.
exit_zoom_key = Instance(KeySpec, args=("z",))
>>>>>>> master

#: Disable the tool after the zoom is completed?
disable_on_complete = Bool(True)

<<<<<<< HEAD
# The minimum amount of screen space the user must select in order for
# the tool to actually take effect.
minimum_screen_delta = Int(10, transient=True)
=======
#: The minimum amount of screen space the user must select in order for
#: the tool to actually take effect.
minimum_screen_delta = Int(10)
>>>>>>> master

# -------------------------------------------------------------------------
# Appearance properties (for Box mode)
# -------------------------------------------------------------------------

<<<<<<< HEAD
# The pointer to use when drawing a zoom box.
pointer = Str("magnifier", transient=True)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This may be bad if pointer is meant to be a class attribute, similar to stack_index in plot_container.py.

I need to climb up the class hierarchy to see if it was previously defined as a trait. I remember Kit mentioning this being a point of confusion. I am not sure what the ideal way to avoid this confusion would be (aside from maybe a comment above saying if this is a class attribute or just setting a trait to a value. I guess if setting a trait to some value, you could do as I have done here? and explicitly do something like Str(___)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As a quick sanity check, on master I defined a class attribute thing = "A" on SimpleZoom. I then ran:

from chaco.tools.simple_zoom import SimpleZoom
SimpleZoom.thing  # I see 'A' printed
SimpleZoom.pointer  # I get an error "type object 'SimpleZoom' has no attribute 'pointer'"

So, I believe the change made here is the right one

=======
#: The pointer to use when drawing a zoom box.
pointer = "magnifier"
>>>>>>> master

#: The color of the selection box.
color = ColorTrait("lightskyblue")
Expand All @@ -138,13 +107,8 @@ class SimpleZoom(AbstractOverlay, ToolHistoryMixin, BaseZoomTool):
#: The thickness of selection rectangle border.
border_size = Int(1)

<<<<<<< HEAD
# The possible event states of this zoom tool.
event_state = Enum("normal", "selecting", transient=True)
=======
#: The possible event states of this zoom tool.
event_state = Enum("normal", "selecting")
>>>>>>> master

# ------------------------------------------------------------------------
# Key mappings
Expand Down