Skip to content

Commit 99c37ff

Browse files
authored
Merge pull request #2 from effigies/test/ci
TEST: Get CI running clean
2 parents f9c286e + 307e92f commit 99c37ff

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
pip install ".[dev]"
3030
- name: Test with pytest
3131
run: |
32-
pytest --doctest-modules pydra/tasks/nipype1
32+
pytest -sv --doctest-modules pydra/tasks/nipype1

pydra/tasks/nipype1/utils.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,27 @@ def traitedspec_to_specinfo(traitedspec):
1616

1717

1818
class Nipype1Task(pydra.engine.task.TaskBase):
19-
"""Wrap a Python callable as a task element."""
19+
"""Wrap a Nipype 1.x Interface as a Pydra Task
20+
21+
This utility translates the Nipype 1 input and output specs to
22+
Pydra-style specs, wraps the run command, and exposes the output
23+
in Pydra Task outputs.
24+
25+
>>> import pytest
26+
>>> from pkg_resources import resource_filename
27+
>>> from nipype.interfaces import fsl
28+
>>> if fsl.Info.version() is None:
29+
... pytest.skip()
30+
>>> img = resource_filename('nipype', 'testing/data/tpms_msk.nii.gz')
31+
32+
>>> from pydra.tasks.nipype1.utils import Nipype1Task
33+
>>> thresh = Nipype1Task(fsl.Threshold())
34+
>>> thresh.inputs.in_file = img
35+
>>> thresh.inputs.thresh = 0.5
36+
>>> res = thresh()
37+
>>> res.output.out_file # DOCTEST: +ELLIPSIS
38+
'.../tpms_msk_thresh.nii.gz'
39+
"""
2040

2141
def __init__(
2242
self,

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description = Tools for importing nipype 1.x interfaces into Pydra
66
[options]
77
python_requires = >=3.7
88
install_requires =
9-
pydra
9+
pydra @ git+https://github.com/effigies/pydra.git@85f9eeae02ec6b6c6893b8216b4e1f97219c7e2c
1010
nipype
1111
packages = pydra.tasks.nipype1
1212

0 commit comments

Comments
 (0)