aiidalab / aiidalab-widgets-base

Reusable widgets for AiiDAlab applications
MIT License
6 stars 17 forks source link

Build NodeTree on demand #583

Closed superstar54 closed 2 months ago

superstar54 commented 2 months ago

Fix https://github.com/aiidalab/aiidalab-widgets-base/issues/584

This PR introduces the idea that: only build NodeTree on demand.

Demo

Here I used the result of the IR/Raman plugin (from @AndresOrtegaGuerrero ) as a example. Before, it's almost impossible to load it in the NodeTree.

Using this PR:

https://github.com/aiidalab/aiidalab-widgets-base/assets/11457659/18aa487e-a6f6-429d-88b2-0b66ac9337ef

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.17%. Comparing base (826ad43) to head (795af3f). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #583 +/- ## ======================================= Coverage 96.17% 96.17% ======================================= Files 11 11 Lines 1177 1177 ======================================= Hits 1132 1132 Misses 45 45 ``` | [Flag](https://app.codecov.io/gh/aiidalab/aiidalab-widgets-base/pull/583/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | Coverage Δ | | |---|---|---| | [python-3.10](https://app.codecov.io/gh/aiidalab/aiidalab-widgets-base/pull/583/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | `96.17% <ø> (ø)` | | | [python-3.9](https://app.codecov.io/gh/aiidalab/aiidalab-widgets-base/pull/583/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | `96.17% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

superstar54 commented 2 months ago

@danielhollas This PR is also relevant to your app; please review it if you have time.

superstar54 commented 2 months ago

@giovannipizzi This PR tried to fix one of the two issues from the Node Tree widget, which we discussed in yesterday's meeting. Comments are welcome.

danielhollas commented 2 months ago

@superstar54 this is amazing, thanks so much on working on this. :clap: I badly need it for my app as well so I will definitely take a look and test it with my app, hopefully tomorrow.

It's nice to see that there was not more code needed for this; I was a bit afraid that it will be more difficult to implement. Did you notice any downsides / weird corner cases in your implementation?

giovannipizzi commented 2 months ago

That's fantastic, great! If Daniel checks it it would be great and then please merge it! Pinging @cpignedoli as well.

As a note (on existing code, not what you changed): is _default_openend a typo for _default_opened or it's correct?

superstar54 commented 2 months ago

As a note (on existing code, not what you changed): is _default_openend a typo for _default_opened or it's correct?

:+1: It's a typo. I fixed it.

AndresOrtegaGuerrero commented 2 months ago

@superstar54 I noticed the change in color of the WorkChains with finished[0] from green to gray, image Technically it doesnt affect the performance, or the visualization of the elements of the three but i was just wondering if it should be address or ignored ?

cpignedoli commented 2 months ago

@superstar54 this is great. I tested on my docker for something small just to confirm it works. In addiiton, I checked with @AndresOrtegaGuerrero on a large Raman case, this PR seems to solve our problems.

superstar54 commented 2 months ago

I noticed the change in color of the WorkChains with finished[0] from green to gray,

Hi @AndresOrtegaGuerrero , thanks for pointing out this. it should be fixed in 795af3f.

AndresOrtegaGuerrero commented 2 months ago

I noticed the change in color of the WorkChains with finished[0] from green to gray,

Hi @AndresOrtegaGuerrero , thanks for pointing out this. it should be fixed in 795af3f.

Indeed now is fixed!, thank is great job