Skip to content

Commit cabecae

Browse files
authored
Copy in BitRound (#608)
1 parent 85eb7aa commit cabecae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

numcodecs/bitround.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ def encode(self, buf):
5959
return a
6060
if self.keepbits > bits:
6161
raise ValueError("Keepbits too large for given dtype")
62-
b = a.view(a_int_dtype)
62+
b = a.copy()
63+
b = b.view(a_int_dtype)
6364
maskbits = bits - self.keepbits
6465
mask = (all_set >> maskbits) << maskbits
6566
half_quantum1 = (1 << (maskbits - 1)) - 1

0 commit comments

Comments
 (0)