-
Notifications
You must be signed in to change notification settings - Fork 2
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
Caching For
#613
Caching For
#613
Conversation
Signed-off-by: liamhuber <[email protected]>
Signed-off-by: liamhuber <[email protected]>
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more |
Pull Request Test Coverage Report for Build 13689345500Details
💛 - Coveralls |
For the tests, what about doing something simple like counter = 0
@as_function_node('m')
def SideEffectNode(n: int):
counter += 1
return n**2
s = SideEffectNode.for_node(iter_on='n')(n=[1,2,3,4])
s.pull()
s.pull()
self.assertEqual(counter, 4) inside a sub test? EDIT: I had to edit a few times to get it right, sorry if you're reading on mobile. |
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.
Code itself seems clean enough, and should do what we want so 👍
I'll add the test and merge tonight then |
Signed-off-by: liamhuber <[email protected]>
Co-Authored-By: Marvin Poul <[email protected]> Signed-off-by: liamhuber <[email protected]>
Closes #610
Basically instead of always rebuilding the child graph, we only rebuild it on cache misses. This is still a bit too aggressive of a rebuild, since in principle we only need to rebuild when the lengths of things we're iterating on change. Nonetheless, it's a simple step in the right direction.
@pmrv does the architecture look ok? Also, I'd like to add a test for this, but all I can think of is iterating over
standard_nodes.Sleep
and making sure it's faster the second time, but I don't really want to make such a slow test -- do you see a more clever route?