aiida_pythonjob_ins.data.mixins

Mixins for the Euphonic-wrapping Data classes.

Kept separate from the JSON-storage base (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

SupportsToStructure

Structural type for a node that can yield its crystal as a StructureData.

CrystalStructureMixin

Add to_structure() to a Data class wrapping an object with .crystal.

Module Contents

class aiida_pythonjob_ins.data.mixins.SupportsToStructure[source]

Bases: Protocol

Structural type for a node that can yield its crystal as a StructureData.

Used to type the generic extract_structure calcfunction.

to_structure() aiida.orm.StructureData[source]
class aiida_pythonjob_ins.data.mixins.CrystalStructureMixin[source]

Add to_structure() to a Data class wrapping an object with .crystal.

Mix in alongside EuphonicJSONData (which provides get_object()), e.g. class ForceConstantsData(CrystalStructureMixin, EuphonicJSONData).

get_object() Any
to_structure() aiida.orm.StructureData[source]

Extract the wrapped object’s .crystal as a native StructureData.

Delegates to crystal_to_structure() (the single Crystal -> StructureData converter).