Skip to content

Fix pseudo state and blockers propagation - #1526

Merged
edan-bainglass merged 2 commits into
mainfrom
fix-pseudo-state
Jun 15, 2026
Merged

Fix pseudo state and blockers propagation#1526
edan-bainglass merged 2 commits into
mainfrom
fix-pseudo-state

Conversation

@edan-bainglass

Copy link
Copy Markdown
Member

This PR addresses the following two issues:

  1. The new functional update method was not guarded for an empty pseudos dictionary, which was incorrectly leading to None functionals.
  2. The blockers were overwriting one another rather then accumulating, which is now correctly implemented for wizard steps and the advanced settings (which have sub-models).

The functional is determined by the pseudos in the dictionary, so if
the dictionary is empty (or the app is locked), we should not update
the functional.
Blockers were overwritting each other instead of being accumulated.
Here we ensure that steps trigger a blockers update when any of their
sub-models introduce a blocker, in which they accumulate said blockers.
The same is done for the advanced configuration settings panel, which
also has sub-models.
Comment thread src/aiidalab_qe/app/configuration/advanced/pseudos/model.py
self._reset()

def _on_blockers_change(self, _):
self._model.update_blockers()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Triggering an update here sets the advanced model's blockers to the sum of all sub-advanced model blockers. This is later collected by a similar mechanism in the configuration step.

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.92308% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.31%. Comparing base (a24b747) to head (49ec62d).

Files with missing lines Patch % Lines
...aiidalab_qe/app/configuration/advanced/advanced.py 62.50% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1526      +/-   ##
==========================================
+ Coverage   75.29%   75.31%   +0.02%     
==========================================
  Files         115      115              
  Lines        7367     7373       +6     
==========================================
+ Hits         5547     5553       +6     
  Misses       1820     1820              
Flag Coverage Δ
python-3.12 75.31% <76.92%> (+0.02%) ⬆️
python-3.9 75.34% <76.92%> (+0.02%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.


def _on_blockers_change(self, _):
if self._model.state is not State.INIT:
self._model.update_blockers()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The update triggers the accumulation of all configuration settings panel blockers.

@yakutovicha yakutovicha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

a few minor questions

self._defaults["functional"] = functional
self.functional = self._get_default("functional")

def get_cutoffs_by_index(self, index: int) -> list[float]:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Keeping update methods together 🙂

Comment thread src/aiidalab_qe/app/configuration/advanced/pseudos/model.py
Comment thread src/aiidalab_qe/app/configuration/advanced/advanced.py
@edan-bainglass

Copy link
Copy Markdown
Member Author

a few minor questions

Thanks @yakutovicha. Replied. Regarding the moves, as stated, I'd like to keep like-things together for ease of maintainability 🙂

@yakutovicha yakutovicha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's go!

@edan-bainglass
edan-bainglass merged commit 936c8bb into main Jun 15, 2026
12 of 15 checks passed
@edan-bainglass
edan-bainglass deleted the fix-pseudo-state branch June 15, 2026 11:03
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