pyiron_base.jobs.master.parallel.JobGenerator#
- class pyiron_base.jobs.master.parallel.JobGenerator(master)[source]#
Bases:
objectImplements the functions to generate the parameter list, modify the individual jobs according to the parameter list and generate the new job names according to the parameter list.
Subclasses have to override
parameter_list()to provide a list of (arbitrary) parameter objects andmodify_job()and may overridejob_name()to provide custom job names.The generated jobs are created as child job from the given master.
- __init__(master)[source]#
- Parameters:
master (
ParallelMaster) – master job from which child jobs are created with
:param
ParallelMaster.create_child_job().:
Methods
__init__(master)- param master:
master job from which child jobs are created with
job_name(parameter)Return new job name from parameter object.
modify_job(job, parameter)Modify next job with the parameter object.
next()Iterate over the child jobs
Attributes
the parallel master job with which this generator was initialized
list: parameter objects passed to
modify_job()when the next job is requested.parameter_list_cached- job_name(parameter) str | tuple[source]#
Return new job name from parameter object. The next child job created will have this name. Subclasses may override this to give custom job names.
- Parameters:
parameter (type) – current parameter object drawn from
parameter_list.- Returns:
job name for the next child job tuple: construct the job name via
_get_safe_job_name();allows any object that can be coerced to str inside the tuple
- Return type:
str
- property master#
the parallel master job with which this generator was initialized
- Type:
- static modify_job(job, parameter)[source]#
Modify next job with the parameter object. job is already the newly created job object cloned from the template job, so this function has to return the same instance, but may (and should) modify it.
- Parameters:
job (
GenericJob) – new job instanceparameter (type) – current parameter object drawn from
parameter_list.
- Returns:
must be the given job
- Return type:
- property parameter_list#
list: parameter objects passed to
modify_job()when the next job is requested.