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

Too many IDs reported in validation rule none_missing #902

Open
mgovers opened this issue Feb 18, 2025 · 0 comments · May be fixed by #907
Open

Too many IDs reported in validation rule none_missing #902

mgovers opened this issue Feb 18, 2025 · 0 comments · May be fixed by #907
Assignees
Labels
bug Something isn't working

Comments

@mgovers
Copy link
Member

mgovers commented Feb 18, 2025

https://github.com/PowerGridModel/power-grid-model/blob/f4927bf94b6b32790400f596f8103195aa6689fe/src/power_grid_model/validation/rules.py#L757C1-L757C18

While using this function for the new asym_line input validation function I ran into a potential issue (or my misterpretation of this function).

Consider the following input data for aym_line:

asym_line = initialize_array(DatasetType.input, ComponentType.asym_line, 2)
asym_line["id"] = [55, 56]
asym_line["from_node"] = [0, 1]
asym_line["to_node"] = [1, 2]
asym_line["from_status"] = [1, 1]
asym_line["to_status"] = [1, 1]
asym_line["r_aa"] = [-1, 2]
asym_line["r_ba"] = [-1, 2]
asym_line["r_bb"] = [-1, 2]
asym_line["r_ca"] = [-1, 2]
asym_line["r_cb"] = [-1, 2]
asym_line["r_cc"] = [-1, 2]
asym_line["r_na"] = [-1, 2]
asym_line["r_nb"] = [-1, 2]
asym_line["r_nc"] = [-1, 2]
asym_line["r_nn"] = [-1, 2]
asym_line["x_aa"] = [-1, 2]
asym_line["x_ba"] = [-1, 2]
asym_line["x_bb"] = [-1, 2]
asym_line["x_ca"] = [-1, 2]
asym_line["x_cb"] = [-1, 2]
asym_line["x_cc"] = [-1, 2]
asym_line["x_na"] = [-1, 2]
asym_line["x_nb"] = [-1, 2]
asym_line["x_nc"] = [-1, 2]
asym_line["x_nn"] = [-1, 2]
asym_line["c_aa"] = [-1, np.nan]
asym_line["c_ba"] = [-1, np.nan]
asym_line["c_bb"] = [-1, np.nan]
asym_line["c_ca"] = [-1, np.nan]
asym_line["c_cb"] = [-1, np.nan]
asym_line["c_cc"] = [-1, np.nan]
asym_line["c_na"] = [-1, np.nan]
asym_line["c_nb"] = [-1, np.nan]
asym_line["c_nc"] = [-1, np.nan]
asym_line["c_nn"] = [-1, np.nan]
asym_line["c0"]   = [-1, np.nan]
asym_line["c1"]   = [-1, np.nan]
asym_line["i_n"] =  [50, 50]

by calling the none_missing function as follows:

none_missing(data, ComponentType.asym_line, ["c_aa", "c_ba"], 1)

I would expect the function to return two `MissingValueError' instances that look like this:

MissingValueError(component=ComponentType.asym_line, field="c_aa", ids=[56])
MissingValueError(component=ComponentType.asym_line, field="c_ba", ids=[56])

Because this is the component at index 1 with id 56 and has missing values for the fields c_aa and c_ba.
However when I use this function in my validation function I get the following output:

MissingValueError(component=ComponentType.asym_line, field="c_aa", ids=[55, 56])
MissingValueError(component=ComponentType.asym_line, field="c_ba", ids=[55, 56])

This is unexpected as id 55 does not have a missing value for c_aa and c_ba.
[EDIT @mgovers ]: This is a bug

Originally posted by @leovsch in #762 (comment)

@mgovers mgovers added the bug Something isn't working label Feb 18, 2025
@mgovers mgovers moved this to Q1 2025 in Power Grid Model Feb 18, 2025
@mgovers mgovers self-assigned this Feb 18, 2025
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: Q1 2025
Development

Successfully merging a pull request may close this issue.

1 participant