Skip to content

Commit

Permalink
renamed Outputs to TaskOutputs
Browse files Browse the repository at this point in the history
  • Loading branch information
tclose committed Dec 27, 2024
1 parent 4a8c42d commit 1a6b067
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions pydra/design/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


if ty.TYPE_CHECKING:
from pydra.engine.specs import TaskSpec, Outputs
from pydra.engine.specs import TaskSpec, TaskOutputs
from pydra.engine.core import Task

__all__ = [
Expand Down Expand Up @@ -351,7 +351,7 @@ def get_fields(klass, field_type, auto_attribs, helps) -> dict[str, Field]:

def make_task_spec(
spec_type: type["TaskSpec"],
out_type: type["Outputs"],
out_type: type["TaskOutputs"],
task_type: type["Task"],
inputs: dict[str, Arg],
outputs: dict[str, Out],
Expand Down Expand Up @@ -467,11 +467,11 @@ def make_task_spec(


def make_outputs_spec(
spec_type: type["Outputs"],
spec_type: type["TaskOutputs"],
outputs: dict[str, Out],
bases: ty.Sequence[type],
spec_name: str,
) -> type["Outputs"]:
) -> type["TaskOutputs"]:
"""Create an outputs specification class and its outputs specification class from the
output fields provided to the decorator/function.
Expand All @@ -492,10 +492,10 @@ def make_outputs_spec(
klass : type
The class created using the attrs package
"""
from pydra.engine.specs import Outputs
from pydra.engine.specs import TaskOutputs

if not any(issubclass(b, spec_type) for b in bases):
if out_spec_bases := [b for b in bases if issubclass(b, Outputs)]:
if out_spec_bases := [b for b in bases if issubclass(b, TaskOutputs)]:
raise ValueError(
f"Cannot make {spec_type} output spec from {out_spec_bases} bases"
)
Expand Down
4 changes: 2 additions & 2 deletions pydra/design/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

if ty.TYPE_CHECKING:
from pydra.engine.workflow.base import Workflow
from pydra.engine.specs import TaskSpec, Outputs, WorkflowSpec
from pydra.engine.specs import TaskSpec, TaskOutputs, WorkflowSpec


__all__ = ["define", "add", "this", "arg", "out"]
Expand Down Expand Up @@ -205,7 +205,7 @@ def this() -> "Workflow":
return Workflow.under_construction


OutputsType = ty.TypeVar("OutputsType", bound="Outputs")
OutputsType = ty.TypeVar("OutputsType", bound="TaskOutputs")


def add(task_spec: "TaskSpec[OutputsType]", name: str = None) -> OutputsType:
Expand Down
10 changes: 5 additions & 5 deletions pydra/engine/specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def is_set(value: ty.Any) -> bool:
return value not in (attrs.NOTHING, EMPTY)


class Outputs:
class TaskOutputs:
"""Base class for all output specifications"""

RESERVED_FIELD_NAMES = ("inputs", "split", "combine")
Expand Down Expand Up @@ -167,7 +167,7 @@ def __getitem__(self, name: str) -> ty.Any:
raise KeyError(f"{self} doesn't have an attribute {name}") from None


OutputsType = ty.TypeVar("OutputType", bound=Outputs)
OutputsType = ty.TypeVar("OutputType", bound=TaskOutputs)


class TaskSpec(ty.Generic[OutputsType]):
Expand Down Expand Up @@ -453,7 +453,7 @@ class RuntimeSpec:
network: bool = False


class PythonOutputs(Outputs):
class PythonOutputs(TaskOutputs):
pass


Expand All @@ -464,7 +464,7 @@ class PythonSpec(TaskSpec[PythonOutputsType]):
pass


class WorkflowOutputs(Outputs):
class WorkflowOutputs(TaskOutputs):
pass


Expand All @@ -480,7 +480,7 @@ class WorkflowSpec(TaskSpec[WorkflowOutputsType]):
STDERR_HELP = """The standard error stream produced by the command."""


class ShellOutputs(Outputs):
class ShellOutputs(TaskOutputs):
"""Output specification of a generic shell process."""

return_code: int = shell.out(help_string=RETURN_CODE_HELP)
Expand Down
4 changes: 2 additions & 2 deletions pydra/engine/workflow/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
from typing_extensions import Self
import attrs
from pydra.engine.helpers import list_fields, attrs_values, is_lazy
from pydra.engine.specs import TaskSpec, Outputs, WorkflowOutputs
from pydra.engine.specs import TaskSpec, TaskOutputs, WorkflowOutputs
from .lazy import LazyInField
from pydra.utils.hash import hash_function
from pydra.utils.typing import TypeParser, StateArray
from .node import Node


OutputsType = ty.TypeVar("OutputType", bound=Outputs)
OutputsType = ty.TypeVar("OutputType", bound=TaskOutputs)
WorkflowOutputsType = ty.TypeVar("OutputType", bound=WorkflowOutputs)


Expand Down
4 changes: 2 additions & 2 deletions pydra/engine/workflow/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import attrs
from pydra.utils.typing import TypeParser, StateArray
from . import lazy
from ..specs import TaskSpec, Outputs, WorkflowSpec
from ..specs import TaskSpec, TaskOutputs, WorkflowSpec
from ..task import Task
from ..helpers import ensure_list, attrs_values, is_lazy, load_result, create_checksum
from pydra.utils.hash import hash_function
Expand All @@ -16,7 +16,7 @@
from .base import Workflow


OutputType = ty.TypeVar("OutputType", bound=Outputs)
OutputType = ty.TypeVar("OutputType", bound=TaskOutputs)
Splitter = ty.Union[str, ty.Tuple[str, ...]]

_not_set = Enum("_not_set", "NOT_SET")
Expand Down

0 comments on commit 1a6b067

Please sign in to comment.