pyiron.project module¶
-
class
pyiron.project.
Project
(path='', user=None, sql_query=None)[source]¶ Bases:
pyiron.base.project.generic.Project
The project is the central class in pyiron, all other objects can be created from the project object.
- Parameters
path (GenericPath, str) – path of the project defined by GenericPath, absolute or relative (with respect to current working directory) path
user (str) – current pyiron user
sql_query (str) – SQL query to only select a subset of the existing jobs within the current project
-
.. attribute:: root_path
the pyiron user directory, defined in the .pyiron configuration
-
.. attribute:: project_path
the relative path of the current project / folder starting from the root path of the pyiron user directory
-
.. attribute:: path
the absolute path of the current project / folder
-
.. attribute:: base_name
the name of the current project / folder
-
.. attribute:: history
previously opened projects / folders
-
.. attribute:: parent_group
parent project - one level above the current project
-
.. attribute:: user
current unix/linux/windows user who is running pyiron
-
.. attribute:: sql_query
an SQL query to limit the jobs within the project to a subset which matches the SQL query.
-
.. attribute:: db
connection to the SQL database
-
.. attribute:: job_type
- Job Type object with all the available job types: [‘StructureContainer’, ‘StructurePipeline’, ‘AtomisticExampleJob’,
‘ExampleJob’, ‘Lammps’, ‘KMC’, ‘Sphinx’, ‘Vasp’, ‘GenericMaster’, ‘SerialMaster’, ‘AtomisticSerialMaster’, ‘ParallelMaster’, ‘KmcMaster’, ‘ThermoLambdaMaster’, ‘RandomSeedMaster’, ‘MeamFit’, ‘Murnaghan’, ‘MinimizeMurnaghan’, ‘ElasticMatrix’, ‘ConvergenceVolume’, ‘ConvergenceEncutParallel’, ‘ConvergenceKpointParallel’, ’PhonopyMaster’, ‘DefectFormationEnergy’, ‘LammpsASE’, ‘PipelineMaster’, ’TransformationPath’, ‘ThermoIntEamQh’, ‘ThermoIntDftEam’, ‘ScriptJob’, ‘ListMaster’]
-
copy
()[source]¶ Copy the project object - copying just the Python object but maintaining the same pyiron path
- Returns
copy of the project object
- Return type
-
static
create_ase_bulk
(name, crystalstructure=None, a=None, c=None, covera=None, u=None, orthorhombic=False, cubic=False)[source]¶ Creating bulk systems using ASE bulk module. Crystal structure and lattice constant(s) will be guessed if not provided.
name (str): Chemical symbol or symbols as in ‘MgO’ or ‘NaCl’. crystalstructure (str): Must be one of sc, fcc, bcc, hcp, diamond, zincblende,
rocksalt, cesiumchloride, fluorite or wurtzite.
a (float): Lattice constant. c (float): Lattice constant. c_over_a (float): c/a ratio used for hcp. Default is ideal ratio: sqrt(8/3). u (float): Internal coordinate for Wurtzite structure. orthorhombic (bool): Construct orthorhombic unit cell instead of primitive cell which is the default. cubic (bool): Construct cubic unit cell if possible.
- Returns
Required bulk structure
- Return type
-
static
create_atoms
(symbols=None, positions=None, numbers=None, tags=None, momenta=None, masses=None, magmoms=None, charges=None, scaled_positions=None, cell=None, pbc=None, celldisp=None, constraint=None, calculator=None, info=None, indices=None, elements=None, dimension=None, species=None, **qwargs)[source]¶ Creates a atomistics.structure.atoms.Atoms instance.
- Parameters
elements (list/numpy.ndarray) – List of strings containing the elements or a list of atomistics.structure.periodic_table.ChemicalElement instances
numbers (list/numpy.ndarray) – List of atomic numbers of elements
symbols (list/numpy.ndarray) – List of chemical symbols
positions (list/numpy.ndarray) – List of positions
scaled_positions (list/numpy.ndarray) – List of scaled positions (relative coordinates)
pbc (boolean) – Tells if periodic boundary conditions should be applied
cell (list/numpy.ndarray) – A 3x3 array representing the lattice vectors of the structure
momenta (list/numpy.ndarray) – List of momentum values
tags (list/numpy.ndarray) – A list of tags
masses (list/numpy.ndarray) – A list of masses
magmoms (list/numpy.ndarray) – A list of magnetic moments
charges (list/numpy.ndarray) – A list of point charges
celldisp –
constraint (list/numpy.ndarray) – A list of constraints
calculator – ASE calculator
info (list/str) – ASE compatibility
indices (list/numpy.ndarray) – The list of species indices
dimension (int) – Dimension of the structure
species (list) – List of species
- Returns
The required structure instance
- Return type
-
static
create_element
(parent_element, new_element_name=None, spin=None, potential_file=None)[source]¶ - Parameters
parent_element (str, int) – The parent element eq. “N”, “O”, “Mg” etc.
new_element_name (str) – The name of the new parent element (can be arbitrary)
spin (float) – Value of the magnetic moment (with sign)
potential_file (str) – Location of the new potential file if necessary
- Returns
atomistics.structure.periodic_table.ChemicalElement instance
-
create_job
(job_type, job_name)[source]¶ Create one of the following jobs: - ‘StructureContainer’: - ‘StructurePipeline’: - ‘AtomisticExampleJob’: example job just generating random number - ‘ExampleJob’: example job just generating random number - ‘Lammps’: - ‘KMC’: - ‘Sphinx’: - ‘Vasp’: - ‘GenericMaster’: - ‘SerialMaster’: series of jobs run in serial - ‘AtomisticSerialMaster’: - ‘ParallelMaster’: series of jobs run in parallel - ‘KmcMaster’: - ‘ThermoLambdaMaster’: - ‘RandomSeedMaster’: - ‘MeamFit’: - ‘Murnaghan’: - ‘MinimizeMurnaghan’: - ‘ElasticMatrix’: - ‘ConvergenceVolume’: - ‘ConvergenceEncutParallel’: - ‘ConvergenceKpointParallel’: - ’PhonopyMaster’: - ‘DefectFormationEnergy’: - ‘LammpsASE’: - ‘PipelineMaster’: - ’TransformationPath’: - ‘ThermoIntEamQh’: - ‘ThermoIntDftEam’: - ‘ScriptJob’: Python script or jupyter notebook job container - ‘ListMaster’: list of jobs
- Parameters
job_type (str) – job type can be [‘StructureContainer’, ‘StructurePipeline’, ‘AtomisticExampleJob’, ‘ExampleJob’, ‘Lammps’, ‘KMC’, ‘Sphinx’, ‘Vasp’, ‘GenericMaster’, ‘SerialMaster’, ‘AtomisticSerialMaster’, ‘ParallelMaster’, ‘KmcMaster’, ‘ThermoLambdaMaster’, ‘RandomSeedMaster’, ‘MeamFit’, ‘Murnaghan’, ‘MinimizeMurnaghan’, ‘ElasticMatrix’, ‘ConvergenceVolume’, ‘ConvergenceEncutParallel’, ‘ConvergenceKpointParallel’, ’PhonopyMaster’, ‘DefectFormationEnergy’, ‘LammpsASE’, ‘PipelineMaster’, ’TransformationPath’, ‘ThermoIntEamQh’, ‘ThermoIntDftEam’, ‘ScriptJob’, ‘ListMaster’]
job_name (str) – name of the job
- Returns
job object depending on the job_type selected
- Return type
-
create_pipeline
(job, step_lst)[source]¶ Create a job pipeline
- Parameters
job (AtomisticGenericJob) – Template for the calculation
step_lst (list) – List of functions which create calculations
- Returns
- Return type
-
static
create_structure
(element, bravais_basis, lattice_constant)[source]¶ Create a crystal structure using pyiron’s native crystal structure generator
- Parameters
element (str) – Element name
bravais_basis (str) – Basis type
lattice_constant (float/list) – Lattice constants
- Returns
The required crystal structure
- Return type
-
static
create_surface
(element, surface_type, size=1, 1, 1, vacuum=1.0, center=False, pbc=None, **kwargs)[source]¶ Generate a surface based on the ase.build.surface module.
- Parameters
element (str) – Element name
surface_type (str) – The string specifying the surface type generators available through ase (fcc111,
etc.) (hcp0001) –
size (tuple) – Size of the surface
vacuum (float) – Length of vacuum layer added to the surface along the z direction
center (bool) – Tells if the surface layers have to be at the center or at one end along the z-direction
pbc (list/numpy.ndarray) – List of booleans specifying the periodic boundary conditions along all three directions. If None, it is set to [True, True, True]
**kwargs – Additional, arguments you would normally pass to the structure generator like ‘a’, ‘b’,
etc. ('orthogonal') –
- Returns
Required surface
- Return type
pyiron.atomistics.structure.atoms.Atoms instance
-
create_table
(job_name='table')[source]¶ Create pyiron table
- Parameters
job_name (str) – job name of the pyiron table job
- Returns
pyiron.table.datamining.TableJob
-
get_structure
(job_specifier, iteration_step=- 1, wrap_atoms=True)[source]¶ Gets the structure from a given iteration step of the simulation (MD/ionic relaxation). For static calculations there is only one ionic iteration step :param job_specifier: name of the job or job ID :type job_specifier: str, int :param iteration_step: Step for which the structure is requested :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
atomistics.structure.atoms.Atoms object
-
import_single_calculation
(project_to_import_from, rel_path=None, job_type='Vasp')[source]¶ - Parameters
rel_path –
project_to_import_from –
job_type (str) – Type of the calculation which is going to be imported
-
static
list_publications
(bib_format='dict')[source]¶ List the publications used in this project.
- Parameters
bib_format (str) – [‘dict’, ‘bibtex’, ‘apa’]
- Returns
list of publications in Bibtex format.
- Return type
list
-
load_from_jobpath
(job_id=None, db_entry=None, convert_to_object=True)[source]¶ Internal function to load an existing job either based on the job ID or based on the database entry dictionary.
- Parameters
job_id (int) – Job ID - optional, but either the job_id or the db_entry is required.
db_entry (dict) – database entry dictionary - optional, but either the job_id or the db_entry is required.
convert_to_object (bool) – convert the object to an pyiron object or only access the HDF5 file - default=True accessing only the HDF5 file is about an order of magnitude faster, but only provides limited functionality. Compare the GenericJob object to JobCore object.
- Returns
Either the full GenericJob object or just a reduced JobCore object
- Return type
-
load_from_jobpath_string
(job_path, convert_to_object=True)[source]¶ Internal function to load an existing job either based on the job ID or based on the database entry dictionary.
- Parameters
job_path (str) – string to reload the job from an HDF5 file - ‘/root_path/project_path/filename.h5/h5_path’
convert_to_object (bool) – convert the object to an pyiron object or only access the HDF5 file - default=True accessing only the HDF5 file is about an order of magnitude faster, but only provides limited functionality. Compare the GenericJob object to JobCore object.
- Returns
Either the full GenericJob object or just a reduced JobCore object
- Return type