aiida_alc_ins.workflows.base¶
Abstract base WorkChains, one per reusable feature.
Two independent features are split into two abstract bases so that a workflow inherits only what it needs:
JobDispatchWorkChain– thecode/optionsdispatch plumbing (inputs,get_job_metadata()and the400 ERROR_SUB_PROCESS_FAILEDexit code) shared by every workflow that runs PythonJobs.FromForceConstantsWorkChain– obtaining force constants by runningForceConstantsWorkChainas a sub-workflow, exposing its inputs under aforce_constantsnamespace (so its “exactly one” validator lives in the namespace and cannot collide with a parent’s own validator) and reporting its failure with402 ERROR_SUB_PROCESS_FAILED_FORCE_CONSTANTS.
Each base subclasses WorkChain directly (rather than being a plain mixin) so
its spec can be built and tested on its own, and neither references the other’s
ports, methods or exit codes. Neither has an outline: consumers add their own,
starting cls.run_force_constants, cls.inspect_force_constants, ... where
they use the force-constants source. Plumpy’s method resolution order builds one
spec through every base when a consumer subclasses several, provided each base’s
define calls super().define(spec).