power-grid-model-ds 1.1.4__py3-none-any.whl → 1.1.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@
4
4
 
5
5
  """Generators for the grid"""
6
6
 
7
- from typing import Type
7
+ from typing import Generic, Type, TypeVar
8
8
 
9
9
  import numpy as np
10
10
 
@@ -18,13 +18,15 @@ from power_grid_model_ds._core.model.grids.base import Grid
18
18
 
19
19
  # pylint: disable=too-few-public-methods,too-many-arguments,too-many-positional-arguments
20
20
 
21
+ T = TypeVar("T", bound=Grid)
21
22
 
22
- class RadialGridGenerator:
23
+
24
+ class RadialGridGenerator(Generic[T]):
23
25
  """Generates a random but structurally correct radial grid with the given specifications"""
24
26
 
25
27
  def __init__(
26
28
  self,
27
- grid_class: Type[Grid],
29
+ grid_class: Type[T],
28
30
  nr_nodes: int = 100,
29
31
  nr_sources: int = 2,
30
32
  nr_nops: int = 10,
@@ -36,7 +38,7 @@ class RadialGridGenerator:
36
38
  self.nr_sources = nr_sources
37
39
  self.nr_nops = nr_nops
38
40
 
39
- def run(self, seed=None, create_10_3_kv_net: bool = False):
41
+ def run(self, seed=None, create_10_3_kv_net: bool = False) -> T:
40
42
  """Run the generator to create a random radial grid.
41
43
 
42
44
  if a seed is provided, this will be used to set rng.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: power-grid-model-ds
3
- Version: 1.1.4
3
+ Version: 1.1.5
4
4
  Summary: Power Grid Model extension which provides a grid data structure for simulation and analysis
5
5
  Author-email: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
6
6
  License: MPL-2.0
@@ -11,7 +11,7 @@ power_grid_model_ds/_core/fancypy.py,sha256=MVnt6gRe2civTQBY17Dtp_wyqARpy4jP1NCp
11
11
  power_grid_model_ds/_core/load_flow.py,sha256=qpQkkcTV_-43sg0TwF44gahhWWbg2cqFHdVaecB0GQ0,4959
12
12
  power_grid_model_ds/_core/data_source/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  power_grid_model_ds/_core/data_source/generator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- power_grid_model_ds/_core/data_source/generator/grid_generators.py,sha256=zToluoDgjn_KOC-hz4F6M377o3AMztcliP2QAWB_Q_E,2910
14
+ power_grid_model_ds/_core/data_source/generator/grid_generators.py,sha256=knAtQOhdUru3z6Kzc0rjSE9PPeC4_c7SUVVLqTi3ZBU,2972
15
15
  power_grid_model_ds/_core/data_source/generator/arrays/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  power_grid_model_ds/_core/data_source/generator/arrays/base.py,sha256=Q0abhwyxOvZw-yn0m_vElSLL1mL3qdTNFzVWv-wCUd4,689
17
17
  power_grid_model_ds/_core/data_source/generator/arrays/line.py,sha256=Wh-tKHM5iOojGvJnql0atjuz5kjTnI5JWJzsG8p8ECg,6326
@@ -57,8 +57,8 @@ power_grid_model_ds/_core/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
57
57
  power_grid_model_ds/_core/utils/misc.py,sha256=aAdlXjyKN6_T4b_CQZ879TbkbDZW4TwBUsxTpkwvymU,1228
58
58
  power_grid_model_ds/_core/utils/pickle.py,sha256=LGeTc7nu9RY1noOzLJzYaSHSWIgqzHy2xhmueKGuipc,1445
59
59
  power_grid_model_ds/_core/utils/zip.py,sha256=9RtJYhjlgNZOtxr4iI-CpsjT1axw5kCCqprfTjaIsiI,2197
60
- power_grid_model_ds-1.1.4.dist-info/LICENSE,sha256=GpbnG1pNl-ORtSP6dmHeiZvwy36UFli6MEZy1XlmBqo,14906
61
- power_grid_model_ds-1.1.4.dist-info/METADATA,sha256=XYSIcX5BJnpl0pG6N2vwSFRPJW5WO-QbXuw7MnBzc1E,8822
62
- power_grid_model_ds-1.1.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
63
- power_grid_model_ds-1.1.4.dist-info/top_level.txt,sha256=nJa103Eqvm5TESYEKPFVImfLg_ugGOBznikrM-rZQZg,20
64
- power_grid_model_ds-1.1.4.dist-info/RECORD,,
60
+ power_grid_model_ds-1.1.5.dist-info/LICENSE,sha256=GpbnG1pNl-ORtSP6dmHeiZvwy36UFli6MEZy1XlmBqo,14906
61
+ power_grid_model_ds-1.1.5.dist-info/METADATA,sha256=61BFCXiDJ2zaf0LgHV13i0S4NlnVrw0AOD1pghs0FEI,8822
62
+ power_grid_model_ds-1.1.5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
63
+ power_grid_model_ds-1.1.5.dist-info/top_level.txt,sha256=nJa103Eqvm5TESYEKPFVImfLg_ugGOBznikrM-rZQZg,20
64
+ power_grid_model_ds-1.1.5.dist-info/RECORD,,