Skip to content

MAINT: Set minimum yapf for checkspecs to 0.27 #3033

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 16, 2019
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
6 changes: 2 additions & 4 deletions nipype/algorithms/modelgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,13 @@ class SpecifyModelInputSpec(BaseInterfaceInputSpec):
xor=['subject_info', 'event_files', 'bids_event_file'],
desc='TSV event file containing common BIDS fields: `onset`,'
'`duration`, and categorization and amplitude columns')
bids_condition_column = traits.Str(exists=True,
mandatory=False,
bids_condition_column = traits.Str(
default_value='trial_type',
usedefault=True,
desc='Column of the file passed to `bids_event_file` to the '
'unique values of which events will be assigned'
'to regressors')
bids_amplitude_column = traits.Str(exists=True,
mandatory=False,
bids_amplitude_column = traits.Str(
desc='Column of the file passed to `bids_event_file` '
'according to which to assign amplitudes to events')
realignment_parameters = InputMultiPath(
Expand Down
11 changes: 2 additions & 9 deletions nipype/algorithms/tests/test_auto_SpecifyModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,8 @@

def test_SpecifyModel_inputs():
input_map = dict(
bids_amplitude_column=dict(
exists=True,
mandatory=False,
),
bids_condition_column=dict(
exists=True,
mandatory=False,
usedefault=True,
),
bids_amplitude_column=dict(),
bids_condition_column=dict(usedefault=True, ),
bids_event_file=dict(
mandatory=True,
xor=['subject_info', 'event_files', 'bids_event_file'],
Expand Down
11 changes: 2 additions & 9 deletions nipype/algorithms/tests/test_auto_SpecifySPMModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,8 @@

def test_SpecifySPMModel_inputs():
input_map = dict(
bids_amplitude_column=dict(
exists=True,
mandatory=False,
),
bids_condition_column=dict(
exists=True,
mandatory=False,
usedefault=True,
),
bids_amplitude_column=dict(),
bids_condition_column=dict(usedefault=True, ),
bids_event_file=dict(
mandatory=True,
xor=['subject_info', 'event_files', 'bids_event_file'],
Expand Down
11 changes: 2 additions & 9 deletions nipype/algorithms/tests/test_auto_SpecifySparseModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,8 @@

def test_SpecifySparseModel_inputs():
input_map = dict(
bids_amplitude_column=dict(
exists=True,
mandatory=False,
),
bids_condition_column=dict(
exists=True,
mandatory=False,
usedefault=True,
),
bids_amplitude_column=dict(),
bids_condition_column=dict(usedefault=True, ),
bids_event_file=dict(
mandatory=True,
xor=['subject_info', 'event_files', 'bids_event_file'],
Expand Down
2 changes: 1 addition & 1 deletion nipype/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def get_nipype_gitversion():
'nipy': ['nitime', 'nilearn<0.5.0', 'dipy', 'nipy', 'matplotlib'],
'profiler': ['psutil>=5.0'],
'pybids': ['pybids>=0.7.0'],
'specs': ['yapf'],
'specs': ['yapf>=0.27'],
'ssh': ['paramiko'],
'tests': TESTS_REQUIRES,
'xvfbwrapper': ['xvfbwrapper'],
Expand Down
10 changes: 8 additions & 2 deletions tools/checkspecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@
import re
import sys
import warnings
from distutils.version import LooseVersion

from nipype.interfaces.base import BaseInterface

import yapf
if LooseVersion(yapf.__version__) < '0.27':
raise ImportError("Please upgrade yapf to version 0.27 or newer for stable formatting")

from yapf.yapflib.yapf_api import FormatCode


Expand All @@ -25,7 +31,7 @@ def __init__(self,
package_skip_patterns=None,
module_skip_patterns=None,
class_skip_patterns=None):
''' Initialize package for parsing
r''' Initialize package for parsing

Parameters
----------
Expand Down Expand Up @@ -194,7 +200,7 @@ def test_specs(self, uri):
'position', 'mandatory', 'copyfile', 'usedefault', 'sep',
'hash_files', 'deprecated', 'new_name', 'min_ver', 'max_ver',
'name_source', 'name_template', 'keep_extension', 'units',
'output_name'
'output_name', 'extensions'
]
in_built = [
'type', 'copy', 'parent', 'instance_handler', 'comparison_mode',
Expand Down