From 48434b752f1d84fcb3578e473b95b5ff66d1cf7f Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Wed, 25 Sep 2024 09:21:46 +0200 Subject: [PATCH] Addressed comments Signed-off-by: Santiago Figueroa Manrique --- src/power_grid_model/_utils.py | 2 +- src/power_grid_model/validation/validation.py | 3 ++- tests/unit/validation/test_batch_validation.py | 2 +- tests/unit/validation/test_input_validation.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/power_grid_model/_utils.py b/src/power_grid_model/_utils.py index 37aac44d0..764e37c40 100644 --- a/src/power_grid_model/_utils.py +++ b/src/power_grid_model/_utils.py @@ -310,7 +310,7 @@ def compatibility_convert_row_columnar_dataset( """Temporary function to transform row, column or mixed based datasets to a full row or column based dataset as per the data_filter. The purpose of this function is to mimic columnar data and transform back to row data without any memory footprint benefits. - Note: Copies are made in a per-component basis; if a component is row based in both the input and the requested + Note: Copies are made on a per-component basis; if a component is row based in both the input and the requested output, that componened is returned without a copy. Args: diff --git a/src/power_grid_model/validation/validation.py b/src/power_grid_model/validation/validation.py index 850ef07e5..d05afe667 100644 --- a/src/power_grid_model/validation/validation.py +++ b/src/power_grid_model/validation/validation.py @@ -136,7 +136,8 @@ def validate_batch_data( input_errors: list[ValidationError] = list(validate_unique_ids_across_components(input_data)) # Convert to row based if in columnar format - # TODO(figueroa1395): transform to columnar per single batch once the columnar dataset python extension is finished + # TODO(figueroa1395): transform to columnar per single batch scenario once the columnar dataset python extension + # is finished row_update_data = compatibility_convert_row_columnar_dataset(update_data, None, DatasetType.update) # Splitting update_data_into_batches may raise TypeErrors and ValueErrors diff --git a/tests/unit/validation/test_batch_validation.py b/tests/unit/validation/test_batch_validation.py index 5636914fa..ca9e55a1d 100644 --- a/tests/unit/validation/test_batch_validation.py +++ b/tests/unit/validation/test_batch_validation.py @@ -56,7 +56,7 @@ def original_batch_data() -> dict[str, np.ndarray]: @pytest.fixture def original_batch_data_columnar(original_batch_data): - return compatibility_convert_row_columnar_dataset(original_batch_data, ..., DatasetType.update) + return compatibility_convert_row_columnar_dataset(original_batch_data, Ellipsis, DatasetType.update) @pytest.fixture(params=["original_batch_data", "original_batch_data_columnar"]) diff --git a/tests/unit/validation/test_input_validation.py b/tests/unit/validation/test_input_validation.py index 36aa038f8..5f4e041b1 100644 --- a/tests/unit/validation/test_input_validation.py +++ b/tests/unit/validation/test_input_validation.py @@ -277,7 +277,7 @@ def original_data() -> dict[ComponentType, np.ndarray]: @pytest.fixture def original_data_columnar(original_data): - return compatibility_convert_row_columnar_dataset(original_data, ..., DatasetType.input) + return compatibility_convert_row_columnar_dataset(original_data, Ellipsis, DatasetType.input) @pytest.fixture(params=["original_data", "original_data_columnar"])