From 8a84f6050d5ce3852114a420e0af7f7f809a2f3b Mon Sep 17 00:00:00 2001 From: pyiron-runner Date: Tue, 20 Feb 2024 20:03:33 +0000 Subject: [PATCH] Format black --- pyiron_workflow/channels.py | 1 + pyiron_workflow/job.py | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pyiron_workflow/channels.py b/pyiron_workflow/channels.py index 611c546e..890f37fc 100644 --- a/pyiron_workflow/channels.py +++ b/pyiron_workflow/channels.py @@ -601,6 +601,7 @@ def _node_injection(self, injection_class, *args, inject_self=True): def __getattr__(self, name): from pyiron_workflow.node_library.standard import GetAttr + if name == "to_hdf": raise AttributeError( "This is just a failsafe to protect us against other elements of the " diff --git a/pyiron_workflow/job.py b/pyiron_workflow/job.py index 6a5814b6..8b8c99a4 100644 --- a/pyiron_workflow/job.py +++ b/pyiron_workflow/job.py @@ -26,7 +26,8 @@ from pyiron_base import TemplateJob, JOB_CLASS_DICT from pyiron_base.jobs.flex.pythonfunctioncontainer import ( - PythonFunctionContainerJob, get_function_parameter_dict + PythonFunctionContainerJob, + get_function_parameter_dict, ) from pyiron_workflow.node import Node from h5io._h5io import _import_class @@ -73,6 +74,7 @@ class NodeOutputJob(PythonFunctionContainerJob): be redefined. If node definitions get changed between saving and loading, all bets are off. """ + def __init__(self, project, job_name): if sys.version_info < (3, 11): raise NotImplementedError("Node jobs are only available in python 3.11+") @@ -131,25 +133,25 @@ class StoredNodeJob(TemplateJob): It leans directly on the storage capabilities of the node itself, except for the node class and name, and the storage backend mode, all of which are held in the - traditional job input. (WARNING: This might be fragile to adjusting the storage + traditional job input. (WARNING: This might be fragile to adjusting the storage backend on the node _after_ the node has been assign to the job.) The job provides direct access to its owned node (as both input and output) on the :attr:`node` attribute. The only requirement is that the node have an untouched working directory (so we can make sure its files get stored _inside_ the job's - directory tree), and that it be saveable (not all objects work with the "h5io" + directory tree), and that it be saveable (not all objects work with the "h5io" storage backend, e.g. `ase.Calculator` objects may break it). Examples: >>> from pyiron_base import Project >>> from pyiron_workflow import Workflow >>> import pyiron_workflow.job # To get the job registered in JOB_CLASS_DICT - >>> + >>> >>> wf = Workflow("pyiron_node", overwrite_save=True) >>> wf.answer = Workflow.create.standard.UserInput(42) # Or your nodes - >>> + >>> >>> pr = Project("test") - >>> + >>> >>> nj = pr.create.job.StoredNodeJob("my_node") >>> nj.node = wf >>> nj.run() # doctest:+ELLIPSIS