Skip to content

Commit 527023c

Browse files
authored
Merge branch 'main' into finch-tensor-update
2 parents 36d7eb4 + 669d423 commit 527023c

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ jobs:
77
matrix:
88
os: [ubuntu-latest]
99
python: ['3.10', '3.11', '3.12']
10+
pip_opts: ['']
1011
numba_boundscheck: [0]
1112
include:
1213
- os: macos-latest
@@ -16,6 +17,8 @@ jobs:
1617
- os: ubuntu-latest
1718
python: '3.10'
1819
numba_boundscheck: 1
20+
- os: ubuntu-latest
21+
pip_opts: "--pre -U"
1922
fail-fast: false
2023
runs-on: ${{ matrix.os }}
2124
env:
@@ -47,6 +50,7 @@ jobs:
4750
- name: Install package
4851
run: |
4952
pip install -e .[tests]
53+
pip install ${{ matrix.pip_opts }} numpy numba
5054
- name: Run tests
5155
run: |
5256
pytest --pyargs sparse

sparse/numba_backend/_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1876,7 +1876,7 @@ def asnumpy(a, dtype=None, order=None):
18761876

18771877
if isinstance(a, SparseArray):
18781878
a = a.todense()
1879-
return np.array(a, dtype=dtype, copy=False, order=order)
1879+
return np.asarray(a, dtype=dtype, order=order)
18801880

18811881

18821882
# this code was taken from numpy.moveaxis

sparse/numba_backend/_coo/common.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -744,8 +744,6 @@ def roll(a, shift, axis=None):
744744
res : ndarray
745745
Output array, with the same shape as a.
746746
"""
747-
from numpy.core._exceptions import UFuncTypeError
748-
749747
from .core import COO, as_coo
750748

751749
a = as_coo(a)
@@ -786,7 +784,7 @@ def roll(a, shift, axis=None):
786784
for sh, ax in zip(shift, axis, strict=True):
787785
coords[ax] += sh
788786
coords[ax] %= a.shape[ax]
789-
except UFuncTypeError as e:
787+
except TypeError as e:
790788
if is_unsigned_dtype(coords.dtype):
791789
raise ValueError(
792790
f"rolling with coords.dtype as {coords.dtype} is not safe. Try using a signed dtype."

sparse/numba_backend/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ def can_store(dtype, scalar):
622622
warnings.simplefilter("ignore")
623623
warnings.filterwarnings("error", "out-of-bound", DeprecationWarning)
624624
return np.array(scalar, dtype=dtype) == np.array(scalar)
625-
except ValueError:
625+
except (ValueError, OverflowError):
626626
return False
627627

628628

0 commit comments

Comments
 (0)