Skip to content

Commit

Permalink
Addressed comments
Browse files Browse the repository at this point in the history
Signed-off-by: Santiago Figueroa Manrique <santiago.figueroa.manrique@alliander.com>
  • Loading branch information
figueroa1395 committed Sep 25, 2024
1 parent 291b134 commit 48434b7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/power_grid_model/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion src/power_grid_model/validation/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/validation/test_batch_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/validation/test_input_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down

0 comments on commit 48434b7

Please sign in to comment.