Skip to content

Commit

Permalink
Added dataset and component types.
Browse files Browse the repository at this point in the history
Signed-off-by: Santiago Figueroa <santiago.figueroa.manrique@alliander.com>
  • Loading branch information
figueroa1395 committed Jun 13, 2024
1 parent f300157 commit 8905f00
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/power_grid_model/data_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
have been defined and explained in this file.
"""

from enum import Enum
from typing import Dict, List, Tuple, Union

import numpy as np

from power_grid_model import power_grid_meta_data

# When we're dropping python 3.8, we should introduce proper NumPy type hinting

SingleArray = Union[np.ndarray]
Expand Down Expand Up @@ -186,3 +189,30 @@
[{"line": [{"id": 3, "from_status": 0, "to_status": 0, ...}],},
{"line": [{"id": 3, "from_status": 1, "to_status": 1, ...}],}]
"""

# comply with mypy
PowerGridDataTypes = Enum( # type: ignore
"PowerGridDataTypes", {data_type: data_type for data_type in power_grid_meta_data} # type: ignore
) # type: ignore
"""
Types of single/batch datasets:
- input: Dataset with attributes relevant to the grid configuration (e.g. id, from_node, from_status).
- update: Dataset with attributes relevant to multiple scenarios (e.g. from_status, to_status).
- sym_output: Dataset with attributes relevant to symmetrical steady state output of power flow or state estimation
calculation (e.g. p_from, p_to).
- asym_output: Dataset with attributes relevant to asymmetrical steady state output of power flow or state estimation
calculation (e.g. p_from, p_to).
- sc_output: Contains attributes relevant to symmetrical short circuit calculation output. Like for the asym_output,
detailed data for all 3 phases will be provided where relevant (e.g. i_from, i_from_angle).
"""

# to comply with mypy
PowerGridComponents = Enum( # type: ignore
"PowerGridComponents", {component: component for component in power_grid_meta_data["input"]} # type: ignore
) # type: ignore
"""Grid component types."""

0 comments on commit 8905f00

Please sign in to comment.