From 581598c2199f7e12dde69fe6e933d735f0c533d3 Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauldmccarthy@gmail.com> Date: Sat, 21 Oct 2017 14:37:36 +0100 Subject: [PATCH] A warning should be printed when running against nibabel 2.1.0 --- fsl/data/image.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fsl/data/image.py b/fsl/data/image.py index 9b5d6bd57..0ec4fb103 100644 --- a/fsl/data/image.py +++ b/fsl/data/image.py @@ -1396,6 +1396,9 @@ def loadIndexedImageFile(filename): return image, fobj +@deprecation.deprecated(deprecated_in='1.3.0', + removed_in='2.0.0', + details='Upgrade to nibabel 2.2.0') def read_segments(fileobj, segments, n_bytes): """This function is used in place of the ``nibabel.fileslice.read_segments`` function to ensure thread-safe read @@ -1411,6 +1414,9 @@ def read_segments(fileobj, segments, n_bytes): This implementation protects the seek/read pairs with a ``threading.Lock``, which is added to ``IndexedGzipFile`` instances that are created in the :func:`loadIndexedImageFile` function. + + .. note:: This patch is not required in nibabel 2.2.0 and newer. It will + be removed from ``fslpy`` in version 2.0.0. """ from mmap import mmap -- GitLab