Skip to content
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

Migrate on_trait_change to observe #61

Open
8 tasks
aaronayres35 opened this issue Jul 1, 2021 · 1 comment
Open
8 tasks

Migrate on_trait_change to observe #61

aaronayres35 opened this issue Jul 1, 2021 · 1 comment

Comments

@aaronayres35
Copy link

aaronayres35 commented Jul 1, 2021

A large amount of work has already been undertaken to move ETS projects from on_trait_change to observe. This includes replacing use of the static trait change handlers such as _*_changed and the use of depends_on in Property traits.

We would like to migrate all of ETS if possible but given the time/resource constraints, we are going to go with the 90%-10% option here. Given our experience, we know that 90% of the work is more-or-less straightforward whereas 10% of the work leads us down rabbitholes which require significant debugging/investigation. Therefore, at the moment, we are only going to attack the easy/straightforward 90% and ignore the hard/difficult 10% of changes.

Note also that in some packages, this work was completed but a release hasn't been published so the changes aren't visible to the users. We need to expose the changes to the users in order to catch any issues potentially not caught by the testsuites.

  • depends_on is used a lot, especially in the examples, static @on_trait_change and dynamic on_trait_change are used heavily and so are the _*_changed handlers in Traits
  • There are still a large number of static change handlers i.e. _*_changed methods in PyFace.
  • There are uses of property_depends_on, dynamic uses of on_trait_change and a number of static change handlers i.e. _*_changed methods in TraitsUI
  • There are uses of the static @on_trait_change decorator and dynamic use of on_trait_change along with a few _*_changed handlers in Envisage.
  • There are a few uses of dynamic on_trait_change and a few _*_changed methods in AppTools
  • There are a few uses of dynamic on_trait_change and a large number of _*_changed methods in Enable
  • There's one use of depends_on, a few uses of on_trait_change and a large number of _*_changed methods in Chaco
  • SciMath hasn't been touched at all at the moment
@rahulporuri
Copy link
Contributor

Note : From the looks of it, we missed the _*_fired special methods.

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

No branches or pull requests

2 participants