Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions pydra/tasks/nipype1/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pydra
import nipype
import attr
import attrs
import typing as ty


Expand All @@ -9,7 +9,7 @@ def traitedspec_to_specinfo(traitedspec):
return pydra.specs.SpecInfo(
name="Inputs",
fields=[
(name, attr.ib(type=ty.Any, metadata={"help_string": trait.desc}))
(name, attrs.field(metadata={"help_string": trait.desc}))
for name, trait in traitedspec.traits().items()
if name in trait_names
],
Expand Down Expand Up @@ -67,9 +67,7 @@ def __init__(
self.output_spec = traitedspec_to_specinfo(interface._outputs())

def _run_task(self):
inputs = attr.asdict(
self.inputs, filter=lambda a, v: v is not attr.NOTHING, retain_collection_types=True
)
inputs = attrs.asdict(self.inputs, filter=lambda a, v: v is not attrs.NOTHING)
node = nipype.Node(self._interface, base_dir=self.output_dir, name=self.name)
node.inputs.trait_set(**inputs)
res = node.run()
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ python_requires = >=3.7
install_requires =
pydra >= 0.6.2
nipype
attrs >= 21.3.0
packages = find_namespace:

[options.packages.find]
Expand Down