Skip to content

Commit e150d8c

Browse files
Change internal presense of the Grid, eliminating _grid
We are moving the grid to a new location to improve documentation visibility of the type `Grid`. This is not particularly easy, because we noticed that the place where the grid module would fit the best (microgrid.grid), would cause name conflicts. We agreed to move it to timeseries for now, which is actually consistent to the current state, and move it further later. Signed-off-by: Christian Parpart <[email protected]>
1 parent 89ca11e commit e150d8c

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/frequenz/sdk/microgrid/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
""" # noqa: D205, D400
124124

125125
from ..actor import ResamplerConfig
126+
from ..timeseries.grid import initialize as initialize_grid
126127
from . import _data_pipeline, client, component, connection_manager, fuse
127128
from ._data_pipeline import (
128129
battery_pool,
@@ -131,7 +132,6 @@
131132
grid,
132133
logical_meter,
133134
)
134-
from ._grid import initialize as initialize_grid
135135

136136

137137
async def initialize(host: str, port: int, resampler_config: ResamplerConfig) -> None:

src/frequenz/sdk/microgrid/_data_pipeline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
from ..actor._actor import Actor
2222
from ..microgrid.component import Component
2323
from ..timeseries._grid_frequency import GridFrequency
24+
from ..timeseries.grid import Grid
25+
from ..timeseries.grid import get as get_grid
2426
from . import connection_manager
25-
from ._grid import Grid
26-
from ._grid import get as get_grid
2727
from .component import ComponentCategory
2828

2929
_logger = logging.getLogger(__name__)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
from collections.abc import Iterable
1212
from dataclasses import dataclass
1313

14-
from .component import Component
15-
from .component._component import ComponentCategory
16-
from .fuse import Fuse
14+
from ..microgrid.component import Component
15+
from ..microgrid.component._component import ComponentCategory
16+
from ..microgrid.fuse import Fuse
1717

1818

1919
@dataclass(frozen=True)

tests/microgrid/test_grid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
"""Tests for the `Grid` module."""
55

6-
from frequenz.sdk.microgrid import _grid
76
from frequenz.sdk.microgrid.component import Component, ComponentCategory, GridMetadata
87
from frequenz.sdk.microgrid.fuse import Fuse
98
from frequenz.sdk.timeseries import Current
9+
from frequenz.sdk.timeseries import grid as _grid
1010

1111

1212
async def test_grid_1() -> None:

0 commit comments

Comments
 (0)