aiidateam / aiida-quantumespresso

The official AiiDA plugin for Quantum ESPRESSO
https://aiida-quantumespresso.readthedocs.io
Other
52 stars 77 forks source link

Protocols: Extend protocol concept to `CalcJob` classes #947

Open mbercx opened 1 year ago

mbercx commented 1 year ago

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?