Skip to content
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 loading refactoring #105

Merged
merged 27 commits into from
Dec 6, 2024
Merged

Conversation

AndresOrtegaGuerrero
Copy link
Collaborator

@AndresOrtegaGuerrero AndresOrtegaGuerrero commented Nov 28, 2024

  • Adapt plugin for lazy loading
  • Create model for Settings Panel
  • Create model for the Code Panel
  • Create widget/model logic for Results Panel
  • Create widget/model logic for Phonons Results
  • Create widget/model logic for IR/Raman Results
  • Create widget/model logic for Dielectric Results
  • Create widget/model logic for INS Results
    This address Lazy loading  #92

@AndresOrtegaGuerrero
Copy link
Collaborator Author

from 8ea879c commit , i have define a template for the result panel and tabs , from here i think it might be easier to separate the work

AndresOrtegaGuerrero and others added 11 commits November 30, 2024 14:54
* Adding euphonic models

* Adding model modifications.

* Adding LL for euphonic.

missing: download of the data, proper testing,
detached app.

* Putting the model and widget in the results panel

* Putting back the results panel in the init.

* Bug fix in the q-section reset.

The problem was that the default value of a tl.List(tl.Float())
is tl.Undefined. Now we explicitely reset the default value
of Q0_vec, h_vec and k_vec

* Adding DownloadYamlHdf5Widget

For now, I added it at the end of the main EuphonicBaseResultsWidget.
It will only allow to download phonopy.yaml and fc.hdf5. The plots can be downloaded in the corresponding tabs.

I added a method to the model which produce the downloadable files, and left the actual
_download_data method in the widget. I think this is a proper design as the model manipulates data,
the view can provide them.

Still missing the download of single tabs, for now it does not work
@AndresOrtegaGuerrero AndresOrtegaGuerrero marked this pull request as ready for review December 6, 2024 08:28
@AndresOrtegaGuerrero AndresOrtegaGuerrero changed the title setting lazy loading Lazy loading refactoring Dec 6, 2024
Copy link
Collaborator Author

@AndresOrtegaGuerrero AndresOrtegaGuerrero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


def on_input_structure_change(self, _=None):
if not self.input_structure:
self._get_default()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be self.reset() ? because otherwise we need to loop on all the traits, just calling the _get_default() will excepts.

A strange issue is that I just changed the dimensionality of the structure to 0D and confirmed, and somehow hitting this block (so it is like the self.input_structure is indeed none, but should not). I think however it is a qe app issue, and only happens for 0D (not 2D, 1D)

Comment on lines +25 to +29
class VibroResourcesSettingsPanel(ResourceSettingsPanel[VibroResourceSettingsModel]):
"""Panel for the resource settings for the vibroscopy calculations."""

title = "Vibronic"
identifier = identifier = "vibronic"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess here in the future (near future) we can add the logic to display only subset of the defined codes, so if no dielectric is needed we don't show the pw dielectric and so on

just done via settings always `needs_euphonic_tab = False`.
@mikibonacci
Copy link
Owner

Hi @AndresOrtegaGuerrero , A part the comment on _get_default and reset, L very GTM!
Thanks a lot for the work!

@AndresOrtegaGuerrero AndresOrtegaGuerrero merged commit 7249eca into main Dec 6, 2024
2 checks passed
@mikibonacci mikibonacci mentioned this pull request Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants