aiida-quantumespresso icon indicating copy to clipboard operation
aiida-quantumespresso copied to clipboard

Protocols: Extend protocol concept to `CalcJob` classes

Open mbercx opened this issue 1 year ago • 0 comments

Currently, only WorkChain classes use the ProtocolMixin class utilities and define a get_builder_from_protocol() method. I see no reason why CalcJob classes couldn't also benefit from such a method. There are several advantages to this:

  1. Some CalcJob classes don't have a corresponding BaseRestartWorkChain, but could still benefit from having a default protocol defined.
  2. In some cases a user might not want to use the restart features, but still use a protocol.
  3. In the tutorials, it would be natural to start with explaining how to run a PwCalculation using the get_builder_from_protocol() method, but now this isn't possible. Instead, we immediately have to explain how to use the PwBaseWorkChain, which adds an extra layer of complexity.
  4. It would be easier to implement https://github.com/aiidateam/aiida-quantumespresso/issues/653, since this would definitely be the "lowest" level of the get_builder_from_protocol() hierarchy, and hence we could simply pop keys in e.g. the parameters that have value None at this point.

There are probably still more, but at this point I'm pretty convinced this would be a sensible approach. What do you think, @sphuber?

mbercx avatar May 27 '23 18:05 mbercx