Skip to content

Commit bcc902e

Browse files
authored
Replace FormulaEngine subclasses with type aliases (#1331)
2 parents f539389 + 79ad357 commit bcc902e

File tree

2 files changed

+5
-32
lines changed

2 files changed

+5
-32
lines changed

RELEASE_NOTES.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# Frequenz Python SDK Release Notes
22

3-
## Upgrading
3+
## Bug fixes
44

5-
- The `FormulaEngine` is now replaced by a newly implemented `Formula` type. This doesn't affect the high level interfaces. `FormulaEngine` is now a deprecated wrapper to `Formula`.
6-
7-
- The `ComponentGraph` has been replaced by the `frequenz-microgrid-component-graph` package, which provides python bindings for the rust implementation.
8-
9-
## New Features
10-
11-
- The power manager algorithm for batteries can now be changed from the default ShiftingMatryoshka, by passing it as an argument to `microgrid.initialize()`
5+
- `FormulaEngine` and `FormulaEngine3Phase` are now type aliases to `Formula` and `Formula3Phase`, fixing a typing issue introduced in `v1.0.0-rc2202`.

src/frequenz/sdk/timeseries/formula_engine/__init__.py

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,14 @@
44
"""Deprecated Formula Engine."""
55

66

7-
from typing_extensions import deprecated
7+
from typing_extensions import TypeAlias
88

99
from .._base_types import QuantityT
1010
from ..formulas._formula import Formula
1111
from ..formulas._formula_3_phase import Formula3Phase
1212

13-
14-
@deprecated(
15-
"The FormulaEngine class is deprecated and will be removed in a future release. "
16-
+ "Please use the Formula class instead."
17-
)
18-
class FormulaEngine(Formula[QuantityT]):
19-
"""Deprecated Formula Engine class.
20-
21-
This class is deprecated and will be removed in a future release.
22-
Please use the `Formula` and `Formula3Phase` classes directly.
23-
"""
24-
25-
26-
@deprecated(
27-
"The FormulaEngine3Phase class is deprecated and will be removed in a future release. "
28-
+ "Please use the Formula3Phase class instead."
29-
)
30-
class FormulaEngine3Phase(Formula3Phase[QuantityT]):
31-
"""Deprecated FormulaEngine3Phase class.
32-
33-
This class is deprecated and will be removed in a future release.
34-
Please use the `Formula3Phase` class directly.
35-
"""
13+
FormulaEngine: TypeAlias = Formula[QuantityT]
14+
FormulaEngine3Phase: TypeAlias = Formula3Phase[QuantityT]
3615

3716

3817
__all__ = ["FormulaEngine", "FormulaEngine3Phase"]

0 commit comments

Comments
 (0)