Skip to content

Commit

Permalink
STY: black
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Feb 24, 2020
1 parent b99c6a3 commit 84d48f4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
1 change: 1 addition & 0 deletions nipype/interfaces/base/traits_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import traits.api as traits
from traits.api import TraitType, Unicode
from traits.trait_base import _Undefined

try:
# Moved in traits 6.0
from traits.trait_type import NoDefaultSpecified
Expand Down
29 changes: 22 additions & 7 deletions nipype/interfaces/fsl/tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,25 @@
import nipype.interfaces.fsl.model as fsl
from nipype.interfaces.fsl import no_fsl
from pathlib import Path
from ....pipeline import engine as pe
from ....pipeline import engine as pe


@pytest.mark.skipif(no_fsl(), reason="fsl is not installed")
def test_MultipleRegressDesign(tmpdir):
designer = pe.Node(fsl.MultipleRegressDesign(), name='designer', base_dir=str(tmpdir))
designer = pe.Node(
fsl.MultipleRegressDesign(), name="designer", base_dir=str(tmpdir)
)
designer.inputs.regressors = dict(
voice_stenght=[1, 1, 1], age=[0.2, 0.4, 0.5], BMI=[1, -1, 2]
)
con1 = ["voice_and_age", "T", ["age", "voice_stenght"], [0.5, 0.5]]
con2 = ["just_BMI", "T", ["BMI"], [1]]
designer.inputs.contrasts = [con1, con2, ["con3", "F", [con1, con2]], ["con4", "F", [con2]]]
designer.inputs.contrasts = [
con1,
con2,
["con3", "F", [con1, con2]],
["con4", "F", [con2]],
]
res = designer.run()
outputs = res.outputs.get_traitsfree()

Expand All @@ -27,7 +34,9 @@ def test_MultipleRegressDesign(tmpdir):

expected_content = {}

expected_content["design_mat"] = """/NumWaves 3
expected_content[
"design_mat"
] = """/NumWaves 3
/NumPoints 3
/PPheights 3.000000e+00 5.000000e-01 1.000000e+00
Expand All @@ -37,7 +46,9 @@ def test_MultipleRegressDesign(tmpdir):
2.000000e+00 5.000000e-01 1.000000e+00
"""

expected_content["design_con"] = """/ContrastName1 voice_and_age
expected_content[
"design_con"
] = """/ContrastName1 voice_and_age
/ContrastName2 just_BMI
/NumWaves 3
/NumContrasts 2
Expand All @@ -49,15 +60,19 @@ def test_MultipleRegressDesign(tmpdir):
1.000000e+00 0.000000e+00 0.000000e+00
"""

expected_content["design_fts"] = """/NumWaves 2
expected_content[
"design_fts"
] = """/NumWaves 2
/NumContrasts 2
/Matrix
1 1
0 1
"""

expected_content["design_grp"] = """/NumWaves 1
expected_content[
"design_grp"
] = """/NumWaves 1
/NumPoints 3
/Matrix
Expand Down
4 changes: 2 additions & 2 deletions nipype/interfaces/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ def _check_s3_base_dir(self):

s3_flag = base_directory.lower().startswith(s3_str)
if s3_flag:
bucket_name = base_directory[len(s3_str):].partition('/')[0]
bucket_name = base_directory[len(s3_str) :].partition("/")[0]

return s3_flag, bucket_name

Expand Down Expand Up @@ -610,7 +610,7 @@ def _upload_to_s3(self, bucket, src, dst):

# Explicitly lower-case the "s3"
if dst.lower().startswith(s3_str):
dst = s3_str + dst[len(s3_str):]
dst = s3_str + dst[len(s3_str) :]

# If src is a directory, collect files (this assumes dst is a dir too)
if os.path.isdir(src):
Expand Down

0 comments on commit 84d48f4

Please sign in to comment.