pyiron_atomistics.atomistics.structure.factories.materialsproject.MPQueryResults#
- class pyiron_atomistics.atomistics.structure.factories.materialsproject.MPQueryResults(results)[source]#
Bases:
HasStructure- __init__(results)[source]#
- Parameters:
docs (list of dicts) – query results from Materials Project, should be obtained with use_document_model=False
Methods
__init__(results)- param docs:
query results from Materials Project, should be obtained with use_document_model=False
animate_structures([spacefill, show_cell, ...])Animate a series of atomic structures.
collect_structures([filter_function])Collects a copy of all structures in a compact
StructureStorage.get_structure([frame, wrap_atoms, ...])Retrieve structure from object.
iter_structures([wrap_atoms])Iterate over all structures in this object.
to_list()Get a list of queried structures.
Get a StructureStorage of queried structures.
transform_structures(modify)Return a modified object by applying a function to each object lazily.
Attributes
maximum iteration_step + 1 that can be passed to
get_structure().- animate_structures(spacefill: bool = True, show_cell: bool = True, center_of_mass: bool = False, particle_size: float = 0.5, camera: str = 'orthographic')#
Animate a series of atomic structures.
- Parameters:
spacefill (bool) – If True, then atoms are visualized in spacefill stype
show_cell (bool) – True if the cell boundaries of the structure is to be shown
particle_size (float) – Scaling factor for the spheres representing the atoms. (The radius is determined by the atomic number)
center_of_mass (bool) – False (default) if the specified positions are w.r.t. the origin
camera (str) – camera perspective, choose from “orthographic” or “perspective”
- Returns:
nglview IPython widget
- Return type:
animation
- collect_structures(filter_function=None) StructureStorage#
Collects a copy of all structures in a compact
StructureStorage.This can be used to force lazily applied modifications with
transform_structures()or simply to obtain a known object type from a genericHasStructureobject.- Parameters:
filter_function (function) – include structure only if this function returns True for it
- Returns:
a copy of all (filtered) structures
- Return type:
- get_structure(frame=-1, wrap_atoms=True, iteration_step=None)#
Retrieve structure from object. The number of available structures depends on the job and what kind of calculation has been run on it, see
number_of_structures.- Parameters:
frame (int, object) – index of the structure requested, if negative count from the back; if
:param
_translate_frame()is overridden: :param frame will pass through it: :param iteration_step: deprecated alias for frame :type iteration_step: int :param wrap_atoms: True if the atoms are to be wrapped back into the unit cell :type wrap_atoms: bool- Returns:
the requested structure
- Return type:
- Raises:
IndexError – if not -
number_of_structures<= iteration_step <number_of_structures
- iter_structures(wrap_atoms=True)#
Iterate over all structures in this object.
- Parameters:
wrap_atoms (bool) – True if the atoms are to be wrapped back into the unit cell; passed to
get_structure()- Yields:
pyiron_atomistics.atomistitcs.structure.atoms.Atoms– every structure attached to the object
- property number_of_structures#
maximum iteration_step + 1 that can be passed to
get_structure().- Type:
int
- to_storage()[source]#
Get a StructureStorage of queried structures.
The materials project id is used as the identifier.
- Returns:
structures
- Return type:
- transform_structures(modify) TransformStructure#
Return a modified object by applying a function to each object lazily.
- Parameters:
modify (function) – applied to each structure, has to return the modified structure
- Returns:
a container with the modified structures
- Return type: