Skip to content

Commit

Permalink
Merge pull request #854 from PowerGridModel/bug/sparse-matrix-error-m…
Browse files Browse the repository at this point in the history
…ore-repro

Sparse matrix error: more complete repro case
  • Loading branch information
TonyXiang8787 authored Dec 9, 2024
2 parents 266623e + 6c74e26 commit 45cc5f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
{"id": 4, "node": 1, "status": 1, "type": 0, "p_specified": 9, "q_specified": 0}
],
"sym_power_sensor": [
{"id": 5, "measured_object": 3, "measured_terminal_type": 2, "power_sigma": 1, "p_measured": 10, "q_measured": 0}
{"id": 5, "measured_object": 3, "measured_terminal_type": 2, "power_sigma": 1, "p_measured": 10, "q_measured": 0},
{"id": 9, "measured_object": 8, "measured_terminal_type": 0, "power_sigma": 1, "p_measured": 0, "q_measured": 0}
],
"sym_voltage_sensor": [
{"id": 6, "measured_object": 0, "u_sigma": 1, "u_measured": 10}
Expand Down
14 changes: 8 additions & 6 deletions tests/unit/validation/test_input_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,14 @@ def original_data() -> dict[ComponentType, np.ndarray]:
asym_voltage_sensor = initialize_array(DatasetType.input, ComponentType.asym_voltage_sensor, 4)
asym_voltage_sensor["id"] = [7, 8, 9, 10]
asym_voltage_sensor["measured_object"] = [2, 3, 1, 200]
asym_voltage_sensor["u_measured"] = [
[10.5e3, 10.4e3, 10.6e3],
[np.nan, np.nan, np.nan],
[0, 0, 0],
[-1e4, 1e4, 1e4],
]
asym_voltage_sensor["u_measured"] = np.array(
[
[10.5e3, 10.4e3, 10.6e3],
[np.nan, np.nan, np.nan],
[0, 0, 0],
[-1e4, 1e4, 1e4],
]
)
asym_voltage_sensor["u_sigma"] = [1.0, np.nan, 0.0, -1.0]

sym_power_sensor = initialize_array(DatasetType.input, ComponentType.sym_power_sensor, 4)
Expand Down

0 comments on commit 45cc5f9

Please sign in to comment.