Skip to content

Commit 3523024

Browse files
committed
Add test for array_equal_with_nan
Signed-off-by: Thijs Baaijen <[email protected]>
1 parent 0a40a2a commit 3523024

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/unit/utils/test_misc.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import numpy as np
66

7-
from power_grid_model_ds._core.utils.misc import is_sequence
7+
from power_grid_model_ds._core.utils.misc import array_equal_with_nan, is_sequence
88

99
# pylint: disable=missing-function-docstring
1010

@@ -31,3 +31,9 @@ def test_dict_is_not_a_sequence():
3131

3232
def test_string_is_not_a_sequence():
3333
assert not is_sequence("abc")
34+
35+
36+
def test_array_equal_with_nan():
37+
array1 = np.array([(1, 2.0, "a"), (3, np.nan, "b")], dtype=[("col1", "i4"), ("col2", "f4"), ("col3", "U1")])
38+
array2 = np.array([(1, 2.0, "a"), (3, np.nan, "b")], dtype=[("col1", "i4"), ("col2", "f4"), ("col3", "U1")])
39+
assert array_equal_with_nan(array1, array2)

0 commit comments

Comments
 (0)