pyiron_base.interfaces.object.PyironObject#

class pyiron_base.interfaces.object.PyironObject(*args, **kwargs)[source]#

Bases: HasStorage, HasDatabase, ABC

The fundamental pyiron object bringing together python objects, database identification, and data serialziation.

__init__(*args, **kwargs)[source]#
Parameters:

group_name (str) – default name of the HDF group where the whole object should be written to.

Methods

__init__(*args, **kwargs)

param group_name:

default name of the HDF group where the whole object should be written to.

from_hdf(hdf[, group_name])

Read object to HDF.

from_hdf_args(hdf)

Read arguments for instance creation from HDF5 file.

rewrite_hdf(hdf[, group_name])

Update the HDF representation.

save()

to_hdf(hdf[, group_name])

Write object to HDF.

Attributes

database

storage

from_hdf(hdf: ProjectHDFio, group_name: str = None)#

Read object to HDF.

If group_name is given descend into subgroup in hdf first.

Parameters:
  • hdf (ProjectHDFio) – HDF group to read from

  • group_name (str, optional) – name of subgroup

classmethod from_hdf_args(hdf: ProjectHDFio) dict#

Read arguments for instance creation from HDF5 file.

Parameters:

hdf (ProjectHDFio) – HDF5 group object

Returns:

arguments that can be **kwarg-passed to cls().

Return type:

dict

rewrite_hdf(hdf: ProjectHDFio, group_name: str = None)#

Update the HDF representation.

If an object is read from an older layout, this will remove the old data and rewrite it in the newest layout.

Parameters:
  • hdf (ProjectHDFio) – HDF group to read/write

  • group_name (str, optional) – name of subgroup

to_hdf(hdf: ProjectHDFio, group_name: str = None)#

Write object to HDF.

If group_name is given create a subgroup in hdf first.

Parameters:
  • hdf (ProjectHDFio) – HDF group to write to

  • group_name (str, optional) – name of subgroup