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

♻️ REFACTOR: defaults and widgets of the steps #72

Merged
merged 3 commits into from
Jun 11, 2021

Conversation

mbercx
Copy link
Member

@mbercx mbercx commented Jun 8, 2021

Fixes #67

Several changes are made to clean up/refactor/modularize the widgets:

  • Move defaults into .yaml that is read and used consistently. Use
    importlib_resources for importing this into modules.
  • Try to add consistency between the order of these default in the .yaml
    file and how they are ordered in several commands of ths
    SubmitQeAppWorkChainStep.
  • Rename configs to settings (save for code, this was included in
    PR 🐛 FIX: do not set params to default for structure change #71).
  • Fix issue where both OptionsConfig (now AdvancedSettings) and
    SubmitQeAppWorkChainStep would intialize a PseudoFamilySelector,
    leading to issues in correctly assigning the pseudos.

Note that there is a small change in UI: The Materials Settings have
been moved outside of expert mode, since the layman usually can still
understand/decide whether their structure is magnetic/insulating or not.

This also seems to have fixed the issue we were having with the UI
breaking when disabling expert mode on the "Select Codes" tab.

Several changes are made to clean up/refactor/modularize the widgets:

* Move defaults into `.yaml` that is read and used consistently. Use
`importlib_resources` for importing this into modules.
* Try to add consistency between the order of these default in the .yaml
file and how they are ordered in several commands of ths
`SubmitQeAppWorkChainStep`.
* Rename `configs` to `settings` (save for `code`, this was included in
PR aiidalab#71).
* Fix issue where _both_ `OptionsConfig` (now `AdvancedSettings`) and
`SubmitQeAppWorkChainStep` would intialize a `PseudoFamilySelector`,
leading to issues in correctly assigning the pseudos.

Note that there is a small change in UI: The Materials Settings have
been moved outside of expert mode, since the layman usually can still
understand/decide whether their structure is magnetic/insulating or not.

This also seems to have fixed the issue we were having with the UI
breaking when disabling expert mode on the "Select Codes" tab.
@mbercx mbercx requested a review from csadorf June 8, 2021 03:06
@mbercx mbercx linked an issue Jun 8, 2021 that may be closed by this pull request
aiidalab_qe/pseudos.py Outdated Show resolved Hide resolved
installed = traitlets.Bool()
disable = traitlets.Bool()
Copy link
Member

Choose a reason for hiding this comment

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

This should be:

Suggested change
disable = traitlets.Bool()
disabled = traitlets.Bool()

And are you actually using that trait?

Copy link
Member Author

Choose a reason for hiding this comment

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

No. But didn't you say we needed the disabled trait? 😭

At some point I thought I knew why, so I reinstated it 😎

Copy link
Member

Choose a reason for hiding this comment

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

No. But didn't you say we needed the disabled trait? 😭

At some point I thought I knew why, so I reinstated it 😎

The disabled trait should toggle the widget into a "disabled" state when set to True. What that exactly means depends a little bit on the widget so that's why there is no default implementation for this. Ideally, subsequent steps cannot be modified (i.e. are disabled) until the previous step has been confirmed. Hence why most widgets within the app should have this trait and also implement the corresponding behavior.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the explanation :). Makes sense!

aiidalab_qe/pseudos.py Outdated Show resolved Hide resolved
aiidalab_qe/pseudos.py Show resolved Hide resolved
aiidalab_qe/steps.py Outdated Show resolved Hide resolved
aiidalab_qe/steps.py Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
@mbercx
Copy link
Member Author

mbercx commented Jun 10, 2021

@csadorf thanks for the review! I think I've covered all your suggestions, but have left some of the comments as unresolved so you can still see my answers to the comments without having to open them.

@mbercx mbercx requested a review from csadorf June 10, 2021 21:37
@mbercx mbercx requested a review from csadorf June 11, 2021 09:46
Copy link
Member

@csadorf csadorf left a comment

Choose a reason for hiding this comment

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

🚢

@mbercx
Copy link
Member Author

mbercx commented Jun 11, 2021

Screenshot 2021-06-11 at 11 48 16
😭

@mbercx mbercx merged commit 9185301 into aiidalab:develop Jun 11, 2021
@mbercx mbercx deleted the 67-refactor-steps branch June 11, 2021 09:51
csadorf pushed a commit that referenced this pull request Jul 14, 2021
Several changes are made to clean up/refactor/modularize the widgets:

* Move defaults into `.yaml` that is read and used consistently. Use
`importlib_resources` for importing this into modules.
* Try to add consistency between the order of these default in the .yaml
file and how they are ordered in several commands of ths
`SubmitQeAppWorkChainStep`.
* Rename `configs` to `settings`
* Fix issue where _both_ `OptionsConfig` (now `AdvancedSettings`) and
`SubmitQeAppWorkChainStep` would initialize a `PseudoFamilySelector`,
leading to issues in correctly assigning the pseudos.

Note that there is a small change in UI: The Materials Settings have
been moved outside of expert mode, since the layman usually can still
understand/decide whether their structure is magnetic/insulating or not.

This also seems to have fixed the issue we were having with the UI
breaking when disabling expert mode on the "Select Codes" tab.
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.

🐛 FIX: Issue when disabling expert from code
2 participants