Skip to content

Commit

Permalink
Merge pull request #1515 from pyiron/switch_to_pull
Browse files Browse the repository at this point in the history
Rename the result() call to pull() - for consistency with pyiron_workflow
  • Loading branch information
jan-janssen authored Jul 5, 2024
2 parents f710cd4 + fee6013 commit 28df4d5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pyiron_base/project/delayed.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def recursive_dict_resolve(input_dict: dict) -> dict:
output_dict = {}
for k, v in input_dict.items():
if isinstance(v, DelayedObject):
output_dict[k] = v.result()
output_dict[k] = v.pull()
elif isinstance(v, dict):
output_dict[k] = recursive_dict_resolve(input_dict=v)
elif isinstance(v, list):
Expand Down Expand Up @@ -252,7 +252,7 @@ def get_python_result(self):
def get_file_result(self):
return getattr(self._result.files, self._output_file)

def result(self):
def pull(self):
if self._result is None:
self._result = evaluate_function(
funct=self._function, input_dict=self._input
Expand Down
6 changes: 3 additions & 3 deletions tests/flex/test_executablecontainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,12 @@ def test_delayed_series_of_jobs(self):
output_file_lst=["result.txt"],
output_key_lst=["result"],
)
self.assertEqual(w.output.result.result(), 7)
self.assertEqual(w.output.result.pull(), 7)
nodes_dict, edges_lst = w.get_graph()
self.assertEqual(len(nodes_dict), 12)
self.assertEqual(len(edges_lst), 18)
job_w = w.result()
job_z = z.result()
job_w = w.pull()
job_z = z.pull()
self.assertEqual(job_w.output.result, 7)
self.project.remove_job(job_z.job_name)
self.project.remove_job(job_w.job_name)
2 changes: 1 addition & 1 deletion tests/flex/test_pythonfunctioncontainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def test_delayed(self):
d = self.project.wrap_python_function(
python_function=my_function, a=c, b=3, delayed=True
)
self.assertEqual(d.result(), 6)
self.assertEqual(d.pull(), 6)
nodes_dict, edges_lst = d.get_graph()
self.assertEqual(len(nodes_dict), 5)
self.assertEqual(len(edges_lst), 4)

0 comments on commit 28df4d5

Please sign in to comment.