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 – the code/options dispatch plumbing (inputs, get_job_metadata() and the 400 ERROR_SUB_PROCESS_FAILED exit code) shared by every workflow that runs PythonJobs.

  • FromForceConstantsWorkChain – obtaining force constants by running ForceConstantsWorkChain as a sub-workflow, exposing its inputs under a force_constants namespace (so its “exactly one” validator lives in the namespace and cannot collide with a parent’s own validator) and reporting its failure with 402 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).