Closed bkeryan closed 1 month ago
Only the tests for the unsigned integer types are failing. The tests for signed integer types still pass.
This seems to be due to https://numpy.org/devdocs/numpy_2_0_migration_guide.html#changes-to-numpy-data-type-promotion
Calling numpy._set_promotion_state("weak_and_warn")
produces more descriptive warnings:
tests/component/test_stream_readers_ai.py::test___analog_unscaled_reader___read_uint16___returns_valid_samples[library_init_kwargs]
tests/component/test_stream_readers_ai.py::test___analog_unscaled_reader___read_uint16___returns_valid_samples[grpc_init_kwargs]
D:\dev\nidaqmx-python\.venv\lib\site-packages\_pytest\python_api.py:457: UserWarning: result dtype changed due to the removal of value-based promotion from NumPy. Changed from int32 to uint16.
result: bool = abs(self.expected - actual) <= self.tolerance # type: ignore[arg-type]
tests/component/test_stream_readers_ai.py::test___analog_unscaled_reader___read_uint32___returns_valid_samples[library_init_kwargs]
tests/component/test_stream_readers_ai.py::test___analog_unscaled_reader___read_uint32___returns_valid_samples[grpc_init_kwargs]
D:\dev\nidaqmx-python\.venv\lib\site-packages\_pytest\python_api.py:457: UserWarning: result dtype changed due to the removal of value-based promotion from NumPy. Changed from int64 to uint32.
result: bool = abs(self.expected - actual) <= self.tolerance # type: ignore[arg-type]
The tests pass with numpy._set_promotion_state("legacy")
After upgrading to NumPy 2.0, I get the following test failures:
Details (the other 3 are similar)
There are also some warnings: