-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Explicit deps and interval for computed vars #3231
Explicit deps and interval for computed vars #3231
Conversation
benedikt-bartscher
commented
May 4, 2024
•
edited
Loading
edited
Ready for initial review. Will add more tests if you like this idea :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is cool. I like the new features and flexibility.
308b595
to
bb7fc06
Compare
@@ -1685,6 +1697,7 @@ def get_delta(self) -> Delta: | |||
# and always dirty computed vars (cache=False) | |||
delta_vars = ( | |||
self.dirty_vars.intersection(self.base_vars) | |||
.union(self.dirty_vars.intersection(self.computed_vars)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@masenf did I find a bug here? You mentioned that one could define a computed var without dependencies and manually mark it as dirty. If I am not mistaken, this line is needed for this to work.
Needs rebase after #3254 is merged |
4e31200
to
70bddda
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome - I like having cache
as an argument rather than a separate rx.cached_var
, perhaps we can move more to that in the future.
Thanks for your feedback and the merge. Maybe we should deprecate |