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
Lazy DictionaryTreeBrowser #2623
Lazy DictionaryTreeBrowser #2623
Conversation
Codecov Report
@@ Coverage Diff @@
## RELEASE_next_patch #2623 +/- ##
======================================================
+ Coverage 76.90% 76.93% +0.02%
======================================================
Files 201 201
Lines 29668 29706 +38
Branches 6503 6514 +11
======================================================
+ Hits 22817 22854 +37
- Misses 5104 5105 +1
Partials 1747 1747
Continue to review full report at Codecov.
|
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.
Found just a minor typo.
I am starting to wonder if we are not taking the DTB too far. It is really a shame that something that we added in the early days just for convenience has ended up being the major performance bottleneck in HyperSpy. At the end of the day, the main issue is that we have to process the dictionary in order to transform it into a DTB, and that takes time. A different approach would be to create a subclass of By the way, there is a related thread in StackOverflow. The top answer suggest using a new 3.7 feature to implement something like this, dataclasses. In the meantime, I agree that this PR is a good improvement of the situation, so I think that it would be worth to merge it in time for v1.6.2. Could you merge Rnp in? I'll try to find time to review it later this week. |
Yes, I agree, it would be good to explore more standard alternative for 2.0. Overall, the |
Does this solve #2045? Would this PR be a chance to also add the requested option for making reading of |
No it doesn't fix the memory issue mentioned of #2045, because the |
Yes, maybe it makes more sense to go for a separate PR. @francisco-dlp still wanted to have a look at this one though. |
… when running pytest in tests folder.
Make the
DictionaryTreeBrowser
lazy by default to reduce overhead when creating signal. The lazy attributes are processed when the first attribute is accessed.Closes #368.
Progress of the PR
DictionaryTreeBrowser
lazy by default,CHANGES.rst
,Minimal example of the bug fix or the new feature
Note that this example can be useful to update the user guide.