diff --git a/setup.cfg b/setup.cfg index 90cc2f5..dfd9804 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,7 +30,7 @@ packages = trsfile.engine trsfile.converters install_requires = - numpy>=1,<2 + numpy>=2 include_package_data = True [options.extras_require] diff --git a/tests/test_parameter.py b/tests/test_parameter.py index 45636a9..c11abfa 100644 --- a/tests/test_parameter.py +++ b/tests/test_parameter.py @@ -1,7 +1,8 @@ from io import BytesIO from unittest import TestCase -from numpy import ndarray, int16, array, int32, int64, single, double, uint8, int8, uint16, bool8 +from numpy import ndarray, int16, array, int32, int64, single, double, uint8, int8, uint16 +from numpy import bool as bool8 from trsfile.traceparameter import BooleanArrayParameter, ByteArrayParameter, DoubleArrayParameter, FloatArrayParameter, \ IntegerArrayParameter, ShortArrayParameter, LongArrayParameter, StringParameter @@ -47,7 +48,7 @@ def test_byte_parameter(self): ByteArrayParameter([0, '1']) with self.assertRaises(TypeError): ByteArrayParameter([bytes([0, 1, 2, 3]), bytes([4, 5, 6, 7])]) - with self.assertRaises(TypeError): + with self.assertRaises(OverflowError): ByteArrayParameter(ndarray(shape=[16], dtype=int8, buffer=array([int8(val) for val in int_data]))) with self.assertRaises(TypeError): ByteArrayParameter(ndarray(shape=[16], dtype=uint16, buffer=array([uint16(val) for val in int_data]))) diff --git a/trsfile/traceparameter.py b/trsfile/traceparameter.py index 494115d..0e83f15 100644 --- a/trsfile/traceparameter.py +++ b/trsfile/traceparameter.py @@ -7,7 +7,8 @@ from io import BytesIO from typing import Any -from numpy import ndarray, integer, bool8, uint8, double, single +from numpy import ndarray, integer, uint8, double, single +from numpy import bool as bool8 from trsfile.utils import encode_as_short, read_short