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

PwBaseWorkChain: Set restart_mode in parameters if parent_folder #867

Merged
merged 1 commit into from
Nov 21, 2022

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Nov 18, 2022

Fixes #864

Typically, if a user launches a PwBaseWorkChain with a parent_folder they want to restart from a previously completed but unconverged run. In this case the CONTROL.restart_mode parameter should be set to from_scratch. This used to be done automatically but was removed in commit cb32be5.

Here we reinstate the behavior by calling set_restart_type to RestartType.FULL if the parent_folder is defined and the CONTROL.restart_mode hasn't already been set explicitly in the parameters to from_scratch. In this case, it was likely set by the caller and we don't want to silently override this.

@sphuber sphuber requested a review from mbercx November 18, 2022 15:54
Typically, if a user launches a `PwBaseWorkChain` with a `parent_folder`
they want to restart from a previously completed but unconverged run. In
this case the `CONTROL.restart_mode` parameter should be set to
`from_scratch`. This used to be done automatically but was removed in
commit cb32be5.

Here we reinstate the behavior by calling `set_restart_type` to
`RestartType.FULL` if the `parent_folder` is defined and the
`CONTROL.restart_mode` hasn't already been set explicitly in the
parameters to `from_scratch`. In this case, it was likely set by the
caller and we don't want to silently override this.
@sphuber sphuber force-pushed the fix/864/pw-base-parent-folder branch from 3c9e257 to 450290f Compare November 20, 2022 21:26
Copy link
Member

@mbercx mbercx left a comment

Choose a reason for hiding this comment

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

All good, thanks @sphuber!

@sphuber sphuber merged commit 0aba276 into main Nov 21, 2022
@sphuber sphuber deleted the fix/864/pw-base-parent-folder branch November 21, 2022 08:09
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.

PwBaseWorkChain: does not automatically set restart mode in parameters when parent_folder is specified
2 participants