Skip to content

Commit 275618e

Browse files
committed
fix version string parsing
1 parent 9720066 commit 275618e

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

quantities/dimensionality.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
from .registry import unit_registry
1010
from .decorators import memoize
1111

12-
_np_version = tuple(map(int, np.__version__.split('.')))
12+
_np_version = tuple(map(int, np.__version__.split(".dev")[0].split(".")))
13+
1314

1415
def assert_isinstance(obj, types):
1516
try:

quantities/quantity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def __array_prepare__(self, obj, context=None):
291291
return res
292292

293293
def __array_wrap__(self, obj, context=None, return_scalar=False):
294-
_np_version = tuple(map(int, np.__version__.split('.')))
294+
_np_version = tuple(map(int, np.__version__.split(".dev")[0].split(".")))
295295
# For NumPy < 2.0 we do old behavior
296296
if _np_version < (2, 0, 0):
297297
if not isinstance(obj, Quantity):

quantities/tests/test_umath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from .. import units as pq
44
from .common import TestCase, unittest
55

6-
_np_version = tuple(map(int, np.__version__.split('.')))
6+
_np_version = tuple(map(int, np.__version__.split(".dev")[0].split(".")))
77

88

99
class TestUmath(TestCase):

0 commit comments

Comments
 (0)