-
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
Implementing lazy-loading #802
Conversation
@PNOGillespie Hi Peter. I'm reaching out regarding this PR in hope that you may assist with one part relating to your XAS plugin. To keep it brief, the A simple solution would be to do as @superstar54 did in the XPS plugin, i.e., wrap such logic in a function to be lazily triggered on demand. Do you think this is something you could look into in a separate PR? If not, could you please comment on the reason? |
Hi @edan-bainglass. I can move the logic for updating the pseudopotentials (which is what lines 67 - 112 in I'm somewhat busy both this week and next, but I should be able to put together a separate PR soon for the changes if it's just a case of moving things around. |
Hi @PNOGillespie 👋
Yes, this sounds right. As stated, @superstar54's approach in the XPS plugin is likely the way to go, for reference 🙂 Once the PR is ready, I test against my lazy-loading work and we see more clearly if it's sufficient 👍
No worries. The lazy-loading work will take a few pass (possibly incremental PRs), so the XAS part can be addressed once your PR is in. Thanks 🙏 |
70c7539
to
1d107d9
Compare
@PNOGillespie @superstar54 just wondering, why were the XPS and XAS plugins included in the core app? Would it be better to maintain them as external plugins, say |
fa7c4ef
to
9b6d792
Compare
1f1206a
to
a1235b2
Compare
Addresses requirements for lazy-loading (PR aiidalab#802) by moving logic for checking core-hole pseudopotentials to `_update_structure()`.
7d26bf6
to
2561827
Compare
1dd1c05
to
48f8cfe
Compare
26262db
to
83125ae
Compare
4bd2e20
to
21aa97b
Compare
Hi all. The PR is ready for review. As mentioned, it is massive! If necessary, maybe we split the work a bit, say, one app step per person? Not sure if this helps. Anyhow, I'm available for questions :) |
@edan-bainglass it would be very helpful to me if you could point me to the things you want me to look at, I am feeling a bit lost right now. :-) Or we can wait till Monday, where you will present the approach in general? |
Best if I walk you through it on Monday. However, in the meantime, you can take a look at #919, where I've started documenting the core principles. |
The behavior of the BandsWidget has been modified. Adjusting the fat band width widget no longer preserves the zoom level, causing it to reset. The zoom level should remain unchanged when modifying the plot contributions, maintaining consistency across interactions. This breaks the behaviour of #904 Update@edan-bainglass: This is now resolved. Thank you @AndresOrtegaGuerrero |
The result tabs are not displayed automatically when loading a job. They only become visible after clicking on the QeAppWorkChain node. Similarly, clicking the "Update Results" button does not trigger the display of the result tab Update@edan-bainglass: This is a known issue existing outside of this PR. I suspect it has something to do with a timing issue in a process tree update upon process uuid assignment. |
cd4015c
to
4380a7b
Compare
@AndresOrtegaGuerrero thank you for the comments. Let's discuss at the retreat 🙂 |
bd79a4d
to
91686e5
Compare
🚀 🚀 🚀 It is perfect! |
This PR aims to improve the user's experience by isolating loading of widgets/resources to where they are needed (requested).
The overall approach is as follows (per widget):
__init__
logic to a newrender
method__init__
selected_index
trait of the container)render
methodAdditionally, I take here an MVC (Model-View-Controller) approach to the app. The app's logic is migrated out to Model classes that represent the so-called "business-logic" of the app. Ideally, though perhaps not quite there yet, it should be possible to prepare and submit a QE calculation entirely via the Model classes!
A combination of a View and a Controller, here represented in a single class, is then simply a "window" to the Model's data. The View (the widgets) represent the UI. The Controller (the
_on_<event>
methods) is in charge of reacting to events either triggered by the user via the View, or triggered internally via the Model network.Note that as I worked on this PR, several competing "flavors" of MVC came about. The present implementation is not a settled one. There are still some issues to address in order to properly establish our standard. One major issue is described below.
Open design concern
Currently, the
ConfigurationModel
, which represents the data of step 2, is injected into all otherSettingsPanel
s. There, traits of the correspondingSettingsModel
can be linked to the corresponding traits in theConfigurationModel
. This effectively syncs the specific settings with the app's configuration. There are presently a couple of idea to resolve this coupling between settings. Glad to discuss with those who are interested.Glad to adjust where necessary 🙂
Update
Recent changes decouple the
ConfigurationModel
from theSettingsPanel
s. TheAdvancedSettings
class is still coupled with its "sub-settings", e.g., smearing, magnetization, etc. This is primarily due to the highly coupledset_model_state
andget_model_state
methods of theAdvancedModel
. But this okay for now, and perhaps in general, as the advanced settings is presented all together in one panel.The decoupling hinges on a mechanism of announcing dependencies. For example, the PDOS plugin requires both the input structure and the protocol. Hence, it defines
During plugin discovery, these dependencies are used to set up directional links, connecting the model to the configuration model network.
Note, however, that in decoupling the
ConfigurationModel
, I made a decision to extract the structure relaxation and property selection parts out from the basic settings. The new design of the configuration step is now split into sub-steps (thanks @mikibonacci for the suggestion to refer to these as step 2.x).Glad to discuss and adjust where necessary 🙂
Documentation
Of course, once the PR is approved, documentation of the settled approach (or at least the current one) will be added!
Resolves #992
Resolves #894