Skip to content

Commit

Permalink
Format examples.
Browse files Browse the repository at this point in the history
Signed-off-by: Zhen Wang <zhen.wang@alliander.com>
  • Loading branch information
zhen0427 committed Mar 7, 2024
1 parent 03324b5 commit 67924a3
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/power_grid_model/data_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,21 @@

SparseBatchArray = Dict[str, np.ndarray]
"""
A sparse batch array is a dictionary containing the keys "indptr" and "data".
indptr: a one-dimensional numpy int32 array
data: a one-dimensional structured numpy array. The exact dtype depends on the type component.
A sparse batch array is a dictionary containing the keys `indptr` and `data`.
- indptr: a one-dimensional numpy int32 array
- data: a one-dimensional structured numpy array. The exact dtype depends on the type component.
Example:
{"indptr": <1d-array>, "data": <1d-array>}
Example: {"indptr": <1d-array>, "data": <1d-array>}
"""

BatchArray = Union[np.ndarray, SparseBatchArray]
"""
A batch is a either a dense or a sparse batch array
A batch is a either a dense or a sparse batch array.
Examples:
dense: <2d-array>
sparse: {"indptr": <1d-array>, "data": <1d-array>}
"""

Expand All @@ -54,8 +55,9 @@
A general data set can be a single or a batch dataset.
Examples:
single: {"node": <1d-array>, "line": <1d-array>}
batch: {"node": <2d-array>, "line": {"indptr": <1d-array>, "data": <1d-array>}}
- single: {"node": <1d-array>, "line": <1d-array>}
- batch: {"node": <2d-array>, "line": {"indptr": <1d-array>, "data": <1d-array>}}
"""

Expand Down Expand Up @@ -94,9 +96,10 @@
a real value, or a tuple of three real values.
Examples:
real: 10500.0
nominal: 123
asym: (10400.0, 10500.0, 10600.0)
- real: 10500.0
- nominal: 123
- asym: (10400.0, 10500.0, 10600.0)
"""

Component = Dict[str, Union[AttributeValue, str]]
Expand Down

0 comments on commit 67924a3

Please sign in to comment.