Skip to content

Commit 5e57ec5

Browse files
authored
Eliminate numpy 2.5 DeprecationWarning on array dtype modification (#366)
1 parent 08c3c17 commit 5e57ec5

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

nptdms/types.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,7 @@ def read(cls, file, endianness="<"):
105105
def from_bytes(cls, byte_array, endianness="<"):
106106
""" Convert an array of bytes into a numpy array of data
107107
"""
108-
array = byte_array.view()
109-
array.dtype = cls.nptype.newbyteorder(endianness)
110-
return array
108+
return byte_array.view(cls.nptype.newbyteorder(endianness))
111109

112110

113111
@tds_data_type(0, None)

0 commit comments

Comments
 (0)