remove old style trait#837
Merged
Merged
Conversation
corranwebster
approved these changes
Oct 13, 2022
Contributor
corranwebster
left a comment
There was a problem hiding this comment.
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.
|
|
||
| #: The text of the axis title. | ||
| title = Trait("", Str, Unicode) # May want to add PlotLabel option | ||
| title = Str("") # May want to add PlotLabel option |
Contributor
There was a problem hiding this comment.
Str() is preferable (the default is "" already)
| color_func = self.color_func | ||
| else: | ||
| color_func = lambda k: self.color_ | ||
| def color_func(k): return self.color_ |
Contributor
There was a problem hiding this comment.
This looks like an unrelated change, but put a line break after the : for the function body.
| # The value of the override plot to use, if any. If None, then uses | ||
| # self.component. | ||
| _plot = Trait(None, Any) | ||
| _plot = Any(None) |
Contributor
There was a problem hiding this comment.
I think Any defaults to None so you can just do Any().
| # 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) |
Contributor
There was a problem hiding this comment.
This could also be Union(None, Bool) - I don't care which, it's whatever you think is best.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #829. Closes #828. Removes all instances of
TraitandEithertrait types.