Skip to content

Commit 770f21a

Browse files
authored
Merge pull request #272 from PaulSchulz/main
fix (minor) typo in 'unit' documentation in tabular converter
2 parents 4790212 + 7aa2c04 commit 770f21a

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

docs/converters/tabular_converter.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ grid:
3030
auto_id:
3131
table: Nodes
3232
key:
33-
Number: From.Number
33+
Number: From.Number
3434
from_status: From.Switch state
3535
to_node:
3636
auto_id:
3737
table: Nodes
3838
key:
39-
Number: To.Number
39+
Number: To.Number
4040
to_status: To.Switch state
4141

4242
units:
@@ -58,7 +58,7 @@ The for each PGM `column` the source column is supplied (e.g., u_rated: Unom, fr
5858
## Field Definitions
5959
If the `column` definition is a one-on-one mapping, the value is simply the name of the source column (e.g., u_rated: Unom).
6060
In many other cases, however, mappings can be a bit more complex.
61-
You can use the following `column` definitions:
61+
You can use the following `column` definitions:
6262

6363
* Column name `str`
6464
```yaml
@@ -68,15 +68,15 @@ You can use the following `column` definitions:
6868
```yaml
6969
p_specified: Inverter.Pnom | Inverter.Snom
7070
```
71-
* Automatic IDs `Dict[str, Dict[str, Any]]` with single key `reference`, required attribute `key` and optinal
71+
* Automatic IDs `Dict[str, Dict[str, Any]]` with single key `reference`, required attribute `key` and optional
7272
attributes `table` and `name`. More extensive examples are shown in the section [AutoID Mapping](##autois-mapping).
7373
```yaml
7474
id:
7575
auto_id:
7676
key: Number
7777
```
78-
79-
* Reference to a column on another sheet `Dict[str, Dict[str, Any]]` with single key `reference` and the
78+
79+
* Reference to a column on another sheet `Dict[str, Dict[str, Any]]` with single key `reference` and the
8080
```yaml
8181
r1:
8282
reference:
@@ -118,7 +118,7 @@ You can use the following `column` definitions:
118118
Is similar to something like:
119119
```python
120120
from power_grid_model_io.functions.phase_to_phase import reactive_power
121-
121+
122122
q_specified = reactive_power(
123123
p=min(
124124
table["Pnom"],
@@ -147,13 +147,13 @@ units:
147147
The definitions above can be interpreted as:
148148
* **A** is a valid SI unit
149149
* **F** is a valid SI unit
150-
* 1 **µF** = 0.000001 **A**
150+
* 1 **µF** = 0.000001 **F**
151151
* **ohm/m** is a valid SI unit
152152
* 1 **ohm/km** = 0.001 **ohm/m**
153153

154154
## Substitutions
155-
Some columns may contain categorical values (enums) that should be mapped. The column names can be defined as
156-
regular expressions.
155+
Some columns may contain categorical values (enums) that should be mapped. The column names can be defined as
156+
regular expressions.
157157
```yaml
158158
substitutions:
159159
".*Switch state":
@@ -172,7 +172,7 @@ The definitions above can be interpreted as:
172172
and the word "own" boolean value `true`.
173173

174174
## AutoID
175-
The `id` field is special in the sense that each object should have a unique numerical id in power grid model.
175+
The `id` field is special in the sense that each object should have a unique numerical id in power grid model.
176176
Therefore, each id definition is mapped to a numerical (integer) ID.
177177
Field names that end with `node` are also mapped to corresponding numerical IDs.
178178

@@ -185,7 +185,7 @@ b = auto_id("Bravo") # b = 1
185185
c = auto_id("Alpha") # c = 0 (because key "Alpha" already existed)
186186
item = auto_id[1] # item = "Bravo"
187187
```
188-
188+
189189
See also {py:class}`power_grid_model_io.utils.AutoID`
190190

191191
## AutoID Mapping
@@ -215,23 +215,23 @@ Let's consider a very common example of the usage of `auto_id` in a mapping file
215215
```
216216
This basically reads:
217217
* For each row in the Nodes table, a PGM node instance is created.
218-
* For each node instance, a numerical id is generated, which is unique for each value in the Number column. This
219-
assumes that the Number column is unique in the source table. Let's say tha values of the Number column in that
220-
Nodes source table are `[101, 102, 103]`, then the generated IDs will be `[0, 1, 2]`. However, if the source
218+
* For each node instance, a numerical id is generated, which is unique for each value in the Number column. This
219+
assumes that the Number column is unique in the source table. Let's say tha values of the Number column in that
220+
Nodes source table are `[101, 102, 103]`, then the generated IDs will be `[0, 1, 2]`. However, if the source
221221
column is not unique, the pgm ids won't be unique as well: `[101, 102, 103, 101] -> [0, 1, 2, 0]`.
222222
* Under the hood, the table name `Nodes` and the column name `Number` are used to generate these IDs:
223223
* `{"table": "Nodes", "key" {"Number": 101} -> 0`
224224
* `{"table": "Nodes", "key" {"Number": 102} -> 1`
225225
* `{"table": "Nodes", "key" {"Number": 103} -> 2`
226226
* For each row in the Cables table, a PGM line instance is created.
227227
* For each line instance, a numerical id is generated, just like for the nodes.
228-
Let's say there are two Cables `[201, 202]` and the corresponding lines will have IDs `[3, 4]`.
228+
Let's say there are two Cables `[201, 202]` and the corresponding lines will have IDs `[3, 4]`.
229229
* `{"table": "Cables", "key" {"Number": 201} -> 3`
230230
* `{"table": "Cables", "key" {"Number": 202} -> 4`
231231
* A Cable connects to two Nodes.
232232
In this example Cable `201` connects Node `101` and `102`, and Cable `201` connects Node `102` and `103`.
233233
These Node Numbers are stored in the columns `From_Number` and `To_Number`.
234-
In order to retrieve the right PGM IDs, we have to explicitly state that the table in which the Nodes are
234+
In order to retrieve the right PGM IDs, we have to explicitly state that the table in which the Nodes are
235235
defined is called `Nodes` and the original column storing the Node Numbers is called `Number`.
236236
* On the 'from' side of the cables:
237237
* `{"table": "Nodes", "key" {"Number": 101} -> 0`
@@ -337,19 +337,19 @@ Mapping files enable the specification of custom mappings or filter functions. T
337337
We use the `yaml.safe_load` functionality from the PyYAML library to load configuration files securely. This method prevents the execution of potentially malicious code during the loading process.
338338

339339
### Secure Function Handling
340-
* No `eval`-like Functionality:
341-
340+
* No `eval`-like Functionality:
341+
342342
We do not use `eval` or similar functions that can execute arbitrary code.
343343
* Loadable/Loaded Functions Only
344-
344+
345345
Only functions and symbols that are explicitly loadable or loaded are allowed. These must be:
346346

347-
* Python Builtins:
348-
347+
* Python Builtins:
348+
349349
Such as `max`.
350350

351-
* Prefixed by Import Path:
352-
351+
* Prefixed by Import Path:
352+
353353
Functions must include their relative or absolute import path, ensuring they are importable using `import_module`. For example, `numpy.max` is allowed, but `np.max` is not.
354354

355355
### Prevention of Malicious Code Injection

docs/converters/vision_converter.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ The Vision Excel converter converts the Excel exports from Vision to PGM data fo
99
The default mapping of all attributes is stored in the `vision_en.yaml` and `vision_nl.yaml` files in [config](https://github.com/PowerGridModel/power-grid-model-io/tree/main/src/power_grid_model_io/config) directory.
1010
Custom mapping files are supported via passing the file directory to the constructor of the converter.
1111

12-
## Load rate of elements
12+
## Load rate of elements
1313

1414
Certain `elements` in Vision, i.e., appliances like transformer loads and induction motor have a result parameter of load rate.
1515
In Vision, load rates are calculated without considering the simultaneity factors of connected nodes.
1616
So we may observe a variation in power inflow/outflow result (i.e., P, Q and S) due to different simultaneity factors. But the load rate always corresponds to `simultaneity of loads=1`.
1717

18-
When we make conversion to PGM, the input data attributes of PGM for loads like `p_specified` and `q_specified` are modified as per simultaneity. The resulting loading then takes simultaneity into account.
18+
When we make conversion to PGM, the input data attributes of PGM for loads like `p_specified` and `q_specified` are modified as per simultaneity. The resulting loading then takes simultaneity into account.
1919
**Hence, the loading of such elements may not correspond to the load rate obtained in Vision**
2020

2121
## Transformer load modeling
2222

23-
power-grid-model-io converts the transformer load into a individual transformer and a load for usage in power-grid-model.
23+
power-grid-model-io converts the transformer load into a individual transformer and a load for usage in power-grid-model.
2424
To the best of our knowledge, Vision modeles a transformer load differently than an individual transformer plus load.
25-
There is a minor difference in both the reactive power consumed and generated.
25+
There is a minor difference in both the reactive power consumed and generated.
2626
This might correspond to a minor voltage deviation in the results.
2727

2828
```{tip}
@@ -38,9 +38,9 @@ Note that in symmetrical calculations, Vision does not include clock angles of t
3838

3939
Some components are yet to be modeled for conversions because they might not have a straightforward mapping in power-grid-model. Those are listed here.
4040

41-
- power-grid-model currently does not support PV(Active Power-Voltage) bus and related corresponding features.
41+
- power-grid-model currently does not support PV(Active Power-Voltage) bus and related corresponding features.
4242
- Currently, the efficiency type of PVs(Photovoltaics) element is also unsupported for all types except the `100%` type. For the efficiency type: `0, 1 pu: 93 %; 1 pu: 97 %`, the generation power is multiplied by 97% as a closest approximation.
43-
- The conversions for load behaviors of `industry`, `residential` and `business` are not yet modeled. The load behaviors usually do not create a significant difference in power-flow results for most grids when the voltage at bus is close to `1 pu`. Hence, the conversion of the mentioned load behaviors is approximated to be of `Constant Power` type for the time being.
43+
- The conversions for load behaviors of `industry`, `residential` and `business` are not yet modeled. The load behaviors usually do not create a significant difference in power-flow results for most grids when the voltage at bus is close to `1 pu`. Hence, the conversion of the mentioned load behaviors is approximated to be of `Constant Power` type for the time being.
4444
- The source bus in power-grid-model is mapped with a source impedance. `Sk"nom`, `R/X` and `Z0/Z1` are the attributes used in modeling source impedance. In Vision, these attributes are used only for short circuit calculations
4545
- The load rate for transformer is calculated in Vision by current i.e., `load_rate = max(u1 * I1, u2 * I2) * sqrt(3) / Snom * 100`. Whereas in power-grid-model, loading is calculated by power, i.e., `loading = max(s1,s2)/sn`. (Note: The attribute names are as per relevant notation in Vision and PGM respectively). This gives a slight difference in load rate of transformer.
4646
- A minor difference in results is expected since Vision uses a power mismatch in p.u. as convergence criteria whereas power-grid-model uses voltage mismatch.
@@ -52,7 +52,7 @@ Vision introduced UUID based identifier system since version 9.7. It is implemen
5252

5353
An examplery usage can be found in the example notebook as well as in the test cases.
5454

55-
## Common/Known issues related to Vision
55+
## Common/Known issues related to Vision
5656
So far we have the following issue known to us related to Vision exported spread sheets. We provide a solution from user perspective to the best of our knowledge.
5757

5858
### Duplicated `P` columns

0 commit comments

Comments
 (0)