pyiron_base.jobs.job.jobtype module

Jobtype class to create GenericJob type objects

class pyiron_base.jobs.job.jobtype.JobFactory(project)

Bases: PyironFactory

The job creator is used to create job objects using pr.create.job.Code() where Code can be any external code which is wrapped as pyiron job type.

class pyiron_base.jobs.job.jobtype.JobType(class_name, project, job_name, job_class_dict=None, delete_existing_job=False, delete_aborted_job=False)

Bases: object

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

static convert_str_to_class(job_class_dict, class_name) Type[GenericJob]

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, overwrite=False)

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)

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.

class pyiron_base.jobs.job.jobtype.JobTypeChoice(*args, **kwargs)

Bases: object

Helper class to choose the job type directly from the project, autocompletion is enabled by overwriting the __dir__() function. This class is only required for pr.job_type.Code which is only used in pr.create_job(). As a consequence this class can be removed once the pr.create_job() function is replaced by pr.create.job.Code().

property job_class_dict