-
Notifications
You must be signed in to change notification settings - Fork 85
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
Implement new framework to observe and notify for trait changes #977
Comments
Assuming the PoC in #942 has more or less get the framework right, I will try to break down components in the order of implementation:
After point 4, the following can happen independently of the rest. I would consider them orthogonal to this issue, although not necessarily excluded from the 6.1.0 release (to be confirmed):
|
I have updated the main comment with more specific tasks and their dependencies. One can open separate issues when we come closer to being able to work on them. |
I initially added this item in the list because I had implemented this feature in my test branch. The print method does something like this:
It was useful for inspection (i.e. for me while tackling recursion) and would be useful for users learning the mini-language, this is not needed for another purposes. While self-documenting components are preferred to written documentation and the feature is valuable for educational purposes, it still requires code, and with code, maintenance. For most use cases, I believe the mini-language expression is intuitive enough such that this feature for inspection may not be necessary. All-in-all, this is a nice-to-have, not a must have. With that, I am planning to exclude this feature from the list and call this issue feature-complete. |
Status update: This is the last pending item
API documentation is completed as part of the PRs introducing new code. |
This is an issue for implementing a new, simpler and cleaner, parallel notification system to the current trait listeners, with the eventual intent of replacing the existing listeners in new code, and eventually deprecating for old code.
Targeting EEP 3.
Specific "end" goals for this issue:
@observe
decorator analogous to the@on_trait_change
More specific, smaller issues will be opened referencing this one.
Updated
Specific tasks:
ObserverGraph
for representing a graph of observers (e.g. "a.b.c" is a graph from node "a" to node "b" to node "c"). See PR Implement ObserverGraph with NamedTraitObserver #976Expression
for creating instances ofObserverGraph
, depends on 1.See code in here. (issue User facing Expression for creating instances of ObserverGraph #1024, PR Add user-facing Expression for composing a graph of observers #1067)
Expression
, depends on 4.See PR Add mini-language standalone parser for observe #1066 for getting a syntax tree, and Implement parsing logic for converting text to Expression #1079 for converting it to Expression.
ObserverGraph
and attach/detach notifiers (depends on 1 for usingObserverGraph
in tests, but a stub replacement can be made easily)See PR Implement logic for adding/removing notifiers for a given ObserverGraph #1023
See PR Implement the logic for observing a named trait #1069
See PR Implement ListItemObserver for observing mutations to a list #1071
See PR Implement DictItemObserver for observing mutations to a dict #1072
See PR Implement SetItemObserver for observing mutations on a set #1075
trait_added
(depends on 2, 3. Meaningful semi-integration tests will depend on 1, 6 and 7 in addition.)See PR Add trait_added support for observing a named trait #1077
trait_added
support to FilteredTraitObserver (Add trait_added support for observing a named trait #1077)See PR Add an observer for observing traits using an arbitrary filter #1078
metadata
method inExpression
, and the use of"+"
in the text parser.See Add MetadataFilter for observing traits using metadata #1095
observe
decorator andHasTraits.observe
instance method.See PR Add observe decorator and instance method #1086
See PR Add warning while observing container items with comparison mode set to equality #1117
17. Implement theprint
method on Expression (bonus)observers
->observation
.Expression
->ObserverExpression
See PR Rename (observers) Expression to ObserverExpression #1118
The text was updated successfully, but these errors were encountered: