pyiron_base.project.maintenance module

class pyiron_base.project.maintenance.GlobalMaintenance

Bases: object

get_database_statistics()
class pyiron_base.project.maintenance.LocalMaintenance(project)

Bases: object

defragment_storage(recursive: bool = True, progress: bool = True, **kwargs: dict)

Rewrite the hdf5 files of jobs. This can free up unused space.

By default iterate recursively over the jobs within the current project. This can be controlled with recursive and kwargs.

Parameters:
  • recursive (bool) – search subprojects [True/False] - True by default

  • progress (bool) – if True (default), add an interactive progress bar to the iteration

  • **kwargs (dict) – Optional arguments for filtering with keys matching the project database column name (eg. status=”finished”). Asterisk can be used to denote a wildcard, for zero or more instances of any character

update_hdf_types(recursive: bool = True, progress: bool = True, **kwargs: dict)

Rewrite TYPE fields in hdf5 files for renamed modules.

New module conversions can be added with add_module_conversion(old, new)(). This method will then consider all objects previously imported from old to be imported from new.

Parameters:
  • recursive (bool) – search subprojects [True/False] - True by default

  • progress (bool) – if True (default), add an interactive progress bar to the iteration

  • **kwargs (dict) – Optional arguments for filtering with keys matching the project database column name (eg. status=”finished”). Asterisk can be used to denote a wildcard, for zero or more instances of any character

update_pyiron_tables(recursive: bool = True, progress: bool = True, **kwargs: dict)
class pyiron_base.project.maintenance.Maintenance(project)

Bases: object

The purpose of maintenance class is to provide some measures of perfomance for pyiron, whether local to the project or global (describing the status of pyiron on the running machine)

static get_repository_status()

Finds the hashes and versions for every pyiron module available.

Returns:

The name of each module and the hash and version for its current git head.

Return type:

pandas.DataFrame

property global_status
property local
property update
class pyiron_base.project.maintenance.UpdateMaintenance(project)

Bases: object

base_to_current(start_version: str, project=None)

Runs all updates for pyiron_base to reach the current version.

Parameters:
  • start_version (str) – Version of pyiron_base in the mayor.minor[.patch] format from which to start applying the updates.

  • project (None/project/list/str) – The project(s) to be converted from 0.3 to 0.4 ; default: current project One may provide a pyiron Project, a list of pyiron Projects, or a string containing “all” or a valid path. If “all” is provided, pyiron tries to find all projects using the PROJECT_PATHS defined in the configuration.

base_v0_3_to_v0_4(project=None)

Update hdf files written with pyiron_base-0.3.x to pyiron_base-0.4.x

pyiron_base<=0.3.9 has a bug that writes all arrays with dtype=object even numeric ones. As a fix pyiron_base=0.4.0 introduces a conversion when reading such arrays, but does not automatically save them. This conversion script simply goes over all jobs and rewrites their HDF5 files, since it’s read with the correct dtype, this then writes this correct dtype.

Parameters:

project (None/project/list/str) – The project(s) to be converted from 0.3 to 0.4 ; default: current project One may provide a pyiron Project, a list of pyiron Projects, or a string containing “all” or a valid path. If “all” is provided, pyiron tries to find all projects using the PROJECT_PATHS defined in the configuration.

pyiron_base.project.maintenance.add_module_conversion(old: str, new: str)

Add a new module conversion.

After setting up a conversion, call Project.maintenance.local.update_hdf_types() to rewrite the HDF5 files to make this change and allow loading of previously saved objects.

Parameters:
  • old (str) – path to module that previously defined objects in storage

  • new (str) – path to module that should be imported instead

Raises:

ValueError – if an entry for old already exists and does not point to new.