Skip to content

Commit d1723f4

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

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
@@ -1542,7 +1542,7 @@ def __binsparse__(self) -> tuple[dict, list[np.ndarray]]:
15421542

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

0 commit comments

Comments
 (0)