Skip to content

Commit

Permalink
Fix type hints and unused imports
Browse files Browse the repository at this point in the history
Signed-off-by: liamhuber <[email protected]>
  • Loading branch information
liamhuber committed Jan 16, 2025
1 parent 9219aef commit 51257c0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
5 changes: 3 additions & 2 deletions pyiron_workflow/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@ class Node(
inputs (pyiron_workflow.io.Inputs): **Abstract.** Children must define
a property returning an :class:`Inputs` object.
label (str): A name for the node.
outputs (pyiron_workflow.io.Outputs): **Abstract.** Children must define
a property returning an :class:`Outputs` object.
outputs (pyiron_workflow.mixin.injection.OutputsWithInjection): **Abstract.**
Children must define a property returning an :class:`OutputsWithInjection`
object.
parent (pyiron_workflow.composite.Composite | None): The parent object
owning this, if any.
ready (bool): Whether the inputs are all ready and the node is neither
Expand Down
5 changes: 3 additions & 2 deletions pyiron_workflow/nodes/macro.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

from pyiron_snippets.factory import classfactory

from pyiron_workflow.io import Inputs, Outputs
from pyiron_workflow.io import Inputs
from pyiron_workflow.mixin.has_interface_mixins import HasChannel
from pyiron_workflow.mixin.injection import OutputsWithInjection
from pyiron_workflow.mixin.preview import ScrapesIO
from pyiron_workflow.nodes.composite import Composite
from pyiron_workflow.nodes.multiple_distpatch import dispatch_output_labels
Expand Down Expand Up @@ -342,7 +343,7 @@ def inputs(self) -> Inputs:
return self._inputs

@property
def outputs(self) -> Outputs:
def outputs(self) -> OutputsWithInjection:
return self._outputs

def _parse_remotely_executed_self(self, other_self):
Expand Down
11 changes: 6 additions & 5 deletions pyiron_workflow/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

from bidict import bidict

from pyiron_workflow.io import Inputs, Outputs
from pyiron_workflow.io import Inputs
from pyiron_workflow.mixin.injection import OutputsWithInjection
from pyiron_workflow.nodes.composite import Composite

if TYPE_CHECKING:
Expand Down Expand Up @@ -294,7 +295,7 @@ def _build_inputs(self):
return self._build_io("inputs", self.inputs_map)

@property
def outputs(self) -> Outputs:
def outputs(self) -> OutputsWithInjection:
return self._build_outputs()

def _build_outputs(self):
Expand All @@ -304,7 +305,7 @@ def _build_io(
self,
i_or_o: Literal["inputs", "outputs"],
key_map: dict[str, str | None] | None,
) -> Inputs | Outputs:
) -> Inputs | OutputsWithInjection:
"""
Build an IO panel for exposing child node IO to the outside world at the level
of the composite node's IO.
Expand All @@ -320,10 +321,10 @@ def _build_io(
(which normally would be exposed) by providing a string-None map.
Returns:
(Inputs|Outputs): The populated panel.
(Inputs|OutputsWithInjection): The populated panel.
"""
key_map = {} if key_map is None else key_map
io = Inputs() if i_or_o == "inputs" else Outputs()
io = Inputs() if i_or_o == "inputs" else OutputsWithInjection()
for node in self.children.values():
panel = getattr(node, i_or_o)
for channel in panel:
Expand Down

0 comments on commit 51257c0

Please sign in to comment.