Closed Crola1702 closed 2 years ago
Reference build: Nightly Windows Debug
Log output:
> assert numpy.array_equal(arr_of_float32_with_nan, msg.float32_values, equal_nan=True) C:\ci\ws\src\ros2\rosidl_python\rosidl_generator_py\test\test_interfaces.py:508: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (array([-1.33, nan, 1.33], dtype=float32), array([-1.33, nan, 1.33], dtype=float32)) kwargs = {'equal_nan': True} > ??? E TypeError: _array_equal_dispatcher() got an unexpected keyword argument 'equal_nan' <__array_function__ internals>:4: TypeError
The proposed solution changes this test behavior to support both numpy <= 1.18 and >= 1.19.
Selected implementation: https://github.com/rossbar/numpy/blob/main/numpy/core/numeric.py#L2475
asarray(a1[~a1nan] == a2[~a1nan]).all() # plus shape verification
Windows build: Linux aarch64 build: Linux build:
Do you think this approach is OK? @sloretz (tagging you as reviewer of the original PR)
@mergify backport humble
backport humble
@Mergifyio backport humble
:fly: BugFix
Issue
Reference build: Nightly Windows Debug
Log output:
Investigation
The proposed solution changes this test behavior to support both numpy <= 1.18 and >= 1.19.
Selected implementation: https://github.com/rossbar/numpy/blob/main/numpy/core/numeric.py#L2475
Windows build: Linux aarch64 build: Linux build: