Skip to content

Commit

Permalink
Merge pull request #1698 from pyiron/delayed_object_python_function
Browse files Browse the repository at this point in the history
Delayed object: store the python function as part of the delayed object
  • Loading branch information
jan-janssen authored Nov 26, 2024
2 parents 9b5dc08 + c1cd253 commit da5d7cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyiron_base/project/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def get_delayed_object(
list_length=list_length,
**kwargs,
)
delayed_job_object._python_function = python_function
delayed_job_object._server = Server(**pyiron_resource_dict)
return delayed_job_object

Expand Down
2 changes: 2 additions & 0 deletions pyiron_base/project/delayed.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ def __init__(
pass
self.__name__ = "DelayedObject"
self._result = None
self._python_function = None
self._server = Server()
self._output_key = output_key
self._output_file = output_file
Expand Down Expand Up @@ -294,6 +295,7 @@ def __copy__(self):
list_length=self._list_length,
list_index=self._list_index,
)
obj_copy._python_function = self._python_function
obj_copy._input = self._input
obj_copy._result = self._result
obj_copy._server.from_dict(self._server.to_dict())
Expand Down

0 comments on commit da5d7cc

Please sign in to comment.