Skip to content

MNT: Drop traits upper bound #3685

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 9 commits into from
Oct 4, 2024
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
41 changes: 1 addition & 40 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,43 +266,4 @@ jobs:
workflows:
version: 2
build_test_deploy:
jobs:
- compare_base_dockerfiles:
filters:
branches:
ignore:
- /docs?\/.*/
tags:
only: /.*/
- get_test_data:
filters:
branches:
ignore:
- /docs?\/.*/
tags:
only: /.*/
- test_pytest:
filters:
branches:
ignore:
- /docs?\/.*/
tags:
only: /.*/
requires:
- compare_base_dockerfiles
- get_test_data
- deploy_dockerhub:
filters:
branches:
only: master
tags:
only: /.*/
requires:
- test_pytest
- update_feedstock:
context: nipybot
filters:
branches:
only: /rel\/\d.*/
tags:
only: /.*/
jobs: []
2 changes: 1 addition & 1 deletion .github/workflows/contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: [3.8]
python-version: ["3.12"]
nipype-extras: ["dev"]
check: ["specs", "style"]
env:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,22 @@ jobs:
strategy:
matrix:
os: ["ubuntu-22.04"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
check: ["test"]
pip-flags: [""]
depends: ["REQUIREMENTS"]
deb-depends: [false]
nipype-extras: ["doc,tests,profiler"]
include:
- os: ubuntu-22.04
python-version: "3.8"
python-version: "3.9"
check: test
pip-flags: ""
depends: REQUIREMENTS
deb-depends: true
nipype-extras: doc,tests,profiler,duecredit,ssh
- os: ubuntu-20.04
python-version: 3.8
python-version: "3.9"
check: test
pip-flags: ""
depends: REQUIREMENTS
Expand Down
5 changes: 3 additions & 2 deletions nipype/algorithms/confounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
InputMultiPath,
OutputMultiPath,
SimpleInterface,
Tuple,
)
from ..utils.misc import normalize_mc_params

