Skip to content

Commit edaa60e

Browse files
committed
Fix bug where dtype.itemsize was assumed to be in bits rather than bytes.
1 parent 00aaebd commit edaa60e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sparse/numba_backend/_compressed/compressed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ def __binsparse__(self) -> tuple[dict, list[np.ndarray]]:
894894

895895
data_dt = str(self.data.dtype)
896896
if np.issubdtype(data_dt, np.complexfloating):
897-
data_dt = f"complex[float{self.data.dtype.itemsize // 2}]"
897+
data_dt = f"complex[float{self.data.dtype.itemsize * 4}]"
898898
descriptor = {
899899
"binsparse": {
900900
"version": "0.1",

sparse/numba_backend/_coo/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1543,7 +1543,7 @@ def __binsparse__(self) -> tuple[dict, list[np.ndarray]]:
15431543

15441544
data_dt = str(self.data.dtype)
15451545
if np.issubdtype(data_dt, np.complexfloating):
1546-
data_dt = f"complex[float{self.data.dtype.itemsize // 2}]"
1546+
data_dt = f"complex[float{self.data.dtype.itemsize * 4}]"
15471547
descriptor = {
15481548
"binsparse": {
15491549
"version": "0.1",

0 commit comments

Comments
 (0)