Skip to content

remove old style trait#837

Merged
ctangell merged 8 commits into
mainfrom
829-remove-old-style-trait
Oct 13, 2022
Merged

remove old style trait#837
ctangell merged 8 commits into
mainfrom
829-remove-old-style-trait

Conversation

@ctangell
Copy link
Copy Markdown
Contributor

Closes #829. Closes #828. Removes all instances of Trait and Either trait types.

Copy link
Copy Markdown
Contributor

@corranwebster corranwebster left a 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.

Comment thread chaco/axis.py Outdated

#: The text of the axis title.
title = Trait("", Str, Unicode) # May want to add PlotLabel option
title = Str("") # May want to add PlotLabel option
Copy link
Copy Markdown
Contributor

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)

Comment thread chaco/plots/multi_line_plot.py Outdated
color_func = self.color_func
else:
color_func = lambda k: self.color_
def color_func(k): return self.color_
Copy link
Copy Markdown
Contributor

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.

Comment thread chaco/plotscrollbar.py Outdated
# The value of the override plot to use, if any. If None, then uses
# self.component.
_plot = Trait(None, Any)
_plot = Any(None)
Copy link
Copy Markdown
Contributor

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().

Comment thread chaco/tools/image_inspector_tool.py Outdated
# 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)
Copy link
Copy Markdown
Contributor

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.

@ctangell ctangell merged commit e3ddc53 into main Oct 13, 2022
@corranwebster corranwebster added the needs backport Needs to be backported to current maint/* label Oct 13, 2022
@corranwebster corranwebster deleted the 829-remove-old-style-trait branch January 24, 2023 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs backport Needs to be backported to current maint/*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove uses of old-style traits constructors ScatterInspectorOverlay incompatible with enable v5.3.0

2 participants