pyiron.base.generic.template module

Template class to list the required properties and functions for every pyiron object.

class pyiron.base.generic.template.PyironObject[source]

Bases: object

Template class to list the required properties and functions for every pyiron object.

property child_ids

If the pyiron object is a meta object which includes a series of objects these objects ids are listed as child ids.

Returns

list of child ids

Return type

list

copy()[source]

Copy the pyiron object - this copies only the link to the HDF5 file - not the content of the HDF5 file.

Returns

a copy of the pyiron object

Return type

PyironObject

copy_to(new_project=None)[source]

Copy the pyiron object including the HDF5 file to an new location

Parameters

new_project (ProjectHDFio) – new location

Returns

a copy of the pyiron object

Return type

PyironObject

from_hdf(hdf, group_name='group')[source]

Restore the PyironObject from an HDF5 file

Parameters
  • hdf (ProjectHDFio) – HDF5 group object

  • group_name (str) – HDF5 subgroup name - optional

property id

Every pyiron object should have the ability to be stored in the database

Returns

object id

Return type

int

inspect(job_specifier)[source]

Inspect a pyiron object from the database - the same like load(self, job_specifier, convert_to_object=False). The inspect mode provides quick access to the HDF5 file without loading the full object, which is especially helpful if only a specific section of the output is required.

Parameters

job_specifier (str, int) – identifier of the pyiron object - this needs to be unique in the project.

Returns

a reduces pyiron object like JobPath

Return type

PyironObject

load(job_specifier, convert_to_object=True)[source]

Load a pyiron object from the database

Parameters
  • job_specifier (str, int) – identifier of the pyiron object - this needs to be unique in the project.

  • convert_to_object (bool) – [True/False] - it is faster to only load the HDF5 access but the pyiron object offers a whole more functionality.

Returns

the pyiron object

Return type

PyironObject

property master_id

If the pyiron object belongs to a series of objects, series object is linked by the master id

Returns

master id

Return type

int

move_to(new_project)[source]

Move the pyiron object including the HDF5 file to an new location

Parameters

new_project (ProjectHDFio) – new location

property parent_id

If the pyiron object belongs to a serial series of objects, the predecessor is linked by the parent id

Returns

parent id

Return type

int

remove()[source]

Remove the pyiron obect from the database and delete the HDF5 file

save()[source]

Store the pyiron object in the HDF5 file an create a corresponding database entry.

to_hdf(hdf, group_name='group')[source]

Store the PyironObject in an HDF5 file

Parameters
  • hdf (ProjectHDFio) – HDF5 group object

  • group_name (str) – HDF5 subgroup name - optional