Skip to content

Commit 135f0e6

Browse files
committed
Move SparseDataComponentType to _core/data_types.py and update docstring in data_types.py
Signed-off-by: Emanuele Brentegani <emabr90@gmail.com>
1 parent 32893a4 commit 135f0e6

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/power_grid_model/_core/data_types.py

+7
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@ class SparseBatchArray(TypedDict):
160160
Sparse batch data can be a :class:`SparseBatchArray` or a :class:`SparseBatchColumnarData`.
161161
"""
162162

163+
SparseDataComponentType: TypeAlias = str
164+
"""
165+
A string representing the component type of sparse data structures.
166+
167+
Must be either "data" or "indptr".
168+
"""
169+
163170
BatchColumnarData = DenseBatchColumnarData | SparseBatchColumnarData
164171
"""
165172
Batch columnar data is either a :class:`DenseBatchColumnarData` or a :class:`SparseBatchColumnarData`.

src/power_grid_model/data_types.py

+2-10
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
Data types involving PGM datasets.
77
88
Many data types are used throughout the power grid model project. In an attempt to clarify type hints, some types
9-
have been defined and explained.
9+
are defined/exposed and explained.
1010
"""
1111

12-
from typing import TypeAlias
13-
1412
from power_grid_model._core.data_types import ( # pylint: disable=unused-import
1513
AsymValue,
1614
AttributeType,
@@ -44,11 +42,5 @@
4442
SparseBatchArray,
4543
SparseBatchColumnarData,
4644
SparseBatchData,
45+
SparseDataComponentType,
4746
)
48-
49-
SparseDataComponentType: TypeAlias = str
50-
"""
51-
A string representing the component type of sparse data structures.
52-
53-
Must be either "data" or "indptr".
54-
"""

0 commit comments

Comments
 (0)