Skip to content

Convert on_trait_change decorators to observe#654

Merged
aaronayres35 merged 6 commits into
masterfrom
convert-otc-decorators-to-observe
Mar 2, 2021
Merged

Convert on_trait_change decorators to observe#654
aaronayres35 merged 6 commits into
masterfrom
convert-otc-decorators-to-observe

Conversation

@aaronayres35
Copy link
Copy Markdown
Contributor

part of #416

This PR replaces all uses of the @on_trait_change decorator with the observe equivalent.

@on_trait_change("svg_coords,mouse_in")
def ensure_redraw(self):
@observe("svg_coords,mouse_in")
def ensure_redraw(self, event=None):
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This method and cell_properties_changed in a later file are never called standalone, but they are not privately named. So I made event a kwarg to protect against breaks from other callers, but this is likely overkill/unneeded. I am happy to change this to just event if a reviewer prefers.

Copy link
Copy Markdown
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

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

LGTM

@aaronayres35 aaronayres35 merged commit 00ac7c6 into master Mar 2, 2021
@aaronayres35 aaronayres35 deleted the convert-otc-decorators-to-observe branch March 2, 2021 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants