Compare commits

30 Commits

Author SHA256 Message Date
2848039a17 Accepting request 1296683 from devel:languages:python:numeric
- Add patch ignore-userwarnings.patch:
  * Ignore any UserWarnings that arise, rather than to trying to swallow
    them with pytest.warns().

OBS-URL: https://build.opensuse.org/request/show/1296683
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-nibabel?expand=0&rev=15
2025-07-31 15:46:56 +00:00
5d26cf4b61 Accepting request 1226405 from devel:languages:python:numeric
- Update to 5.3.2:
  * New features
    + Update NIfTI extension protocol to include .content : bytes, .text :
      str and .json : dict properties for accessing extension contents.
  * Enhancements
    + Ability to read data from many multiframe DICOM files that previously
      generated errors
    + nib-nifti-dx now supports NIfTI-2 files with a --nifti2 flag
    + Update nibabel.streamlines.tractogram to support ragged arrays.
    + Improve error message for for dicomwrapper errors in shape
      calculation
    + Support "flat" ASCII-encoded GIFTI DataArrays
  * Bug fixes
    + Fix location initialization/update in OrthoSlicer3D for permuted axes
    + Fix DICOM scaling, making frame filtering explicit
    + Fixed multiframe DICOM issue where data could be flipped along slice
      dimension relative to the affine
    + Fixed multiframe DICOM issue where image_position and the translation
      component in the affine could be incorrect
  * Maintenance
    + Numpy 2.0 compatibility and addressing deprecations in numpy API
    + Python 3.13 compatibility
    + Testing on Python 3.13 with free-threading
    + Proactively address deprecations in coming Python versions
    + Replace nose-era setup() and teardown() functions with pytest
      equivalents
  * API changes and deprecations
    + Raise HeaderDataError from set_qform if the affine fails to
      decompose. This would previously result in numpy.linalgLinAlgError.
    + The nibabel.onetime.auto_attr module can be replaced by

OBS-URL: https://build.opensuse.org/request/show/1226405
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-nibabel?expand=0&rev=14
2024-11-26 19:55:59 +00:00
764bd6c788 - Update to 5.3.2:
* New features
    + Update NIfTI extension protocol to include .content : bytes, .text :
      str and .json : dict properties for accessing extension contents.
  * Enhancements
    + Ability to read data from many multiframe DICOM files that previously
      generated errors
    + nib-nifti-dx now supports NIfTI-2 files with a --nifti2 flag
    + Update nibabel.streamlines.tractogram to support ragged arrays.
    + Improve error message for for dicomwrapper errors in shape
      calculation
    + Support "flat" ASCII-encoded GIFTI DataArrays
  * Bug fixes
    + Fix location initialization/update in OrthoSlicer3D for permuted axes
    + Fix DICOM scaling, making frame filtering explicit
    + Fixed multiframe DICOM issue where data could be flipped along slice
      dimension relative to the affine
    + Fixed multiframe DICOM issue where image_position and the translation
      component in the affine could be incorrect
  * Maintenance
    + Numpy 2.0 compatibility and addressing deprecations in numpy API
    + Python 3.13 compatibility
    + Testing on Python 3.13 with free-threading
    + Proactively address deprecations in coming Python versions
    + Replace nose-era setup() and teardown() functions with pytest
      equivalents
  * API changes and deprecations
    + Raise HeaderDataError from set_qform if the affine fails to
      decompose. This would previously result in numpy.linalgLinAlgError.
    + The nibabel.onetime.auto_attr module can be replaced by

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-nibabel?expand=0&rev=28
2024-11-26 05:23:34 +00:00
c5e3b1d134 Accepting request 1189472 from devel:languages:python:numeric
- Remove numpy upper bound.
- Add patch support-numpy-2.patch:
  * Use np.asarray() to support NumPy 2 as well.

OBS-URL: https://build.opensuse.org/request/show/1189472
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-nibabel?expand=0&rev=13
2024-07-25 13:39:34 +00:00
7fb68bda45 - Remove numpy upper bound.
- Add patch support-numpy-2.patch:
  * Use np.asarray() to support NumPy 2 as well.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-nibabel?expand=0&rev=26
2024-07-25 02:06:49 +00:00
fbbd5f0c1a Accepting request 1188927 from devel:languages:python:numeric
- Switch to autosetup macro.
- Restrict numpy to < 2 because it isn't currently supported.
- Add patch support-pytest-8.patch:
  * Use pytest setup/teardown methods.

OBS-URL: https://build.opensuse.org/request/show/1188927
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-nibabel?expand=0&rev=12
2024-07-22 15:18:36 +00:00
2024221375 - Switch to autosetup macro.
- Restrict numpy to < 2 because it isn't currently supported.
- Add patch support-pytest-8.patch:
  * Use pytest setup/teardown methods.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-nibabel?expand=0&rev=24
2024-07-22 05:54:20 +00:00
a830a4ed5b Accepting request 1161551 from devel:languages:python:numeric
- update to 5.2.1:
  * Support "flat" ASCII-encoded GIFTI DataArrays (pr/1298) (PM,
    reviewed by CM)
  * Tolerate missing ``git`` when reporting version info
    (pr/1286)
  * Handle Siemens XA30 derived DWI DICOMs (pr/1296)
  * Add tool for generating GitHub-friendly release notes
  * Accommodate pytest 8 changes (pr/1297) (CM)

  * nib-convert CLI tool to make image type and data dtype conversion
  * Allow dtypes to be passed to Analyze-like images at __init__()
  * Passing (u)int64 arrays to Nifti1Image and subclasses will warn
    unless a header or dtype option is passed; in the future this will
    become an error. Additionally, passing int or 'int' to set_data_dtype()
    now raises an error, requiring an explicit numpy dtype to make 64-bit
- skip python 36

OBS-URL: https://build.opensuse.org/request/show/1161551
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-nibabel?expand=0&rev=11
2024-03-26 18:26:23 +00:00
df6ae5e4db - update to 5.2.1:
* Support "flat" ASCII-encoded GIFTI DataArrays (pr/1298) (PM,
    reviewed by CM)
  * Tolerate missing ``git`` when reporting version info
    (pr/1286)
  * Handle Siemens XA30 derived DWI DICOMs (pr/1296)
  * Add tool for generating GitHub-friendly release notes
  * Accommodate pytest 8 changes (pr/1297) (CM)
  * nib-convert CLI tool to make image type and data dtype conversion
  * Allow dtypes to be passed to Analyze-like images at __init__()
  * Passing (u)int64 arrays to Nifti1Image and subclasses will warn
    unless a header or dtype option is passed; in the future this will
    become an error. Additionally, passing int or 'int' to set_data_dtype()
    now raises an error, requiring an explicit numpy dtype to make 64-bit
- skip python 36

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-nibabel?expand=0&rev=22
2024-03-25 20:13:17 +00:00
fe52228876 Accepting request 1147160 from devel:languages:python:numeric
OBS-URL: https://build.opensuse.org/request/show/1147160
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-nibabel?expand=0&rev=10
2024-02-18 19:23:20 +00:00
a4851ee354 Accepting request 1147056 from home:bnavigator:branches:devel:languages:python:numeric
- Update to 5.2.0
  ## New features
  * Add generic Pointset and regularly spaced Grid data structures
    in preparation for coordinate transformation and resampling
    (#1251) (CM, reviewed by Oscar Esteban)
  ## Enhancements
  * Add copy method to ArrayProxy (#1255) (CM, reviewed by Paul
    McCarthy)
  * Permit to_xml to pass keyword arguments to tostring (#1258)
    (CM)
  * Allow user expansion (e.g., ~/...) in strings passed to
    functions that accept paths (#1260) (Reinder Vos de Wael,
    reviewed by CM)
  * Expand CIFTI-2 brain structures to permit synonyms (#1256) (CM,
    reviewed by Mathias Goncalves)
  * Annotate SpatialImage as accepting affine=None argument (#1253)
    (Blake Dewey, reviewed by CM)
  * Warn on invalid MINC2 spacing declarations, treat as missing
    (#1237) (Peter Suter, reviewed by CM)
  * Refactor find_private_section for improved readability and
    maintainability (#1228) (MB, reviewed by CM)
  ## API changes and deprecations
  * The nibabel.pydicom_compat module is deprecated and will be
    removed in NiBabel 7.0. (#1280)
  * The int_to_float and as_int functions are no longer needed to
    work around NumPy deficiencies and have been deprecated (#1272)
    (CM, reviewed by EL)
- Release 5.1
  ## Enhancements
  * Make imagestats available with import nibabel (pr/1208) (Fabian
    Perez, reviewed by CM)
  * Use symmetric threshold for identifying unit quaternions on
    qform calculations (pr/1182) (CM, reviewed by MB)
  * Type annotations for nibabel.loadsave (pr/1213) and
    nibabel.spatialimages.SpatialImage APIs (pr/1179),
    nibabel.deprecated, nibabel.deprecator, nibabel.onetime and
    nibabel.optpkg modules (pr/1188), nibabel.volumeutils
    (pr/1189), nibabel.filename_parser and nibabel.openers
    (pr/1197) (CM, reviewed by Zvi Baratz)
- Release 5.0
  ## New features
  * SerializableImage now has to_stream() and from_stream() methods
    to read/write streams implementing the io.IOBase interface. A
    from_url() method enables loading images from URLs. (pr/1129)
    (CM, reviewed by MB)
  * TrkFile supports TRKv3, an undocumented but generally
    compatible variant of TRKv2. (pr/1125) (CM)
  ## Enhancements
  * Support multiline header fields in TCKFile (pr/1175) (CM,
    reviewed by Matt Cieslak)
  * Make layout order an initialization parameter of ArrayProxy
    (pr/1131) (CM, reviewed by MB)
  * Initial support for type annotations. (pr/1115, pr/1178) (CM,
    reviewed by Zvi Baratz)
  ## API changes and deprecations
  * Passing an int64 array to Nifti1Image without a header or dtype
    argument will raise a ValueError. (pr/1173) (CM)
  * tmpdirs.TemporaryDirectory is deprecated in favor of
    tempfile.TemporaryDirectory. (pr/1172) (CM, reviewed by Zvi
    Baratz)
  * The nisext package is deprecated and will be removed in NiBabel
    6.0. (pr/1170) (CM, reviewed by MB)
  * Drop support for Python 3.7, Numpy < 1.19 (pr/1177) (CM)
  * The following deprecated functions and methods will now raise
    ExpiredDeprecationErrors
    - nibabel.loadsave.read_img_data
    - nibabel.dataobj_images.DataobjImage.get_data
    - nibabel.loadsave.guessed_image_type
    - nibabel.onetime.setattr_on_read
    - nibabel.orientations.flip_axis
  * Modules, classes and functions that expired at 4.0 were fully
    removed. ExpiredDeprecationError will now be
    AttributeError.

OBS-URL: https://build.opensuse.org/request/show/1147056
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-nibabel?expand=0&rev=20
2024-02-16 16:56:53 +00:00
57bda54458 Accepting request 1009448 from devel:languages:python:numeric
- Update to 4.0.2
  * many changes, see Changelog
  * nib-convert CLI tool to make image type and data dtype conversion 
    accessible via the command line.
  * Allow dtypes to be passed to Analyze-like images at __init__() 
    and to_filename()
  * Allow compressed GIFTI images
  * Add zstd compression support
  * Test on Python 3.10
  * Passing (u)int64 arrays to Nifti1Image and subclasses will warn 
    unless a header or dtype option is passed; in the future this will 
    become an error. Additionally, passing int or 'int' to set_data_dtype() 
    now raises an error, requiring an explicit numpy dtype to make 64-bit 
    integer images.
  * Drop support for Python 3.6, Numpy < 1.17
  * Fully removed the APIs, which have raised errors on use since 3.0
- Drop upstreamed 983.patch and purge-nose.patch

OBS-URL: https://build.opensuse.org/request/show/1009448
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-nibabel?expand=0&rev=9
2022-10-11 16:02:53 +00:00
c84aa4e37b add the new binaries also to %files
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-nibabel?expand=0&rev=18
2022-10-10 13:05:55 +00:00
f07c266728 Accepting request 1008422 from home:mcalabkova:branches:devel:languages:python:numeric
- Update to 4.0.2
  * many changes, see Changelog
  * nib-convert CLI tool to make image type and data dtype conversion 
    accessible via the command line.
  * Allow dtypes to be passed to Analyze-like images at __init__() 
    and to_filename()
  * Allow compressed GIFTI images
  * Add zstd compression support
  * Test on Python 3.10
  * Passing (u)int64 arrays to Nifti1Image and subclasses will warn 
    unless a header or dtype option is passed; in the future this will 
    become an error. Additionally, passing int or 'int' to set_data_dtype() 
    now raises an error, requiring an explicit numpy dtype to make 64-bit 
    integer images.
  * Drop support for Python 3.6, Numpy < 1.17
  * Fully removed the APIs, which have raised errors on use since 3.0
- Drop upstreamed 983.patch and purge-nose.patch

OBS-URL: https://build.opensuse.org/request/show/1008422
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-nibabel?expand=0&rev=17
2022-10-06 15:12:32 +00:00
Richard Brown
4eb796bd2c Accepting request 882372 from devel:languages:python:numeric
OBS-URL: https://build.opensuse.org/request/show/882372
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-nibabel?expand=0&rev=8
2021-04-01 12:17:52 +00:00
9516f1eeb7 Accepting request 882320 from home:Guillaume_G:branches:openSUSE:Backports:SLE-15-SP3:Staging:adi:32
- Add upstream patch to fix test on Backports:SLE-15-SP3:
  * 983.patch

OBS-URL: https://build.opensuse.org/request/show/882320
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-nibabel?expand=0&rev=15
2021-03-31 14:02:40 +00:00
9bf2227640 Accepting request 871459 from devel:languages:python:numeric
- skip python 36

OBS-URL: https://build.opensuse.org/request/show/871459
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-nibabel?expand=0&rev=7
2021-02-15 22:16:57 +00:00
8418a16ac1 - skip python 36
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-nibabel?expand=0&rev=13
2021-02-12 14:37:56 +00:00
187830d393 Accepting request 819969 from devel:languages:python:numeric
OBS-URL: https://build.opensuse.org/request/show/819969
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-nibabel?expand=0&rev=6
2020-07-10 13:32:19 +00:00
Tomáš Chvátal
82fbeb248f Accepting request 819962 from home:mcalabkova:branches:devel:languages:python:numeric
- Update to 3.1.1
  * Conformation function (``processing.conform``) and CLI tool
    (``nib-conform``) to apply shape, orientation and zooms (pr/853) (Jakub
    Kaczmarzyk, reviewed by CM, YOH)
  * Affine rescaling function (``affines.rescale_affine``) to update
    dimensions and voxel sizes (pr/853) (CM, reviewed by Jakub Kaczmarzyk)
  * ``kw_only_meth``/``kw_only_func`` decorators are deprecated (pr/848)
    (RM, reviewed by CM)
- Add patch purge-nose.patch

OBS-URL: https://build.opensuse.org/request/show/819962
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-nibabel?expand=0&rev=11
2020-07-10 10:49:44 +00:00
73cb25a0dc Accepting request 808042 from devel:languages:python:numeric
OBS-URL: https://build.opensuse.org/request/show/808042
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-nibabel?expand=0&rev=5
2020-05-26 15:20:23 +00:00
Tomáš Chvátal
71206d856a Accepting request 807985 from home:pgajdos:python
submit

OBS-URL: https://build.opensuse.org/request/show/807985
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-nibabel?expand=0&rev=9
2020-05-21 18:33:32 +00:00
77eebf496a Accepting request 782024 from devel:languages:python:numeric
- Update to 3.0.1:
  * Test failed by using array method on tuple. (pr/860) (Ben Darwin, reviewed by CM)
  * Validate ExpiredDeprecationErrors, promoted by 3.0 release from DeprecationWarnings. (pr/857) (CM)
  * Improve testing of data scaling in ArrayProxy API (pr/847) (CM, reviewed by Alejandro de la Vega)
  * Document SpatialImage.slicer interface (pr/846) (CM)
  * get_fdata(dtype=np.float32) will attempt to avoid casting data to np.float64 when scaling parameters would otherwise promote the data type unnecessarily. (pr/833) (CM, reviewed by Ross Markello)
  * ArraySequence now supports a large set of Python operators to combine or update in-place. (pr/811) (MC, reviewed by Serge Koudoro, Philippe Poulin, CM, MB)
  * Warn, rather than fail, on DICOMs with unreadable Siemens CSA tags (pr/818) (Henry Braun, reviewed by CM)
  * Improve clarity of coordinate system tutorial (pr/823) (Egor Panfilov, reviewed by MB)

OBS-URL: https://build.opensuse.org/request/show/782024
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-nibabel?expand=0&rev=4
2020-03-06 20:28:03 +00:00
Tomáš Chvátal
3c226998a8 - Update to 3.0.1:
* Test failed by using array method on tuple. (pr/860) (Ben Darwin, reviewed by CM)
  * Validate ExpiredDeprecationErrors, promoted by 3.0 release from DeprecationWarnings. (pr/857) (CM)
  * Improve testing of data scaling in ArrayProxy API (pr/847) (CM, reviewed by Alejandro de la Vega)
  * Document SpatialImage.slicer interface (pr/846) (CM)
  * get_fdata(dtype=np.float32) will attempt to avoid casting data to np.float64 when scaling parameters would otherwise promote the data type unnecessarily. (pr/833) (CM, reviewed by Ross Markello)
  * ArraySequence now supports a large set of Python operators to combine or update in-place. (pr/811) (MC, reviewed by Serge Koudoro, Philippe Poulin, CM, MB)
  * Warn, rather than fail, on DICOMs with unreadable Siemens CSA tags (pr/818) (Henry Braun, reviewed by CM)
  * Improve clarity of coordinate system tutorial (pr/823) (Egor Panfilov, reviewed by MB)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-nibabel?expand=0&rev=7
2020-03-06 08:26:30 +00:00
ec31392eac Accepting request 749762 from devel:languages:python:numeric
OBS-URL: https://build.opensuse.org/request/show/749762
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-nibabel?expand=0&rev=3
2019-11-20 09:28:41 +00:00
Todd R
278e27a6da Accepting request 749760 from home:TheBlackCat:branches:devel:languages:python:numeric
Update to version 2.5.1

OBS-URL: https://build.opensuse.org/request/show/749760
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-nibabel?expand=0&rev=5
2019-11-19 21:01:20 +00:00
f8b30fd84d Accepting request 719706 from devel:languages:python:numeric
OBS-URL: https://build.opensuse.org/request/show/719706
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-nibabel?expand=0&rev=2
2019-07-30 10:39:09 +00:00
Todd R
ab3c891557 Accepting request 719705 from home:TheBlackCat:branches:devel:languages:python:numeric
Add fix_numpy_1_17.patch to fix building with numpy 1.17.0

OBS-URL: https://build.opensuse.org/request/show/719705
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-nibabel?expand=0&rev=3
2019-07-29 19:29:24 +00:00
1d3a2b5125 Accepting request 718909 from devel:languages:python:numeric
Tool to access multiple neuroimaging data formats

OBS-URL: https://build.opensuse.org/request/show/718909
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-nibabel?expand=0&rev=1
2019-07-28 08:22:00 +00:00
Todd R
5945d807c9 Accepting request 718908 from home:TheBlackCat:branches:devel:languages:python:numeric
Tool to access multiple neuroimaging data formats

OBS-URL: https://build.opensuse.org/request/show/718908
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-nibabel?expand=0&rev=1
2019-07-26 14:53:49 +00:00
3 changed files with 0 additions and 99 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b6c80b2e728e4bc2b65f1142d9b8d2287a9102a8bf8477e115ef0d8334559975
size 4503320

View File

@@ -1,36 +0,0 @@
From 2bad8cce331976af3e8b42cecaed76bb075ee8b3 Mon Sep 17 00:00:00 2001
From: Chris Markiewicz <effigies@gmail.com>
Date: Tue, 5 Mar 2024 08:16:05 -0500
Subject: [PATCH] FIX: Use np.asarray instead of np.array(..., copy=False)
---
nibabel/affines.py | 2 +-
nibabel/casting.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/nibabel/affines.py b/nibabel/affines.py
index 05fdd7bb5..1478fd2dc 100644
--- a/nibabel/affines.py
+++ b/nibabel/affines.py
@@ -365,7 +365,7 @@ def rescale_affine(affine, shape, zooms, new_shape=None):
A new affine transform with the specified voxel sizes
"""
- shape = np.array(shape, copy=False)
+ shape = np.asarray(shape)
new_shape = np.array(new_shape if new_shape is not None else shape)
s = voxel_sizes(affine)
diff --git a/nibabel/casting.py b/nibabel/casting.py
index f3e04f30f..09015135f 100644
--- a/nibabel/casting.py
+++ b/nibabel/casting.py
@@ -611,7 +611,7 @@ def int_abs(arr):
>>> int_abs(np.array([-128, 127], dtype=np.float32))
array([128., 127.], dtype=float32)
"""
- arr = np.array(arr, copy=False)
+ arr = np.asarray(arr)
dt = arr.dtype
if dt.kind == 'u':
return arr

View File

@@ -1,60 +0,0 @@
From 82c8588528d5a06fd0dfc99e3cbb83d5cc299e2b Mon Sep 17 00:00:00 2001
From: Sandro <devel@penguinpee.nl>
Date: Wed, 29 May 2024 00:20:34 +0200
Subject: [PATCH] Replace deprecated setup() and teardown()
Those were compatibility functions for porting from nose. They are now
deprecated and have been removed from pytest.
This will make all tests compatible with pytests 8.x.
---
nibabel/streamlines/tests/test_streamlines.py | 2 +-
nibabel/tests/test_deprecated.py | 4 ++--
nibabel/tests/test_dft.py | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/nibabel/streamlines/tests/test_streamlines.py b/nibabel/streamlines/tests/test_streamlines.py
index f0bd9c7c4..53a43c393 100644
--- a/nibabel/streamlines/tests/test_streamlines.py
+++ b/nibabel/streamlines/tests/test_streamlines.py
@@ -20,7 +20,7 @@
DATA = {}
-def setup():
+def setup_module():
global DATA
DATA['empty_filenames'] = [pjoin(data_path, 'empty' + ext) for ext in FORMATS.keys()]
DATA['simple_filenames'] = [pjoin(data_path, 'simple' + ext) for ext in FORMATS.keys()]
diff --git a/nibabel/tests/test_deprecated.py b/nibabel/tests/test_deprecated.py
index f1c3d517c..01636632e 100644
--- a/nibabel/tests/test_deprecated.py
+++ b/nibabel/tests/test_deprecated.py
@@ -14,12 +14,12 @@
from nibabel.tests.test_deprecator import TestDeprecatorFunc as _TestDF
-def setup():
+def setup_module():
# Hack nibabel version string
pkg_info.cmp_pkg_version.__defaults__ = ('2.0',)
-def teardown():
+def teardown_module():
# Hack nibabel version string back again
pkg_info.cmp_pkg_version.__defaults__ = (pkg_info.__version__,)
diff --git a/nibabel/tests/test_dft.py b/nibabel/tests/test_dft.py
index 654af9827..6c6695b16 100644
--- a/nibabel/tests/test_dft.py
+++ b/nibabel/tests/test_dft.py
@@ -26,7 +26,7 @@
data_dir = pjoin(dirname(__file__), 'data')
-def setUpModule():
+def setup_module():
if os.name == 'nt':
raise unittest.SkipTest('FUSE not available for windows, skipping dft tests')
if not have_dicom: