aiida_pythonjob_ins.workflows.base ================================== .. py:module:: aiida_pythonjob_ins.workflows.base .. autoapi-nested-parse:: Shared base WorkChain that obtains force constants for a phonon calculation. The concrete workflows (dispersion, DOS) all need a ``ForceConstantsData`` to work from. This base lets that come from *either*: * a CASTEP ``castep_file`` (``SinglefileData``) -- read in-workflow by a PythonJob (demonstrating file staging), or * a pre-built ``force_constants`` (``ForceConstantsData``) node -- e.g. produced from Phonopy input (see :func:`aiida_pythonjob_ins.pythonjobs.prepare_read_phonopy_inputs`) or any other source. Subclasses add their own inputs/outputs and an outline that begins with:: if_(cls.should_read_castep)(cls.read_force_constants), cls.assign_force_constants, ... # their compute steps, using ``self.ctx.force_constants`` Reading Phonopy inside the workflow is intentionally *not* built in here: Phonopy needs several files, so it is cleaner to read it up front into a ``ForceConstantsData`` and pass that as ``force_constants``.