aiidateam / aiida-quantumespresso

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

`PwCalculation` Input Validator assumes "parameters" is given #1035

Open eric-read opened 2 weeks ago

eric-read commented 2 weeks ago

The top-level validate_inputs validator for the PwCalculation will always try to get the parameters from the inputs. This causes any higher-level workchains that wrap PwBaseWorkChain that want to provide the Quantum-Espresso input parameters on the fly would have to set the PwBaseWorkChain validator to None in its own define method. A fix similar to 4ede7a1 and a3896293 could be implemented by checking if the parameter port is present in the namespace, since workchains that provide the parameters input on the fly typically would exclude that port when exposing the PwBaseWorkChain inputs. Therefore avoiding the need for such workchains to have to set the PwBaseWorkChain validator to None in their own define method.

mbercx commented 2 weeks ago

Thanks for reporting @eric-read! Seems sensible to check the existence of the port indeed, let me open a fix.