[BUG] Validation fails for a configuration without three winding transformers
Closed this issue · 5 comments
Describe the bug
I get an KeyError: <ComponentType.three_winding_transformer: 'three_winding_transformer'> when validating a configuration that does not have any three_winding_transformers
.
To Reproduce
del input_data["three_winding_transformer"]
assert_valid_input_data(input_data)
Expected behavior
I think it should be possible to validate an input_data object without three_winding_transformer?
Additional context
Can be solved by changing:
power-grid-model/src/power_grid_model/validation/rules.py
Lines 919 to 923 in b1903af
into:
for ref_component, ref_field in tap_side_fields:
if data.get("ref_component", False):
indices = get_indexer(data[ref_component]["id"], data[component][regulated_object_field], default_value=-1)
found = indices != -1
ref_comp_values = data[ref_component][ref_field][indices[found]]
invalid[found] = np.logical_or(invalid[found], values[found] == ref_comp_values)
Hi @wfjvdham ,
Thank you for reporting.
I will investigate and will get back to you as soon as I have an update.
Cool! Thanks for the quick response
FYI @wfjvdham , the fix in #670 has been merged, but it may take up til an hour from now until CI finishes and v1.9.4
containing the fix is released.
- If you are using PyPI, the release will be available using
pip install
or equivalent immediately after the release. - If you are using
conda-forge
, then it may take up to 18 hours before it becomes available if everything goes correctly.