Skip to content

Commit 00ff336

Browse files
authored
Merge pull request #3033 from effigies/test/make_specs
MAINT: Set minimum yapf for `checkspecs` to 0.27
2 parents e0aca32 + 399529f commit 00ff336

File tree

6 files changed

+17
-34
lines changed

6 files changed

+17
-34
lines changed

nipype/algorithms/modelgen.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,15 +254,13 @@ class SpecifyModelInputSpec(BaseInterfaceInputSpec):
254254
xor=['subject_info', 'event_files', 'bids_event_file'],
255255
desc='TSV event file containing common BIDS fields: `onset`,'
256256
'`duration`, and categorization and amplitude columns')
257-
bids_condition_column = traits.Str(exists=True,
258-
mandatory=False,
257+
bids_condition_column = traits.Str(
259258
default_value='trial_type',
260259
usedefault=True,
261260
desc='Column of the file passed to `bids_event_file` to the '
262261
'unique values of which events will be assigned'
263262
'to regressors')
264-
bids_amplitude_column = traits.Str(exists=True,
265-
mandatory=False,
263+
bids_amplitude_column = traits.Str(
266264
desc='Column of the file passed to `bids_event_file` '
267265
'according to which to assign amplitudes to events')
268266
realignment_parameters = InputMultiPath(

nipype/algorithms/tests/test_auto_SpecifyModel.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,8 @@
55

66
def test_SpecifyModel_inputs():
77
input_map = dict(
8-
bids_amplitude_column=dict(
9-
exists=True,
10-
mandatory=False,
11-
),
12-
bids_condition_column=dict(
13-
exists=True,
14-
mandatory=False,
15-
usedefault=True,
16-
),
8+
bids_amplitude_column=dict(),
9+
bids_condition_column=dict(usedefault=True, ),
1710
bids_event_file=dict(
1811
mandatory=True,
1912
xor=['subject_info', 'event_files', 'bids_event_file'],

nipype/algorithms/tests/test_auto_SpecifySPMModel.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,8 @@
55

66
def test_SpecifySPMModel_inputs():
77
input_map = dict(
8-
bids_amplitude_column=dict(
9-
exists=True,
10-
mandatory=False,
11-
),
12-
bids_condition_column=dict(
13-
exists=True,
14-
mandatory=False,
15-
usedefault=True,
16-
),
8+
bids_amplitude_column=dict(),
9+
bids_condition_column=dict(usedefault=True, ),
1710
bids_event_file=dict(
1811
mandatory=True,
1912
xor=['subject_info', 'event_files', 'bids_event_file'],

nipype/algorithms/tests/test_auto_SpecifySparseModel.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,8 @@
55

66
def test_SpecifySparseModel_inputs():
77
input_map = dict(
8-
bids_amplitude_column=dict(
9-
exists=True,
10-
mandatory=False,
11-
),
12-
bids_condition_column=dict(
13-
exists=True,
14-
mandatory=False,
15-
usedefault=True,
16-
),
8+
bids_amplitude_column=dict(),
9+
bids_condition_column=dict(usedefault=True, ),
1710
bids_event_file=dict(
1811
mandatory=True,
1912
xor=['subject_info', 'event_files', 'bids_event_file'],

nipype/info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def get_nipype_gitversion():
187187
'nipy': ['nitime', 'nilearn<0.5.0', 'dipy', 'nipy', 'matplotlib'],
188188
'profiler': ['psutil>=5.0'],
189189
'pybids': ['pybids>=0.7.0'],
190-
'specs': ['yapf'],
190+
'specs': ['yapf>=0.27'],
191191
'ssh': ['paramiko'],
192192
'tests': TESTS_REQUIRES,
193193
'xvfbwrapper': ['xvfbwrapper'],

tools/checkspecs.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@
1010
import re
1111
import sys
1212
import warnings
13+
from distutils.version import LooseVersion
1314

1415
from nipype.interfaces.base import BaseInterface
16+
17+
import yapf
18+
if LooseVersion(yapf.__version__) < '0.27':
19+
raise ImportError("Please upgrade yapf to version 0.27 or newer for stable formatting")
20+
1521
from yapf.yapflib.yapf_api import FormatCode
1622

1723

@@ -25,7 +31,7 @@ def __init__(self,
2531
package_skip_patterns=None,
2632
module_skip_patterns=None,
2733
class_skip_patterns=None):
28-
''' Initialize package for parsing
34+
r''' Initialize package for parsing
2935
3036
Parameters
3137
----------
@@ -194,7 +200,7 @@ def test_specs(self, uri):
194200
'position', 'mandatory', 'copyfile', 'usedefault', 'sep',
195201
'hash_files', 'deprecated', 'new_name', 'min_ver', 'max_ver',
196202
'name_source', 'name_template', 'keep_extension', 'units',
197-
'output_name'
203+
'output_name', 'extensions'
198204
]
199205
in_built = [
200206
'type', 'copy', 'parent', 'instance_handler', 'comparison_mode',

0 commit comments

Comments
 (0)