Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Validation fails for a configuration without three winding transformers #669

Closed
wfjvdham opened this issue Jul 9, 2024 · 5 comments · Fixed by #670 or #671
Closed

[BUG] Validation fails for a configuration without three winding transformers #669

wfjvdham opened this issue Jul 9, 2024 · 5 comments · Fixed by #670 or #671
Assignees
Labels
bug Something isn't working

Comments

@wfjvdham
Copy link

wfjvdham commented Jul 9, 2024

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:

for ref_component, ref_field in tap_side_fields:
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)

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)
@wfjvdham wfjvdham added the bug Something isn't working label Jul 9, 2024
@mgovers
Copy link
Member

mgovers commented Jul 9, 2024

Hi @wfjvdham ,

Thank you for reporting.

I will investigate and will get back to you as soon as I have an update.

mgovers added a commit that referenced this issue Jul 9, 2024
…data

Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
@mgovers
Copy link
Member

mgovers commented Jul 9, 2024

Hi @wfjvdham ,

After a very quick investigation, I verified that this indeed a bug and your proposal is the right way to go to fix the issue (with some minor adjustments). Thank you for your clear and elaborate input. The fix is proposed in #670 .

We will merge this ASAP.

@wfjvdham
Copy link
Author

wfjvdham commented Jul 9, 2024

Cool! Thanks for the quick response

@mgovers mgovers moved this to Q2 2024 in Power Grid Model Jul 9, 2024
@mgovers mgovers moved this from Q2 2024 to Q3 2024 in Power Grid Model Jul 9, 2024
@mgovers mgovers self-assigned this Jul 9, 2024
github-merge-queue bot pushed a commit that referenced this issue Jul 9, 2024
…without-other-trafo-type

fix #669 transformer tap regulator without other transformer type in data
@mgovers
Copy link
Member

mgovers commented Jul 9, 2024

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.

@mgovers
Copy link
Member

mgovers commented Jul 9, 2024

Closely related follow-up found in #671 . A fix will be available in a couple hours (most likely v1.9.5)

@mgovers mgovers reopened this Jul 9, 2024
@mgovers mgovers mentioned this issue Nov 5, 2024
27 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Q3 2024
2 participants