Expand Down Expand Up @@ -64,7 +65,7 @@ class ComputeDVARSInputSpec(BaseInterfaceInputSpec):
series_tr = traits.Float(desc="repetition time in sec.")
save_plot = traits.Bool(False, usedefault=True, desc="write DVARS plot")
figdpi = traits.Int(100, usedefault=True, desc="output dpi for the plot")
figsize = traits.Tuple(
figsize = Tuple(
traits.Float(11.7),
traits.Float(2.3),
usedefault=True,
Expand Down Expand Up @@ -286,7 +287,7 @@ class FramewiseDisplacementInputSpec(BaseInterfaceInputSpec):
save_plot = traits.Bool(False, usedefault=True, desc="write FD plot")
normalize = traits.Bool(False, usedefault=True, desc="calculate FD in mm/s")
figdpi = traits.Int(100, usedefault=True, desc="output dpi for the FD plot")
figsize = traits.Tuple(
figsize = Tuple(
traits.Float(11.7),
traits.Float(2.3),
usedefault=True,
Expand Down
3 changes: 2 additions & 1 deletion nipype/algorithms/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
TraitedSpec,
File,
BaseInterfaceInputSpec,
Tuple,
)
from ..interfaces.vtkbase import tvtk
from ..interfaces import vtkbase as VTKInfo
Expand Down Expand Up @@ -289,7 +290,7 @@ class MeshWarpMathsInputSpec(BaseInterfaceInputSpec):
)
float_trait = traits.Either(
traits.Float(1.0),
traits.Tuple(traits.Float(1.0), traits.Float(1.0), traits.Float(1.0)),
Tuple(traits.Float(1.0), traits.Float(1.0), traits.Float(1.0)),
)

operator = traits.Either(
Expand Down
3 changes: 2 additions & 1 deletion nipype/algorithms/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
isdefined,
DynamicTraitedSpec,
Undefined,
Tuple,
)
from ..utils.filemanip import fname_presuffix, split_filename, ensure_list

Expand Down Expand Up @@ -1176,7 +1177,7 @@ def _list_outputs(self):
class SplitROIsInputSpec(TraitedSpec):
in_file = File(exists=True, mandatory=True, desc="file to be split")
in_mask = File(exists=True, desc="only process files inside mask")
roi_size = traits.Tuple(traits.Int, traits.Int, traits.Int, desc="desired ROI size")
roi_size = Tuple(traits.Int, traits.Int, traits.Int, desc="desired ROI size")


class SplitROIsOutputSpec(TraitedSpec):
Expand Down
9 changes: 4 additions & 5 deletions nipype/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,13 @@ def get_nipype_gitversion():
"License :: OSI Approved :: Apache Software License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
]
PYTHON_REQUIRES = ">= 3.8"
PYTHON_REQUIRES = ">= 3.9"

description = "Neuroimaging in Python: Pipelines and Interfaces"

Expand Down Expand Up @@ -103,9 +102,9 @@ def get_nipype_gitversion():
NIBABEL_MIN_VERSION = "2.1.0"
NETWORKX_MIN_VERSION = "2.0"
NUMPY_MIN_VERSION = "1.17"
NUMPY_MAX_VERSION = "2.0"
SCIPY_MIN_VERSION = "0.14"
TRAITS_MIN_VERSION = "4.6"
TRAITS_MAX_VERSION = "6.4"
DATEUTIL_MIN_VERSION = "2.2"
SIMPLEJSON_MIN_VERSION = "3.8.0"
PROV_MIN_VERSION = "1.5.2"
Expand Down Expand Up @@ -137,15 +136,15 @@ def get_nipype_gitversion():
"click>=%s" % CLICK_MIN_VERSION,
"networkx>=%s" % NETWORKX_MIN_VERSION,
"nibabel>=%s" % NIBABEL_MIN_VERSION,
"numpy>=%s" % NUMPY_MIN_VERSION,
"numpy>=%s,<%s" % (NUMPY_MIN_VERSION, NUMPY_MAX_VERSION),
"packaging",
"prov>=%s" % PROV_MIN_VERSION,
"pydot>=%s" % PYDOT_MIN_VERSION,
"python-dateutil>=%s" % DATEUTIL_MIN_VERSION,
"rdflib>=%s" % RDFLIB_MIN_VERSION,
"scipy>=%s" % SCIPY_MIN_VERSION,
"simplejson>=%s" % SIMPLEJSON_MIN_VERSION,
"traits>=%s,<%s,!=5.0" % (TRAITS_MIN_VERSION, TRAITS_MAX_VERSION),
"traits>=%s,!=5.0" % TRAITS_MIN_VERSION,
"filelock>=3.0.0",
"etelemetry>=0.2.0",
"looseversion!=1.2",
Expand Down
19 changes: 7 additions & 12 deletions nipype/interfaces/afni/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
InputMultiPath,
Undefined,
Str,
Tuple,
)
from ...external.due import BibTeX

