Skip to content

Commit 131b18a

Browse files
committed
applied Chris's suggestions to core.py
1 parent 23d5980 commit 131b18a

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

pydra/engine/core.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ def split(
593593
a reference to the task
594594
"""
595595
if self._lzout:
596-
raise Exception(
596+
raise RuntimeError(
597597
f"Cannot split {self} as its output interface has already been accessed"
598598
)
599599
if splitter is None and inputs:
@@ -737,7 +737,6 @@ def _extract_input_el(self, inputs, inp_nm, ind):
737737

738738
def get_input_el(self, ind):
739739
"""Collect all inputs required to run the node (for specific state element)."""
740-
assert ind is not None
741740
# TODO: doesn't work properly for more cmplicated wf (check if still an issue)
742741
input_ind = self.state.inputs_ind[ind]
743742
inputs_dict = {}
@@ -921,10 +920,9 @@ def _sanitize_spec(
921920
Parameters
922921
----------
923922
spec : SpecInfo or List[str] or Dict[str, type]
924-
Input specification to be sanitized.
923+
Specification to be sanitized.
925924
wf_name : str
926925
The name of the workflow for which the input specifications
927-
are sanitized.
928926
spec_name : str
929927
name given to generated SpecInfo object
930928
@@ -941,11 +939,10 @@ def _sanitize_spec(
941939
graph_checksum_input = ("_graph_checksums", ty.Any)
942940
if spec:
943941
if isinstance(spec, SpecInfo):
944-
if not any([x == BaseSpec for x in spec.bases]):
945-
raise ValueError("Provided SpecInfo must have BaseSpec as it's base.")
942+
if BaseSpec not in spec.bases:
943+
raise ValueError("Provided SpecInfo must have BaseSpec as its base.")
946944
if "_graph_checksums" not in {f[0] for f in spec.fields}:
947945
spec.fields.insert(0, graph_checksum_input)
948-
return spec
949946
else:
950947
base = BaseSpec
951948
if isinstance(spec, list):
@@ -998,9 +995,7 @@ def __init__(
998995
messenger_args=None,
999996
messengers=None,
1000997
output_spec: ty.Optional[
1001-
ty.Union[
1002-
ty.List[ty.Text], ty.Dict[ty.Text, ty.Type[ty.Any]], SpecInfo, BaseSpec
1003-
]
998+
ty.Union[ty.List[str], ty.Dict[str, type], SpecInfo, BaseSpec]
1004999
] = None,
10051000
rerun=False,
10061001
propagate_rerun=True,

0 commit comments

Comments
 (0)