-
Notifications
You must be signed in to change notification settings - Fork 99
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
remove old style trait #837
Conversation
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.
Generally looks good - haven't checked that you've tracked down all of the Trait
instances, but it looks relatively comprehensive.
A couple of nit-picky suggestions, but nothing major.
chaco/axis.py
Outdated
@@ -79,13 +80,13 @@ class PlotAxis(AbstractOverlay): | |||
origin = Enum("bottom left", "top left", "bottom right", "top right") | |||
|
|||
#: The text of the axis title. | |||
title = Trait("", Str, Unicode) # May want to add PlotLabel option | |||
title = Str("") # May want to add PlotLabel option |
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.
Str()
is preferable (the default is ""
already)
chaco/plots/multi_line_plot.py
Outdated
@@ -484,7 +484,7 @@ def _render(self, gc, line_points, selected_points=None): | |||
# Existence of self.color_func overrides self.color. | |||
color_func = self.color_func | |||
else: | |||
color_func = lambda k: self.color_ | |||
def color_func(k): return self.color_ |
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.
This looks like an unrelated change, but put a line break after the :
for the function body.
chaco/plotscrollbar.py
Outdated
@@ -36,14 +36,14 @@ class PlotScrollBar(NativeScrollBar): | |||
|
|||
# The value of the override plot to use, if any. If None, then uses | |||
# self.component. | |||
_plot = Trait(None, Any) | |||
_plot = Any(None) |
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.
I think Any
defaults to None
so you can just do Any()
.
chaco/tools/image_inspector_tool.py
Outdated
@@ -42,7 +42,7 @@ class ImageInspectorTool(BaseTool): | |||
|
|||
# Stores the value of self.visible when the mouse leaves the tool, | |||
# so that it can be restored when the mouse enters again. | |||
_old_visible = Enum(None, True, False) # Trait(None, Bool(True)) | |||
_old_visible = Enum(None, True, False) |
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.
This could also be Union(None, Bool)
- I don't care which, it's whatever you think is best.
Closes #829. Closes #828. Removes all instances of
Trait
andEither
trait types.