Expand Down Expand Up @@ -127,7 +128,7 @@ class DeconvolveInputSpec(AFNICommandInputSpec):
"that 'gotforit' is needed to ignore.",
argstr="-allzero_OK",
)
dname = traits.Tuple(
dname = Tuple(
Str, Str, desc="set environmental variable to provided value", argstr="-D%s=%s"
)
mask = File(
Expand Down Expand Up @@ -162,7 +163,7 @@ class DeconvolveInputSpec(AFNICommandInputSpec):
"[default: 1]",
argstr="-polort %d",
)
ortvec = traits.Tuple(
ortvec = Tuple(
File(desc="filename", exists=True),
Str(desc="label"),
desc="this option lets you input a rectangular array of 1 or more "
Expand Down Expand Up @@ -213,7 +214,7 @@ class DeconvolveInputSpec(AFNICommandInputSpec):
desc="number of stimulus timing files", argstr="-num_stimts %d", position=-6
)
stim_times = traits.List(
traits.Tuple(
Tuple(
traits.Int(desc="k-th response model"),
File(desc="stimulus timing file", exists=True),
Str(desc="model"),
Expand All @@ -223,9 +224,7 @@ class DeconvolveInputSpec(AFNICommandInputSpec):
position=-5,
)
stim_label = traits.List(
traits.Tuple(
traits.Int(desc="k-th input stimulus"), Str(desc="stimulus label")
),
Tuple(traits.Int(desc="k-th input stimulus"), Str(desc="stimulus label")),
desc="label for kth input stimulus (e.g., Label1)",
argstr="-stim_label %d %s...",
requires=["stim_times"],
Expand All @@ -251,9 +250,7 @@ class DeconvolveInputSpec(AFNICommandInputSpec):
position=-2,
)
glt_label = traits.List(
traits.Tuple(
traits.Int(desc="k-th general linear test"), Str(desc="GLT label")
),
Tuple(traits.Int(desc="k-th general linear test"), Str(desc="GLT label")),
desc="general linear test (i.e., contrast) labels",
argstr="-glt_label %d %s...",
requires=["gltsym"],
Expand Down Expand Up @@ -488,9 +485,7 @@ class RemlfitInputSpec(AFNICommandInputSpec):
argstr="-nobout",
)
gltsym = traits.List(
traits.Either(
traits.Tuple(File(exists=True), Str()), traits.Tuple(Str(), Str())
),
traits.Either(Tuple(File(exists=True), Str()), Tuple(Str(), Str())),
desc="read a symbolic GLT from input file and associate it with a "
"label. As in Deconvolve, you can also use the 'SYM:' method "
"to provide the definition of the GLT directly as a string "
Expand Down
13 changes: 7 additions & 6 deletions nipype/interfaces/afni/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
CommandLine,
TraitedSpec,
traits,
Tuple,
isdefined,
File,
InputMultiPath,
Expand Down Expand Up @@ -2439,7 +2440,7 @@ class TCorrMapInputSpec(AFNICommandInputSpec):
mask = File(exists=True, argstr="-mask %s")
automask = traits.Bool(argstr="-automask")
polort = traits.Int(argstr="-polort %d")
bandpass = traits.Tuple((traits.Float(), traits.Float()), argstr="-bpass %f %f")
bandpass = Tuple((traits.Float(), traits.Float()), argstr="-bpass %f %f")
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 @@ -3011,13 +3012,13 @@ class TProjectInputSpec(AFNICommandInputSpec):

""",
)
bandpass = traits.Tuple(
bandpass = Tuple(
traits.Float,
traits.Float,
desc="""Remove all frequencies EXCEPT those in the range""",
argstr="-bandpass %g %g",
)
stopband = traits.Tuple(
stopband = Tuple(
traits.Float,
traits.Float,
desc="""Remove all frequencies in the range""",
Expand Down Expand Up @@ -3394,7 +3395,7 @@ class VolregInputSpec(AFNICommandInputSpec):
copyfile=False,
)
in_weight_volume = traits.Either(
traits.Tuple(File(exists=True), traits.Int),
Tuple(File(exists=True), traits.Int),
File(exists=True),
desc="weights for each voxel specified by a file with an "
"optional volume number (defaults to 0)",
Expand Down Expand Up @@ -3821,8 +3822,8 @@ class QwarpInputSpec(AFNICommandInputSpec):
maxlen=5,
xor=["wmask"],
)
traits.Tuple((traits.Float(), traits.Float()), argstr="-bpass %f %f")
wmask = traits.Tuple(
bandpass = Tuple((traits.Float(), traits.Float()), argstr="-bpass %f %f")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Shotgunosine I assume this was the original intent?

wmask = Tuple(
(File(exists=True), traits.Float()),
desc="""\
Similar to '-wball', but here, you provide a dataset 'ws'
Expand Down
3 changes: 3 additions & 0 deletions nipype/interfaces/afni/tests/test_auto_Qwarp.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ def test_Qwarp_inputs():
argstr="-ballopt",
xor=["workhard", "boxopt"],
),
bandpass=dict(
argstr="-bpass %f %f",
),
base_file=dict(
argstr="-base %s",
copyfile=False,
Expand Down
3 changes: 3 additions & 0 deletions nipype/interfaces/afni/tests/test_auto_QwarpPlusMinus.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ def test_QwarpPlusMinus_inputs():
argstr="-ballopt",
xor=["workhard", "boxopt"],
),
bandpass=dict(
argstr="-bpass %f %f",
),
base_file=dict(
argstr="-base %s",
copyfile=False,
Expand Down
Loading