Skip to content

Conversation

edan-bainglass
Copy link
Member

@edan-bainglass edan-bainglass commented Aug 12, 2025

Based on #1363

This feature was unintentionally removed in the MVC redesign. Restored here.

Major update

Implementing this PR revealed several other issues, which are also addressed here:

  • Resource models have code models. These code models were only partially subscribed to events, with remaining subscriptions only applied at render time. This is not an ideal MVC implementation. It is now corrected here by way of ResourceSettingsPanel.register_code(code_model: CodeModel), which is injected into the logic of building the global codes (GlobalResourceSettingsPanel.build_global_codes, formerly set_up_codes.
  • The generate_qeapp_workchain test fixture was using deepcopy on inputs. This results in duplication of AiiDA nodes, which in turn led to a raised MultipleObjectError on subsequent use of the fixture due to code duplication of identical labels. See Use shallow copy to avoid creating a new AiiDA node every time #1341 for more details.
  • test_create_builder_default regression data is corrected here to reflect num_cpus = 2, which was not captured before
  • We were using an old AiiDA testing fixture for generating codes. This is also updated here.
  • Also noticed during testing several deprecations warnings from ipywidegets/traitlets (e.g., traitlets.List(trait=taitlets.Int) instead of traitlets.List(trait=taitlets.Int()), passing unrecognized arguments to constructors, etc.). Fixed here.

Peripheral changes

  • Consolidate some imports at top of modules for quick reference. Should not affect app loading time, as these do not execute code (I believe, and truly hope they don't. Otherwise, we should adjust them).

Copy link
Member

@superstar54 superstar54 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link

codecov bot commented Aug 12, 2025

Codecov Report

❌ Patch coverage is 86.36364% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.38%. Comparing base (d43f070) to head (4a72941).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/aiidalab_qe/common/code/model.py 63.63% 4 Missing ⚠️
src/aiidalab_qe/common/panel.py 83.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1368      +/-   ##
==========================================
- Coverage   72.48%   72.38%   -0.11%     
==========================================
  Files         109      109              
  Lines        7280     7300      +20     
==========================================
+ Hits         5277     5284       +7     
- Misses       2003     2016      +13     
Flag Coverage Δ
python-3.11 72.38% <86.36%> (-0.11%) ⬇️
python-3.9 72.41% <86.36%> (-0.09%) ⬇️

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@edan-bainglass edan-bainglass force-pushed the default-codes branch 2 times, most recently from 1d0af44 to 261df4e Compare August 14, 2025 09:51
@AndresOrtegaGuerrero
Copy link
Member

AndresOrtegaGuerrero commented Aug 14, 2025

I just check and the codes are uploading fine ,but i realize the functional (I went to step two) was selecting the default (PBESol) instead of the one I used (PBE)

@edan-bainglass
Copy link
Member Author

edan-bainglass commented Aug 14, 2025

I just check and the codes are uploading fine ,but i realize the functional (I went to step two) was selecting the default (PBESol) instead of the one I used (PBE)

Interesting. I'll have a look in the morning.

Update

@AndresOrtegaGuerrero Fixed in #1373. I missed setting it in the family-string branch of the if-block. Have a look/test 🙏

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.

LGreatTM!

@edan-bainglass edan-bainglass merged commit 5f5564a into aiidalab:main Aug 15, 2025
9 checks passed
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.

3 participants