Skip to content

Commit e511fbe

Browse files
committed
fix: allow tests to be found, keep output consistent
1 parent 853cb9c commit e511fbe

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

nipype/interfaces/workbench/metric.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ class MetricResampleInputSpec(CommandLineInputSpec):
3131
mandatory=True,
3232
argstr="%s",
3333
position=2,
34-
desc=("A sphere surface that is in register with <current-sphere> and"
35-
" has the desired output mesh"))
34+
desc="A sphere surface that is in register with <current-sphere> and"
35+
" has the desired output mesh")
3636
method = traits.Enum(
3737
"ADAP_BARY_AREA",
3838
"BARYCENTRIC",
3939
argstr="%s",
4040
mandatory=True,
4141
position=3,
42-
desc=("The method name - ADAP_BARY_AREA method is recommended for"
43-
" ordinary metric data, because it should use all data while"
44-
" downsampling, unlike BARYCENTRIC. If ADAP_BARY_AREA is used,"
45-
" exactly one of area_surfs or area_metrics must be specified"))
46-
metric_out = File(
42+
desc="The method name - ADAP_BARY_AREA method is recommended for"
43+
" ordinary metric data, because it should use all data while"
44+
" downsampling, unlike BARYCENTRIC. If ADAP_BARY_AREA is used,"
45+
" exactly one of area_surfs or area_metrics must be specified")
46+
out_file = File(
4747
name_source=["new_sphere"],
4848
name_template="%s.out",
4949
keep_extension=True,
@@ -64,14 +64,14 @@ class MetricResampleInputSpec(CommandLineInputSpec):
6464
exists=True,
6565
position=6,
6666
argstr="%s",
67-
desc=("A relevant anatomical surface with <current-sphere> mesh OR"
68-
" a metric file with vertex areas for <current-sphere> mesh"))
67+
desc="A relevant anatomical surface with <current-sphere> mesh OR"
68+
" a metric file with vertex areas for <current-sphere> mesh")
6969
new_area = File(
7070
exists=True,
7171
position=7,
7272
argstr="%s",
73-
desc=("A relevant anatomical surface with <current-sphere> mesh OR"
74-
" a metric file with vertex areas for <current-sphere> mesh"))
73+
desc="A relevant anatomical surface with <current-sphere> mesh OR"
74+
" a metric file with vertex areas for <current-sphere> mesh")
7575
roi_metric = File(
7676
exists=True,
7777
position=8,
@@ -118,9 +118,9 @@ class MetricResample(WBCommand):
118118
_cmd = 'wb_command -metric-resample'
119119

120120
def _format_arg(self, opt, spec, val):
121-
if opt == "metric_out":
121+
if opt == "out_file":
122122
# ensure generated filename is assigned to trait
123-
self.inputs.trait_set(metric_out=val)
123+
self.inputs.trait_set(out_file=val)
124124
if opt in ['current_area', 'new_area']:
125125
if not self.inputs.area_surfs and not self.inputs.area_metrics:
126126
raise ValueError("{} was set but neither area_surfs or"
@@ -140,7 +140,7 @@ def _format_arg(self, opt, spec, val):
140140

141141
def _list_outputs(self):
142142
outputs = self._outputs().get()
143-
outputs['out_file'] = os.path.abspath(self.inputs.metric_out)
143+
outputs['out_file'] = os.path.abspath(self.inputs.out_file)
144144
if self.inputs.valid_roi_out:
145145
roi_file = self._gen_filename(self.inputs.in_file, suffix='_roi')
146146
outputs['roi_file'] = os.path.abspath(roi)

nipype/interfaces/workbench/tests/__init__.py

Whitespace-only changes.

nipype/interfaces/workbench/tests/test_auto_MetricResample.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,6 @@ def test_MetricResample_inputs():
4848
mandatory=True,
4949
position=3,
5050
),
51-
metric_out=dict(
52-
argstr='%s',
53-
keep_extension=True,
54-
name_source=['new_sphere'],
55-
name_template='%s.out',
56-
position=4,
57-
),
5851
new_area=dict(
5952
argstr='%s',
6053
position=7,
@@ -64,6 +57,13 @@ def test_MetricResample_inputs():
6457
mandatory=True,
6558
position=2,
6659
),
60+
out_file=dict(
61+
argstr='%s',
62+
keep_extension=True,
63+
name_source=['new_sphere'],
64+
name_template='%s.out',
65+
position=4,
66+
),
6767
roi_metric=dict(
6868
argstr='-current-roi %s',
6969
position=8,

0 commit comments

Comments
 (0)