Skip to content

Commit f5eee86

Browse files
committed
ENH: Add copy() method to ArrayProxy
1 parent 41e6dad commit f5eee86

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

nibabel/arrayproxy.py

+9
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,15 @@ def __init__(self, file_like, spec, *, mmap=True, order=None, keep_file_open=Non
217217
)
218218
self._lock = RLock()
219219

220+
def copy(self):
221+
spec = self._shape, self._dtype, self._offset, self._slope, self._inter
222+
return ArrayProxy(
223+
self.file_like,
224+
spec,
225+
mmap=self._mmap,
226+
keep_file_open=self._keep_file_open,
227+
)
228+
220229
def __del__(self):
221230
"""If this ``ArrayProxy`` was created with ``keep_file_open=True``,
222231
the open file object is closed if necessary.

0 commit comments

Comments
 (0)