pyiron_base.jobs.job.jobtype.JobType#

class pyiron_base.jobs.job.jobtype.JobType(class_name: type | str, project: ProjectHDFio, job_name: str, job_class_dict: dict | None = None, delete_existing_job: bool = False, delete_aborted_job: bool = False)[source]#

Bases: object

The JobTypeBase class creates a new object of a given class type.

__init__()#

Methods

__init__()

convert_str_to_class(job_class_dict, class_name)

convert the name of a class to the corresponding class object - only for pyiron internal classes.

register(job_class_or_module_str[, ...])

Register job type from the exposed list of available job types

unregister(job_name_or_class)

Unregister job type from the exposed list of available job types

static convert_str_to_class(job_class_dict: dict, class_name: str) type[source]#

convert the name of a class to the corresponding class object - only for pyiron internal classes.

Parameters:
  • job_class_dict (dict)

  • class_name (str)

Return type:

(class)

classmethod register(job_class_or_module_str: type | str, job_name: str | None = None, overwrite: bool = False) None[source]#

Register job type from the exposed list of available job types

Parameters:
  • job_class_or_module_str (type/str/None) – job class itself, string representation of the job class module as provided by cls.__module__, or None for do not register.

  • job_name (str/None) – Name of the job to register. Must match cls.__name__. Can be omitted for class input.

  • overwrite (bool) – If True, overwrite existing job type.

classmethod unregister(job_name_or_class: str | type) type | None[source]#

Unregister job type from the exposed list of available job types

Parameters:

job_name_or_class (str/type) – name of the job or job class

Returns:

None if a str is provided as job_name_or_class job_name_or_class if a class is provided. Therefore, this method can be used as class decorator.