moyopy.interface#
Classes#
Module Contents#
- class moyopy.interface.MoyoAdapter[source]#
- static get_structure(cell: moyopy.Cell, unique_species_mapping: dict[int, pymatgen.core.Composition] | None = None) pymatgen.core.Structure [source]#
Convert a Moyo Cell to a pymatgen Structure.
If the Cell was created from a disordered Structure, the unique_species_mapping should be provided to reconstruct the original species.
- Parameters:
cell (moyopy.Cell) – The Moyo Cell to convert.
unique_species_mapping (dict[int, Composition] | None) – A mapping from integer indices used in the Moyo Cell to the original pymatgen SpeciesLike objects. If None, assumes the Cell was created from an ordered Structure.
- Returns:
structure – The converted pymatgen Structure object.
- Return type:
Structure
- static get_atoms(cell: moyopy.Cell) ase.Atoms [source]#
- static from_structure(structure: pymatgen.core.Structure) moyopy.Cell [source]#
- static from_disordered_structure(structure: pymatgen.core.Structure) tuple[moyopy.Cell, dict[int, pymatgen.core.Composition]] [source]#
Convert a disordered pymatgen Structure to a Moyo Cell.
- Parameters:
structure (Structure) – A pymatgen Structure object, which may contain disordered sites.
- Returns:
cell (moyopy.Cell) – The converted Moyo Cell object.
unique_species_mapping (dict[int, Composition]) – A mapping from integer indices used in the Moyo Cell to the original pymatgen SpeciesLike objects.
- static from_atoms(atoms: ase.Atoms) moyopy.Cell [source]#
- static from_py_obj(struct: pymatgen.core.Structure | ase.Atoms | pymatgen.io.ase.MSONAtoms) moyopy.Cell [source]#
Convert a Python atomic structure object to a Moyo Cell.
- Parameters:
struct – Currently supports pymatgen Structure, ASE Atoms, and MSONAtoms
- Returns:
The converted Moyo cell
- Return type: