Skip to content

Commit

Permalink
Python 3.8 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
vabor112 committed Oct 24, 2024
1 parent 50caf1b commit b84b03f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions geometric_kernels/lab_extras/numpy/sparse_extras.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys

import lab as B
import scipy
import scipy.sparse as sp
Expand All @@ -11,10 +13,13 @@
SparseArray defines a lab data type that covers all possible sparse
scipy arrays, so that multiple dispatch works with such arrays.
"""
SparseArray = Union[
sp.sparray,
sp.spmatrix,
]
if sys.version_info[:2] <= (3, 9):
SparseArray = sp.spmatrix
else:
SparseArray = Union[
sp.sparray,
sp.spmatrix,
]


@dispatch
Expand Down

0 comments on commit b84b03f

Please sign in to comment.