-
Notifications
You must be signed in to change notification settings - Fork 82
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
: make magnetism from overrides
absolute
#731
Conversation
@sphuber there is of course also the case where the user specifies both Alternatively, we enforce that the user relies on |
bc6c427
to
3ba4f39
Compare
Indeed, I had a look at the different permission levels, and "Triage" peeps can't merge PR's, as far as I can tell. |
I would say that we can just let |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, of course, always love adding tests, but do you still have comments on these points? |
I thought I did? In any case, I think |
Oh wow, I clearly was too focused on the meme 😅 ! Note that the |
It's just that I think this can easily get out of hand: there will be quite a number of arguments that can clash with values specified in the |
@sphuber I agree that perhaps trying to check all the user inputs for possible conflicts is perhaps not the way to go. I'm not sure I fully remember the discussion of removing the overrides... Probably you are referring to #712? I do see some merit in clarifying this distinction between true workchain inputs that can be overridden after obtaining the builder, and meta inputs like the pseudo family or |
When using the `get_builder_from_protocol()` method from the `PwBaseWorkChain`, setting `spin_type` to `COLLINEAR` while not specifying the `initial_magnetic_moments` will result in a set of default magnetic moments being used, based on the `magnetization.yaml` file. This means that even when `SYSTEM.starting_magnetization` is specified in the `overrides`, these are simply ignored in favor of the defaults. Here we make the `overrides` _absolute_, i.e. the `starting_magnetization` is only set to the default in case it is not specified in the `overrides`. This is once again based on the principle that we should avoid quietly overriding inputs that the user explicitly specified.
25e951b
to
9e5f809
Compare
No indeed, this is definitely beyond the scope of this PR and I wasn't suggesting any scope screep whatsoever, whoever subtle you may have think it to have been ;) I was indeed referring to the meta inputs that I think should be overridable because there there is additional value. I think we would probably want to allow to do this in two ways:
We had already discussed this in one of your other PRs about reusing our infrastructure to parse protocol files and make it more flexible of where they are stored. I think #712 was not designed for this problem, but is a bit of a symptom. If there isn't a dedicated issue yet, I think I will make one soon. |
Right, I remember now: #678. Should probably read that discussion again. :) In the meanwhile: What do you think of my lovely tests? :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, all good, just some minor things
Co-authored-by: Sebastiaan Huber <[email protected]>
…m#731) When using the `get_builder_from_protocol()` method from the `PwBaseWorkChain`, setting `spin_type` to `COLLINEAR` while not specifying the `initial_magnetic_moments` will result in a set of default magnetic moments being used, based on the `magnetization.yaml` file. This means that even when `SYSTEM.starting_magnetization` is specified in the `overrides`, these are simply ignored in favor of the defaults. Here we make the `overrides` _absolute_, i.e. the `starting_magnetization` is only set to the default in case it is not specified in the `overrides`. This is once again based on the principle that we should avoid quietly overriding inputs that the user explicitly specified.
Fixes #729
When using the
get_builder_from_protocol()
method from thePwBaseWorkChain
, settingspin_type
toCOLLINEAR
while notspecifying the
initial_magnetic_moments
will result in a set ofdefault magnetic moments being used, based on the
magnetization.yaml
file. This means that even when
SYSTEM.starting_magnetization
isspecified in the
overrides
, these are simply ignored in favor of thedefaults.
Here we make the
overrides
absolute, i.e. thestarting_magnetization
is only set to the default in case it is notspecified in the
overrides
. This is once again based on the principlethat we should avoid quietly overriding inputs that the user explicitly
specified.