Skip to content

Commit 1ab8d58

Browse files
committed
Keep old ArraySequence.data behavior but make the view read-only.
1 parent 1b1f516 commit 1ab8d58

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

nibabel/streamlines/array_sequence.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

22
import numbers
3-
import warnings
43
from operator import mul
54
from functools import reduce
65

@@ -156,7 +155,9 @@ def total_nb_rows(self):
156155
'3.0', '4.0')
157156
def data(self):
158157
""" Elements in this array sequence. """
159-
return self.get_data()
158+
view = self._data.view()
159+
view.setflags(write=False)
160+
return view
160161

161162
def get_data(self):
162163
""" Returns a *copy* of the elements in this array sequence.

0 commit comments

Comments
 (0)