You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we call quite a lot of pop methods in the get_builder_from_protocol() methods to remove inputs which are not necessary for the underlying work chain, for example:
I think this would be cleaner since you can see the inputs that are added/updated/removed in one place: the .yaml file. I especially noticed this when working on the PdosWorkChain protocol (see this PR in case you're just too curious and already want to have a look and maybe review it, @sphuber 😁 ). There are several inputs which need to be removed from the default values for the nscfPwBaseWorkChain, and I think it would cleaner and more readable to do this in the PwBaseWorkChain.
There are other advantages to adding the possibility of being able to remove inputs by setting the overrides value to None. @flavianojs was trying to switch to using the kpoints input (i.e. providing a KpointsData) instead of the kpoints_distance input. This is currently not possible by providing the correct overrides. Of course, it's possible to adjust this after obtaining the builder, but I think it should be possible to change all inputs with the overrides. This will also make it easier in the future for people to define their own protocols - which can touch every input - by writing .yaml files.
I'm not entirely sure yet how to implement this. We have to be careful not to just pop the None already in the ProtocolMixin.get_protocol_inputs() method, since then it will already be popped at a higher level work chain. Perhaps we should only pop here the highest level inputs, with the sole exception of the PwBaseWorkChain, since this is sort of the end of the line for all work chains. I'll come up with a working solution and open a PR, but I already wanted to see if anyone has comments on this.
The text was updated successfully, but these errors were encountered:
Fixes#653
Add the possibility of popping input namespaces by specifying
None in the override for the specific namespace. A decorator
is added that generalize the concept to any implementation of
get_builder_from_protocol.
Fixes#653
Add the possibility of popping input namespaces by specifying
None in the override for the specific namespace. A decorator
is added that generalize the concept to any implementation of
get_builder_from_protocol.
Fixes#653
Add the possibility of popping input namespaces by specifying
None in the override for the specific namespace. A decorator
is added that generalize the concept to any implementation of
get_builder_from_protocol.
Currently, we call quite a lot of
pop
methods in theget_builder_from_protocol()
methods to remove inputs which are not necessary for the underlying work chain, for example:aiida-quantumespresso/aiida_quantumespresso/workflows/pw/bands.py
Lines 135 to 143 in 128ec59
I was thinking it would be good to be able to simply add this removal of inputs to the
.yaml
files. I.e. replace:aiida-quantumespresso/aiida_quantumespresso/workflows/protocols/pw/bands.yaml
Lines 1 to 4 in 128ec59
with
I think this would be cleaner since you can see the inputs that are added/updated/removed in one place: the
.yaml
file. I especially noticed this when working on thePdosWorkChain
protocol (see this PR in case you're just too curious and already want to have a look and maybe review it, @sphuber 😁 ). There are several inputs which need to be removed from the default values for thenscf
PwBaseWorkChain
, and I think it would cleaner and more readable to do this in thePwBaseWorkChain
.There are other advantages to adding the possibility of being able to remove inputs by setting the
overrides
value toNone
. @flavianojs was trying to switch to using thekpoints
input (i.e. providing aKpointsData
) instead of thekpoints_distance
input. This is currently not possible by providing the correctoverrides
. Of course, it's possible to adjust this after obtaining the builder, but I think it should be possible to change all inputs with theoverrides
. This will also make it easier in the future for people to define their own protocols - which can touch every input - by writing.yaml
files.I'm not entirely sure yet how to implement this. We have to be careful not to just pop the
None
already in theProtocolMixin.get_protocol_inputs()
method, since then it will already be popped at a higher level work chain. Perhaps we should only pop here the highest level inputs, with the sole exception of thePwBaseWorkChain
, since this is sort of the end of the line for all work chains. I'll come up with a working solution and open a PR, but I already wanted to see if anyone has comments on this.The text was updated successfully, but these errors were encountered: