Skip to content

ENH: Add resolve/rebase BasePath traits methods & tests #2970

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 13 commits into from
Aug 1, 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
2 changes: 1 addition & 1 deletion nipype/algorithms/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ def _list_outputs(self):


class AddCSVRowInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec):
in_file = traits.File(
in_file = File(
mandatory=True, desc='Input comma-separated value (CSV) files')
_outputs = traits.Dict(traits.Any, value={}, usedefault=True)

Expand Down
2 changes: 1 addition & 1 deletion nipype/interfaces/afni/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ class RemlfitInputSpec(AFNICommandInputSpec):
'produces a matrix with a single column of all ones',
argstr='-polort %d',
xor=['matrix'])
matim = traits.File(
matim = File(
desc='read a standard file as the matrix. You can use only Col as '
'a name in GLTs with these nonstandard matrix input methods, '
'since the other names come from the \'matrix\' file. '
Expand Down
10 changes: 5 additions & 5 deletions nipype/interfaces/afni/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ class AllineateInputSpec(AFNICommandInputSpec):
'larger weights mean that voxel count more in the cost function. '
'If an image file is given, the volume must be defined on the '
'same grid as the base dataset')
out_weight_file = traits.File(
out_weight_file = File(
argstr='-wtprefix %s',
desc='Write the weight volume to disk as a dataset',
xor=['allcostx'])
Expand Down Expand Up @@ -966,7 +966,7 @@ class ClipLevelInputSpec(CommandLineInputSpec):
argstr='-doall',
position=3,
xor=('grad'))
grad = traits.File(
grad = File(
desc='Also compute a \'gradual\' clip level as a function of voxel '
'position, and output that to a dataset.',
argstr='-grad %s',
Expand Down Expand Up @@ -1831,7 +1831,7 @@ class ROIStatsInputSpec(CommandLineInputSpec):
'a \'0\' in the output file. Only active if `num_roi` is '
'enabled.',
argstr='-zerofill %s')
roisel = traits.File(
roisel = File(
exists=True,
desc='Only considers ROIs denoted by values found in the specified '
'file. Note that the order of the ROIs as specified in the file '
Expand Down Expand Up @@ -2260,7 +2260,7 @@ class TCorrMapInputSpec(AFNICommandInputSpec):
polort = traits.Int(argstr='-polort %d')
bandpass = traits.Tuple(
(traits.Float(), traits.Float()), argstr='-bpass %f %f')
regress_out_timeseries = traits.File(exists=True, argstr='-ort %s')
regress_out_timeseries = File(exists=True, argstr='-ort %s')
blur_fwhm = traits.Float(argstr='-Gblur %f')
seeds_width = traits.Float(argstr='-Mseed %f', xor=('seeds'))

Expand Down Expand Up @@ -3249,7 +3249,7 @@ class QwarpInputSpec(AFNICommandInputSpec):
'* As with \'-wball\', the factor \'f\' should be between 1 and 100.'
'* You cannot use \'-wball\' and \'-wmask\' together!',
argstr='-wpass %s %f')
out_weight_file = traits.File(
out_weight_file = File(
argstr='-wtprefix %s',
desc='Write the weight volume to disk as a dataset')
blur = traits.List(
Expand Down
28 changes: 14 additions & 14 deletions nipype/interfaces/afni/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ class LocalBistatInputSpec(AFNICommandInputSpec):
' * ALL = all of the above, in that order'
'More than one option can be used.',
argstr='-stat %s...')
mask_file = traits.File(
mask_file = File(
exists=True,
desc='mask image file name. Voxels NOT in the mask will not be used '
'in the neighborhood of any voxel. Also, a voxel NOT in the mask '
Expand All @@ -1407,13 +1407,13 @@ class LocalBistatInputSpec(AFNICommandInputSpec):
desc='Compute the mask as in program 3dAutomask.',
argstr='-automask',
xor=['weight_file'])
weight_file = traits.File(
weight_file = File(
exists=True,
desc='File name of an image to use as a weight. Only applies to '
'\'pearson\' statistics.',
argstr='-weight %s',
xor=['automask'])
out_file = traits.File(
out_file = File(
desc='Output dataset.',
argstr='-prefix %s',
name_source='in_file1',
Expand Down Expand Up @@ -1527,7 +1527,7 @@ class LocalstatInputSpec(AFNICommandInputSpec):
' mean, median, MAD, P2skew\n'
'More than one option can be used.',
argstr='-stat %s...')
mask_file = traits.File(
mask_file = File(
exists=True,
desc='Mask image file name. Voxels NOT in the mask will not be used '
'in the neighborhood of any voxel. Also, a voxel NOT in the '
Expand Down Expand Up @@ -1589,7 +1589,7 @@ class LocalstatInputSpec(AFNICommandInputSpec):
overwrite = traits.Bool(
desc='overwrite output file if it already exists',
argstr='-overwrite')
out_file = traits.File(
out_file = File(
desc='Output dataset.',
argstr='-prefix %s',
name_source='in_file',
Expand Down Expand Up @@ -1905,7 +1905,7 @@ class NwarpApplyInputSpec(CommandLineInputSpec):
inv_warp = traits.Bool(
desc='After the warp specified in \'-nwarp\' is computed, invert it',
argstr='-iwarp')
master = traits.File(
master = File(
exists=True,
desc='the name of the master dataset, which defines the output grid',
argstr='-master %s')
Expand Down Expand Up @@ -1980,10 +1980,10 @@ class NwarpApply(AFNICommandBase):

class NwarpCatInputSpec(AFNICommandInputSpec):
in_files = traits.List(
traits.Either(traits.File(),
traits.Either(File(),
traits.Tuple(
traits.Enum('IDENT', 'INV', 'SQRT', 'SQRTINV'),
traits.File())),
File())),
desc="list of tuples of 3D warps and associated functions",
mandatory=True,
argstr="%s",
Expand Down Expand Up @@ -2137,7 +2137,7 @@ class OneDToolPyInputSpec(AFNIPythonCommandInputSpec):
desc=
'display a list of TRs which were not censored in the specified style',
argstr='-show_trs_uncensored %s')
show_cormat_warnings = traits.File(
show_cormat_warnings = File(
desc='Write cormat warnings to a file',
argstr="-show_cormat_warnings |& tee %s",
position=-1,
Expand Down Expand Up @@ -2226,7 +2226,7 @@ class RefitInputSpec(CommandLineInputSpec):
desc='Associates the dataset with a specific template type, e.g. '
'TLRC, MNI, ORIG')
atrcopy = traits.Tuple(
traits.File(exists=True),
File(exists=True),
traits.Str(),
argstr='-atrcopy %s %s',
desc='Copy AFNI header attribute from the given file into the header '
Expand Down Expand Up @@ -2310,7 +2310,7 @@ class ReHoInputSpec(CommandLineInputSpec):
position=1,
mandatory=True,
exists=True)
out_file = traits.File(
out_file = File(
desc='Output dataset.',
argstr='-prefix %s',
name_source='in_file',
Expand All @@ -2323,7 +2323,7 @@ class ReHoInputSpec(CommandLineInputSpec):
'Kendall\'s W. This option is currently compatible only with '
'the AFNI (BRIK/HEAD) output type; the chi-squared value will '
'be the second sub-brick of the output dataset.')
mask_file = traits.File(
mask_file = File(
desc='Mask within which ReHo should be calculated voxelwise',
argstr='-mask %s')
neighborhood = traits.Enum(
Expand Down Expand Up @@ -2451,7 +2451,7 @@ class ResampleInputSpec(AFNICommandInputSpec):
*[traits.Float()] * 3,
argstr='-dxyz %f %f %f',
desc='resample to new dx, dy and dz')
master = traits.File(
master = File(
argstr='-master %s', desc='align dataset grid to a reference file')


Expand Down Expand Up @@ -3247,7 +3247,7 @@ class ZeropadInputSpec(AFNICommandInputSpec):
'and slice thickness = 2.5 mm ==> 2 slices added',
argstr='-mm',
xor=['master'])
master = traits.File(
master = File(
desc='match the volume described in dataset '
'\'mset\', where mset must have the same '
'orientation and grid spacing as dataset to be '
Expand Down
5 changes: 3 additions & 2 deletions nipype/interfaces/base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
StdOutCommandLineInputSpec)

from .traits_extension import (
traits, Undefined, isdefined,
File, Directory, Str, DictStrStr, has_metadata, ImageFile,
traits, Undefined, isdefined, has_metadata,
File, ImageFile, Directory,
Str, DictStrStr,
OutputMultiObject, InputMultiObject,
OutputMultiPath, InputMultiPath)

Expand Down
6 changes: 4 additions & 2 deletions nipype/interfaces/base/specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
md5, hash_infile, hash_timestamp, to_str, USING_PATHLIB2)
from .traits_extension import (
traits,
File,
Str,
Undefined,
isdefined,
has_metadata,
Expand Down Expand Up @@ -373,13 +375,13 @@ class DynamicTraitedSpec(BaseTraitedSpec):


class CommandLineInputSpec(BaseInterfaceInputSpec):
args = traits.Str(argstr='%s', desc='Additional parameters to the command')
args = Str(argstr='%s', desc='Additional parameters to the command')
environ = traits.DictStrStr(
desc='Environment variables', usedefault=True, nohash=True)


class StdOutCommandLineInputSpec(CommandLineInputSpec):
out_file = traits.File(argstr="> %s", position=-1, genfile=True)
out_file = File(argstr="> %s", position=-1, genfile=True)


class MpiCommandLineInputSpec(CommandLineInputSpec):
Expand Down
Loading