Skip to content

Commit d900aa4

Browse files
committed
fix np.isnan in if statement and documentation review comments
Signed-off-by: leovsch <leo.25.1996@gmail.com>
1 parent ff8cb6b commit d900aa4

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

docs/user_manual/components.md

+30-30
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ $$
295295
\end{bmatrix}
296296
$$
297297

298-
This representation holds for all values `r_aa` - `r_nn`, `x_aa` - `x_nn` and `c_aa` - `c_cc`. If the neutral values are not provided, the last row and column from the above matrix are omitted.
298+
This representation holds for all values `r_aa` ... `r_nn`, `x_aa` ... `x_nn` and `c_aa` ... `c_cc`. If the neutral values are not provided, the last row and column from the above matrix are omitted.
299299

300300
| name | data type | unit | description | required | update | valid values |
301301
| ------ | --------- | ---------- | --------------------------------- | ---------------------------- | :------: | :--------------------------------: |
@@ -330,43 +330,43 @@ This representation holds for all values `r_aa` - `r_nn`, `x_aa` - `x_nn` and `c
330330

331331
For the r and x matrices providing values for the neutral phase is optional. To clarify which input values are required, please consult the tables below:
332332

333-
| r_aa - r_cc | r_na | r_nb | r_nc | r_nn | result | Validation Error |
334-
| ------------- | -------- | -------- | -------- | -------- | -------- | ------------------------- |
335-
| &#10004; | &#10004; | &#10004; | &#10004; | &#10004; | &#10004; | |
336-
| &#10004; | &#10004; | &#10004; | &#10004; | &#10060; | &#10060; | MultiFieldValidationError |
337-
| &#10004; | &#10004; | &#10004; | &#10004; | &#10060; | &#10060; | MultiFieldValidationError |
338-
| &#10004; | &#10004; | &#10004; | &#10060; | &#10060; | &#10060; | MultiFieldValidationError |
339-
| &#10004; | &#10004; | &#10060; | &#10060; | &#10060; | &#10060; | MultiFieldValidationError |
340-
| &#10004; | &#10060; | &#10060; | &#10060; | &#10060; | &#10004; | |
341-
| &#10060; | &#10060; | &#10060; | &#10060; | &#10060; | &#10060; | MultiFieldValidationError |
342-
343-
| x_aa - x_cc | x_na | x_nb | x_nc | x_nn | result | Validation Error |
344-
| ------------- | -------- | -------- | -------- | -------- | -------- | ------------------------- |
345-
| &#10004; | &#10004; | &#10004; | &#10004; | &#10004; | &#10004; | |
346-
| &#10004; | &#10004; | &#10004; | &#10004; | &#10060; | &#10060; | MultiFieldValidationError |
347-
| &#10004; | &#10004; | &#10004; | &#10004; | &#10060; | &#10060; | MultiFieldValidationError |
348-
| &#10004; | &#10004; | &#10004; | &#10060; | &#10060; | &#10060; | MultiFieldValidationError |
349-
| &#10004; | &#10004; | &#10060; | &#10060; | &#10060; | &#10060; | MultiFieldValidationError |
350-
| &#10004; | &#10060; | &#10060; | &#10060; | &#10060; | &#10004; | |
351-
| &#10060; | &#10060; | &#10060; | &#10060; | &#10060; | &#10060; | MultiFieldValidationError |
352-
353-
For the c-matrix values there are two options. Either provide all the required c-matrix values i.e. `c_aa` - `c_cc` or provide `c0`, `c1`. Whenver both sets are supplied the powerflow calculations will use `c0`, `c1`.
333+
| r_aa ... r_cc | r_na | r_nb | r_nc | r_nn | result | Validation Error |
334+
| --------------- | -------- | -------- | -------- | -------- | -------- | ------------------------- |
335+
| &#10004; | &#10004; | &#10004; | &#10004; | &#10004; | &#10004; | |
336+
| &#10004; | &#10004; | &#10004; | &#10004; | &#10060; | &#10060; | MultiFieldValidationError |
337+
| &#10004; | &#10004; | &#10004; | &#10004; | &#10060; | &#10060; | MultiFieldValidationError |
338+
| &#10004; | &#10004; | &#10004; | &#10060; | &#10060; | &#10060; | MultiFieldValidationError |
339+
| &#10004; | &#10004; | &#10060; | &#10060; | &#10060; | &#10060; | MultiFieldValidationError |
340+
| &#10004; | &#10060; | &#10060; | &#10060; | &#10060; | &#10004; | |
341+
| &#10060; | &#10060; | &#10060; | &#10060; | &#10060; | &#10060; | MultiFieldValidationError |
342+
343+
| x_aa ... x_cc | x_na | x_nb | x_nc | x_nn | result | Validation Error |
344+
| --------------- | -------- | -------- | -------- | -------- | -------- | ------------------------- |
345+
| &#10004; | &#10004; | &#10004; | &#10004; | &#10004; | &#10004; | |
346+
| &#10004; | &#10004; | &#10004; | &#10004; | &#10060; | &#10060; | MultiFieldValidationError |
347+
| &#10004; | &#10004; | &#10004; | &#10004; | &#10060; | &#10060; | MultiFieldValidationError |
348+
| &#10004; | &#10004; | &#10004; | &#10060; | &#10060; | &#10060; | MultiFieldValidationError |
349+
| &#10004; | &#10004; | &#10060; | &#10060; | &#10060; | &#10060; | MultiFieldValidationError |
350+
| &#10004; | &#10060; | &#10060; | &#10060; | &#10060; | &#10004; | |
351+
| &#10060; | &#10060; | &#10060; | &#10060; | &#10060; | &#10060; | MultiFieldValidationError |
352+
353+
For the c-matrix values there are two options. Either provide all the required c-matrix values i.e. `c_aa` ... `c_cc` or provide `c0`, `c1`. Whenver both sets are supplied the powerflow calculations will use `c0`, `c1`.
354354
The table below provides guidance in providing valid input.
355355

356-
| c_aa - c_cc | c0 | c1 | result | Validation Error |
357-
| ----------- | -------- | -------- | -------- | ------------------------- |
358-
| &#10004; | &#10004; | &#10004; | &#10004; | |
359-
| &#10004; | &#10004; | &#10060; | &#10004; | |
360-
| &#10004; | &#10060; | &#10060; | &#10004; | |
361-
| &#10060; | &#10004; | &#10060; | &#10060; | MultiFieldValidationError |
362-
| &#10060; | &#10004; | &#10004; | &#10004; | |
356+
| c_aa ... c_cc | c0 | c1 | result | Validation Error |
357+
| ------------- | -------- | -------- | -------- | ------------------------- |
358+
| &#10004; | &#10004; | &#10004; | &#10004; | |
359+
| &#10004; | &#10004; | &#10060; | &#10004; | |
360+
| &#10004; | &#10060; | &#10060; | &#10004; | |
361+
| &#10060; | &#10004; | &#10060; | &#10060; | MultiFieldValidationError |
362+
| &#10060; | &#10004; | &#10004; | &#10004; | |
363363

364364
#### Electric Model
365365

366366
The cable properties are described using matrices where the $Z_{\text{series}}$ matrix is computed as:
367367

368368
$$
369-
Z_{\text{series}} = R + j * X
369+
Z_{\text{series}} = R + \mathrm{j} * X
370370
$$
371371

372372
Where $R$ and $X$ denote the resistance and reactance matrices build from the input respectively.

src/power_grid_model/validation/_rules.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ def no_strict_subset_missing(data: SingleDataset, fields: list[str], component_t
772772
np.any(
773773
(
774774
np.isnan(component_data[field])
775-
if np.isnan(nan_value)
775+
if np.any(np.isnan(nan_value))
776776
else np.equal(component_data[field], nan_value)
777777
),
778778
axis=asym_axes,
@@ -783,7 +783,7 @@ def no_strict_subset_missing(data: SingleDataset, fields: list[str], component_t
783783
np.any(
784784
(
785785
np.logical_not(np.isnan(component_data[field]))
786-
if np.isnan(nan_value)
786+
if np.any(np.isnan(nan_value))
787787
else np.logical_not(np.equal(component_data[field], nan_value))
788788
),
789789
axis=asym_axes,
@@ -827,7 +827,7 @@ def not_all_missing(data: SingleDataset, fields: list[str], component_type: Comp
827827
np.any(
828828
(
829829
np.isnan(component_data[field])
830-
if np.isnan(nan_value)
830+
if np.any(np.isnan(nan_value))
831831
else np.equal(component_data[field], nan_value)
832832
),
833833
axis=asym_axes,

0 commit comments

Comments
 (0)