pyiron_base.jobs.flex.pythonfunctioncontainer module

class pyiron_base.jobs.flex.pythonfunctioncontainer.PythonFunctionContainerJob(project, job_name)

Bases: PythonTemplateJob

The PythonFunctionContainerJob is designed to wrap any kind of python function into a pyiron job object

Example:

>>> def test_function(a, b=8):
>>>     return a+b
>>>
>>> from pyiron_base import Project
>>> pr = Project("test")
>>> job = pr.wrap_python_function(test_function)
>>> job.input["a"] = 4
>>> job.input["b"] = 5
>>> job.run()
>>> job.output
>>>
>>> test_function_wrapped = pr.wrap_python_function(test_function)
>>> test_function_wrapped(4, b=6)
from_dict(job_dict)
property python_function
run_static()

The run static function is called by run to execute the simulation.

save()

Save the object, by writing the content to the HDF5 file and storing an entry in the database.

Returns:

Job ID stored in the database

Return type:

(int)

to_dict()
pyiron_base.jobs.flex.pythonfunctioncontainer.get_function_parameter_dict(funct)
pyiron_base.jobs.flex.pythonfunctioncontainer.get_hash(binary)