Replace dynamic on_trait_change with observe#590
Merged
Conversation
aaronayres35
commented
Mar 31, 2021
Comment on lines
+112
to
+120
|
|
||
| self.datasource_change_handler( | ||
| TraitChangeEvent( | ||
| object=new, | ||
| name="color_data", | ||
| old=None, | ||
| new=new.color_data | ||
| ) | ||
| ) |
Contributor
Author
There was a problem hiding this comment.
This is certainly a pattern we would like to avoid. For now I just went with the most straightforward transition possible to preserve behavior, but at some point we should rethink this
rahulporuri
approved these changes
Apr 1, 2021
Contributor
rahulporuri
left a comment
There was a problem hiding this comment.
Mostly LGTM with a few suggestions
| self.request_redraw() | ||
|
|
||
| def _either_metadata_changed(self): | ||
| def _either_metadata_updated(self, event): |
Contributor
There was a problem hiding this comment.
just to confirm, this method was inherited?
Contributor
Author
There was a problem hiding this comment.
Yep, from BaseXYPlot
Co-authored-by: Poruri Sai Rahul <rporuri@enthought.com>
Closed
Contributor
|
If anyone sees this: A typo slipped through with this pull request. I've opened an issue for this: #914 |
itziakos
added a commit
that referenced
this pull request
Oct 11, 2025
(#915) As this fixes a typo clearly visible in the source code, I have not added any code to reproduce the error nor a unit test. Hope this is still fine (I'm short on time currently, sorry!). See [Issue 914](#914) and/or the original pull request #590 that introduced this bug. Co-authored-by: Ioannis Tziakos <ioannist@enthought.com>
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.
This PR starts replacing the dynamic uses of on_trait_change with observe equivalents
I am going to arbitrarily stop here to keep this PR shorter to review. After these changes, there are 18 files left containing
.on_trait_changewhich can be addressed in a separate PR.