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

Move report #481

Merged
merged 9 commits into from
Sep 22, 2023
Merged

Move report #481

merged 9 commits into from
Sep 22, 2023

Conversation

superstar54
Copy link
Member

@superstar54 superstar54 commented Sep 20, 2023

Move the report part from the submission step to the result step, so that all the report-related parameters are handled in, and only in, the result step.

The old design separates the report into two parts in the submission and result steps, which is hard to maintain. One also needs to save and reload the parameters. Which is a mess, as seen from the names of the functions.

  • submission step _create_extra_report_parameters, _extract_report_parameters,
  • result step: _generate_report_dict, _generate_report_html, generate_report_html

It also extracts parameters from the GUI and the builder to form a builder_parameters, but later one needs to re-extract the GUI parameters back from the builder_parameters (handle the logic again). Most importantly, we can not reload all GUI parameters, which is bad.

The current implementation:

  • move all report-related code to the result step, the summary_viewer.py file.
  • save all GUI-related data to the ui_parameters, and set it as an extra attribute to the node, so we can reload the GUI back.
  • generate report parameters from the ui_parameters and inputs of the workchain node directly.

Test

  • add unit tests for the result step, including a regression test for the report parameters. +5 % now! 😀

@superstar54 superstar54 marked this pull request as draft September 20, 2023 13:51
@codecov
Copy link

codecov bot commented Sep 22, 2023

Codecov Report

Patch coverage: 83.84% and project coverage change: +5.15% 🎉

Comparison is base (fba40a5) 70.46% compared to head (d734419) 75.61%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #481      +/-   ##
==========================================
+ Coverage   70.46%   75.61%   +5.15%     
==========================================
  Files          42       42              
  Lines        2966     2957       -9     
==========================================
+ Hits         2090     2236     +146     
+ Misses        876      721     -155     
Flag Coverage Δ
python-3.10 75.61% <83.84%> (+5.15%) ⬆️
python-3.8 75.66% <83.84%> (+5.15%) ⬆️
python-3.9 75.66% <83.84%> (+5.15%) ⬆️

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

Files Changed Coverage Δ
src/aiidalab_qe/app/submission/__init__.py 70.00% <50.00%> (-2.25%) ⬇️
src/aiidalab_qe/app/result/summary_viewer.py 73.43% <71.66%> (+16.29%) ⬆️
src/aiidalab_qe/app/result/workchain_viewer.py 58.79% <100.00%> (+35.71%) ⬆️
tests/conftest.py 98.13% <100.00%> (+3.00%) ⬆️
tests/test_result.py 100.00% <100.00%> (ø)
tests/test_submit_qe_workchain.py 98.11% <100.00%> (+4.44%) ⬆️

... and 2 files with indirect coverage changes

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

Copy link
Member

@unkcpz unkcpz left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@superstar54 superstar54 merged commit d8ca986 into main Sep 22, 2023
15 checks passed
@superstar54 superstar54 deleted the move_report branch September 22, 2023 09:18
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

2 participants