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

Reload GUI parameters #485

Merged
merged 5 commits into from
Sep 26, 2023
Merged

Reload GUI parameters #485

merged 5 commits into from
Sep 26, 2023

Conversation

superstar54
Copy link
Member

@superstar54 superstar54 commented Sep 22, 2023

This PR allows the QeApp to reload GUI parameters when the user selects a process.

  • use aiida.orm.utils.serialize.serialize to serialize the GUI parameters as yaml, then save it as an extra of the process node. Then load it using the deserialize_unsafe method.
  • fix set_panel_value for the advanced_settings.
  • add unit test for reloading the app.

@superstar54 superstar54 changed the title use serialize to save and load ui_parameters Reload GUI parameters Sep 22, 2023
@codecov
Copy link

codecov bot commented Sep 22, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (6fff5ec) 75.83% compared to head (6557574) 77.25%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #485      +/-   ##
==========================================
+ Coverage   75.83%   77.25%   +1.41%     
==========================================
  Files          42       43       +1     
  Lines        3042     3082      +40     
==========================================
+ Hits         2307     2381      +74     
+ Misses        735      701      -34     
Flag Coverage Δ
python-3.10 77.25% <93.75%> (+1.41%) ⬆️
python-3.8 77.29% <93.75%> (+1.41%) ⬆️
python-3.9 77.29% <93.75%> (+1.41%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/aiidalab_qe/app/configuration/advanced.py 94.14% <100.00%> (+5.70%) ⬆️
src/aiidalab_qe/app/configuration/pseudos.py 88.64% <100.00%> (+0.10%) ⬆️
src/aiidalab_qe/app/configuration/workflow.py 100.00% <100.00%> (ø)
src/aiidalab_qe/app/result/workchain_viewer.py 59.45% <100.00%> (+0.66%) ⬆️
tests/conftest.py 98.12% <100.00%> (-0.06%) ⬇️
tests/test_app_reload.py 100.00% <100.00%> (ø)
tests/test_configure.py 100.00% <100.00%> (ø)
tests/test_submit_qe_workchain.py 98.11% <100.00%> (ø)
src/aiidalab_qe/app/result/summary_viewer.py 76.00% <80.00%> (+0.28%) ⬆️
src/aiidalab_qe/app/main.py 89.83% <83.33%> (+22.48%) ⬆️
... and 1 more

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AndresOrtegaGuerrero
Copy link
Member

@superstar54 , I try using the branch, but i cant upload a previous job it produces an error . On the other hand, i tried creating a new job and setting different parameters, this one works!. With the exception that the Protocol, the Smearing width and Smearing Type were not re-load

@AndresOrtegaGuerrero
Copy link
Member

I guess in order to not affect previous jobs maybe you just can check if the yaml file is reachable if not, just set the GUI parameters as default ?

@superstar54
Copy link
Member Author

superstar54 commented Sep 26, 2023

@AndresOrtegaGuerrero Thanks! I fixed the protocol and smearing.

I guess in order to not affect previous jobs maybe you just can check if the yaml file is reachable if not, just set the GUI parameters as default ?

I added a check if the ui_parameters is a yaml format or not. Note that since there is an update of the summary report (#481), it also does not show the summary report for the old jobs.

Copy link
Member

@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!

@superstar54 superstar54 merged commit 1d71c7f into main Sep 26, 2023
19 checks passed
@superstar54 superstar54 deleted the feature/load_GUI branch September 26, 2023 12:23
@@ -471,6 +472,16 @@ def _update_builder(self, buildy, max_mpi_per_pool):
else:
self._update_builder(v, max_mpi_per_pool)

def set_submission_parameters(self, parameters):
Copy link
Member

Choose a reason for hiding this comment

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

@superstar54, can you add docstring for these newly added functions? I find it quite hard to understand when I first look at it.
Also please try to add as many comment/docstring as possible. Sometimes the design is clear for you but may not be easy to understand for other developers.

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.

None yet

3 participants