Skip to content

Commit 1626cfb

Browse files
committed
RF: Deprecate ArrayProxy.header to be removed in 3.0
1 parent 0c62d74 commit 1626cfb

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

nibabel/arrayproxy.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@
2525
2626
See :mod:`nibabel.tests.test_proxy_api` for proxy API conformance checks.
2727
"""
28-
import warnings
29-
3028
import numpy as np
3129

30+
from .deprecated import deprecate_with_version
3231
from .volumeutils import array_from_file, apply_read_scaling
3332
from .fileslice import fileslice
3433
from .keywordonly import kw_only_meth
@@ -130,10 +129,8 @@ def __init__(self, file_like, spec, mmap=True):
130129
self._mmap = mmap
131130

132131
@property
132+
@deprecate_with_version('ArrayProxy.header deprecated', '2.2', '3.0')
133133
def header(self):
134-
warnings.warn('We will remove the header property from proxies soon',
135-
FutureWarning,
136-
stacklevel=2)
137134
return self._header
138135

139136
@property

nibabel/tests/test_proxy_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def validate_deprecated_header(self, pmaker, params):
288288
# Header is a copy of original
289289
assert_false(prox.header is hdr)
290290
assert_equal(prox.header, hdr)
291-
assert_equal(warns.pop(0).category, FutureWarning)
291+
assert_equal(warns.pop(0).category, DeprecationWarning)
292292

293293

294294
class TestSpm99AnalyzeProxyAPI(TestAnalyzeProxyAPI):

0 commit comments

Comments
 (0)