-
Notifications
You must be signed in to change notification settings - Fork 18
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 caching in AiidaNodeViewWidget
#686
Implement caching in AiidaNodeViewWidget
#686
Conversation
@AndresOrtegaGuerrero this should resolve your issue. Essentially, when @superstar54 implemented caching of node views in the QE app, we stopped using AWB's |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #686 +/- ##
==========================================
+ Coverage 83.24% 83.48% +0.23%
==========================================
Files 18 18
Lines 3588 3602 +14
==========================================
+ Hits 2987 3007 +20
+ Misses 601 595 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Can you point to the original PR in QeApp. It's not super clear what is meant by caching in this context. |
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.
Nice!
Hi @danielhollas , It here: aiidalab/aiidalab-qe#921 Sorry that I didn't notice your message when approving this PR. |
667f957
to
31ca96d
Compare
Hi @edan-bainglass , as suggested by @yakutovicha , could you add a test for the caching? |
Yep. I'll add a test for this and the loader from #685 |
f1a5f4e
to
16799f2
Compare
AiiDANodeViewWidget
AiidaNodeViewWidget
This PR reverts to using the AWB node view widget, which now supports caching (aiidalab/aiidalab-widgets-base#686).
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.
I am a bit wary of the changes in this PR since the cache introduced here is unbounded. So for example for a large workchain, a user clicking around the node tree can blow up the memory of the Python process (I don't know if that is a real concern or node, but I assume some viewers may consume nontrivial amount of memory.
At the very least we need to provide a way to clear the cache, probably in the reset
method. Or better yet, use one of pythons stdlib lru_cache decorators and wrap the logic in a cached function call somehow.
Moving node view caching mechanism implemented by @superstar54 in the QE app (aiidalab/aiidalab-qe#921) into
AiidaNodeViewWidget