Skip to content

Commit 9baa190

Browse files
committed
roll back testsetup blocks, some encoding fixes
1 parent f923bd5 commit 9baa190

File tree

3 files changed

+25
-29
lines changed

3 files changed

+25
-29
lines changed

nipype/interfaces/utility/base.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44
"""
55
Various utilities
66
7-
Change directory to provide relative paths for doctests
8-
9-
.. testsetup::
10-
import os
11-
filepath = os.path.dirname( os.path.realpath( __file__ ) )
12-
datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
13-
os.chdir(datadir)
14-
7+
Change directory to provide relative paths for doctests
8+
>>> import os
9+
>>> filepath = os.path.dirname(os.path.realpath(__file__))
10+
>>> datadir = os.path.realpath(os.path.join(filepath,
11+
... '../../testing/data'))
12+
>>> os.chdir(datadir)
1513
1614
"""
1715
from __future__ import print_function, division, unicode_literals, absolute_import
@@ -27,7 +25,7 @@
2725

2826
from ..base import (traits, TraitedSpec, DynamicTraitedSpec, File,
2927
Undefined, isdefined, OutputMultiPath, InputMultiPath,
30-
BaseInterface, BaseInterfaceInputSpec)
28+
BaseInterface, BaseInterfaceInputSpec, Str)
3129
from ..io import IOBase, add_traits
3230
from ...utils.filemanip import filename_to_list, copyfile, split_filename
3331

@@ -158,11 +156,10 @@ class RenameInputSpec(DynamicTraitedSpec):
158156
in_file = File(exists=True, mandatory=True, desc="file to rename")
159157
keep_ext = traits.Bool(desc=("Keep in_file extension, replace "
160158
"non-extension component of name"))
161-
format_string = traits.String(mandatory=True,
162-
desc=("Python formatting string for output "
163-
"template"))
164-
parse_string = traits.String(desc=("Python regexp parse string to define "
165-
"replacement inputs"))
159+
format_string = Str(mandatory=True,
160+
desc="Python formatting string for output template")
161+
parse_string = Str(desc="Python regexp parse string to define "
162+
"replacement inputs")
166163
use_fullpath = traits.Bool(False, usedefault=True,
167164
desc="Use full path as input to regex parser")
168165

@@ -186,6 +183,7 @@ class Rename(IOBase):
186183
187184
Examples
188185
--------
186+
189187
>>> from nipype.interfaces.utility import Rename
190188
>>> rename1 = Rename()
191189
>>> rename1.inputs.in_file = "zstat1.nii.gz"

nipype/interfaces/utility/csv.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
# vi: set ft=python sts=4 ts=4 sw=4 et:
44
"""CSV Handling utilities
55
6-
Change directory to provide relative paths for doctests
7-
8-
.. testsetup::
9-
import os
10-
filepath = os.path.dirname( os.path.realpath( __file__ ) )
11-
datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
12-
os.chdir(datadir)
13-
6+
Change directory to provide relative paths for doctests
7+
>>> import os
8+
>>> filepath = os.path.dirname(os.path.realpath(__file__))
9+
>>> datadir = os.path.realpath(os.path.join(filepath,
10+
... '../../testing/data'))
11+
>>> os.chdir(datadir)
1412
1513
"""
1614
from __future__ import print_function, division, unicode_literals, absolute_import

nipype/interfaces/utility/wrappers.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
# vi: set ft=python sts=4 ts=4 sw=4 et:
44
"""Various utilities
55
6-
Change directory to provide relative paths for doctests
7-
8-
.. testsetup::
9-
import os
10-
filepath = os.path.dirname( os.path.realpath( __file__ ) )
11-
datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
12-
os.chdir(datadir)
6+
Change directory to provide relative paths for doctests
7+
>>> import os
8+
>>> filepath = os.path.dirname(os.path.realpath(__file__))
9+
>>> datadir = os.path.realpath(os.path.join(filepath,
10+
... '../../testing/data'))
11+
>>> os.chdir(datadir)
1312
1413
1514
"""
@@ -18,6 +17,7 @@
1817
from future import standard_library
1918
standard_library.install_aliases()
2019

20+
from builtins import str, bytes
2121

2222
from nipype import logging
2323
from ..base import (traits, DynamicTraitedSpec, Undefined, isdefined, runtime_profile,

0 commit comments

Comments
 (0)