aiida_pythonjob_ins.data.mixins =============================== .. py:module:: aiida_pythonjob_ins.data.mixins .. autoapi-nested-parse:: Mixins for the Euphonic-wrapping Data classes. Kept separate from the JSON-storage base (:class:`EuphonicJSONData`) so that a capability like ``to_structure()`` is only present on Data classes that actually wrap an object with a ``.crystal`` (e.g. ``ForceConstants``, ``QpointPhononModes``) -- and not, say, a future ``Spectrum1DCollectionData``, which has no crystal. Classes ------- .. autoapisummary:: aiida_pythonjob_ins.data.mixins.SupportsToStructure aiida_pythonjob_ins.data.mixins.CrystalStructureMixin Module Contents --------------- .. py:class:: SupportsToStructure Bases: :py:obj:`Protocol` Structural type for a node that can yield its crystal as a StructureData. Used to type the generic ``extract_structure`` calcfunction. .. py:method:: to_structure() -> aiida.orm.StructureData .. py:class:: CrystalStructureMixin Add ``to_structure()`` to a Data class wrapping an object with ``.crystal``. Mix in *alongside* :class:`EuphonicJSONData` (which provides ``get_object()``), e.g. ``class ForceConstantsData(CrystalStructureMixin, EuphonicJSONData)``. .. py:method:: get_object() -> Any .. py:method:: to_structure() -> aiida.orm.StructureData Extract the wrapped object's ``.crystal`` as a native ``StructureData``. Delegates to :func:`~aiida_pythonjob_ins.conversions.crystal_to_structure` (the single Crystal -> StructureData converter).