Skip to content

Commit aa0b210

Browse files
committed
a few more
Signed-off-by: Santiago Figueroa Manrique <[email protected]>
1 parent a2d0602 commit aa0b210

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

tests/validation/converters/test_pandapower_converter_input.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import pandas as pd
1111
import pytest
12+
from power_grid_model import DatasetType
1213
from power_grid_model.data_types import SingleDataset
1314

1415
from power_grid_model_io.converters import PandaPowerConverter
@@ -72,7 +73,7 @@ def test_input_data(input_data: Tuple[SingleDataset, SingleDataset]):
7273
assert len(expected) <= len(actual)
7374

7475

75-
@pytest.mark.parametrize(("component", "attribute"), component_attributes(VALIDATION_FILE, data_type="input"))
76+
@pytest.mark.parametrize(("component", "attribute"), component_attributes(VALIDATION_FILE, data_type=DatasetType.input))
7677
def test_attributes(input_data: Tuple[SingleDataset, SingleDataset], component: str, attribute: str):
7778
"""
7879
For each attribute, check if the actual values are consistent with the expected values

tests/validation/converters/test_vision_excel_converter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import numpy as np
1212
import pandas as pd
1313
import pytest
14+
from power_grid_model import DatasetType
1415
from power_grid_model.data_types import SingleDataset
1516

1617
from power_grid_model_io.converters import VisionExcelConverter
@@ -110,7 +111,7 @@ def test_input_data_custom_yaml():
110111
assert len(expected) <= len(actual)
111112

112113

113-
@pytest.mark.parametrize(("component", "attribute"), component_attributes(VALIDATION_EN, data_type="input"))
114+
@pytest.mark.parametrize(("component", "attribute"), component_attributes(VALIDATION_EN, data_type=DatasetType.input))
114115
@pytest.mark.parametrize("input_data", LANGUAGES, indirect=True)
115116
def test_attributes(input_data: Tuple[SingleDataset, SingleDataset], component: str, attribute: str):
116117
"""

tests/validation/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import numpy as np
1212
import pandas as pd
13-
from power_grid_model import power_grid_meta_data
13+
from power_grid_model import DatasetType, power_grid_meta_data
1414
from power_grid_model.data_types import SingleDataset, SinglePythonDataset
1515
from power_grid_model.errors import PowerGridSerializationError
1616
from power_grid_model.utils import import_json_data, json_deserialize_from_file
@@ -52,7 +52,7 @@ def component_objects(json_path: Path) -> Generator[Tuple[str, List[int]], None,
5252
yield component, obj_ids
5353

5454

55-
def component_attributes(json_path: Path, data_type: str) -> Generator[Tuple[str, str], None, None]:
55+
def component_attributes(json_path: Path, data_type: DatasetType) -> Generator[Tuple[str, str], None, None]:
5656
"""
5757
Read the json file (only the structure is used, i.e. the component names and attribute name)
5858

0 commit comments

Comments
 (0)