|
13 | 13 | from power_grid_model_ds._core.model.arrays.base.array import FancyArray |
14 | 14 | from power_grid_model_ds._core.model.arrays.pgm_arrays import LineArray, TransformerArray |
15 | 15 | from power_grid_model_ds._core.model.constants import EMPTY_ID, empty |
| 16 | +from power_grid_model_ds._core.utils.misc import array_equal_with_nan |
16 | 17 | from tests.conftest import FancyTestArray |
17 | 18 | from tests.fixtures.arrays import ExtendedLineArray, FancyTestArray3 |
18 | 19 |
|
@@ -292,7 +293,13 @@ def test_overflow_value(): |
292 | 293 |
|
293 | 294 |
|
294 | 295 | def test_from_extended_array(): |
295 | | - extended_array = ExtendedLineArray.zeros(2) |
| 296 | + extended_array = ExtendedLineArray.empty(3) |
| 297 | + extended_array.id = [1, 2, 3] |
| 298 | + extended_array.from_node = [4, 5, 6] |
| 299 | + extended_array.to_node = [7, 8, 9] |
| 300 | + extended_array.from_status = [1, 0, 1] |
| 301 | + extended_array.from_status = [0, 1, 0] |
| 302 | + |
296 | 303 | array = LineArray.from_extended(extended_array) |
297 | 304 | assert not isinstance(array, ExtendedLineArray) |
298 | | - assert_array_equal(array.data, extended_array[array.columns]) |
| 305 | + array_equal_with_nan(array.data, extended_array[array.columns]) |
0 commit comments