@@ -46,60 +46,8 @@ def get_channel_name(self) -> str:
4646 return f"power_manager.report.{ self .component_ids = } .{ self .priority = } "
4747
4848
49- class Report (typing .Protocol ):
50- """Current PowerManager report for a set of components.
51-
52- This protocol can be specialized by different component pools to provide more
53- specific details and documentation for the reports.
54- """
55-
56- @property
57- def bounds (self ) -> timeseries .Bounds [Power ] | None :
58- """The bounds for the components.
59-
60- These bounds are adjusted to any restrictions placed by actors with higher
61- priorities.
62-
63- There might be exclusion zones within these bounds. If necessary, the
64- `adjust_to_bounds` method may be used to check if a desired power value fits the
65- bounds, or to get the closest possible power values that do fit the bounds.
66- """
67-
68- @abc .abstractmethod
69- def adjust_to_bounds (self , power : Power ) -> tuple [Power | None , Power | None ]:
70- """Adjust a power value to the bounds.
71-
72- This method can be used to adjust a desired power value to the power bounds
73- available to the actor.
74-
75- If the given power value falls within the usable bounds, it will be returned
76- unchanged.
77-
78- If it falls outside the usable bounds, the closest possible value on the
79- corresponding side will be returned. For example, if the given power is lower
80- than the lowest usable power, only the lowest usable power will be returned, and
81- similarly for the highest usable power.
82-
83- If the given power falls within an exclusion zone that's contained within the
84- usable bounds, the closest possible power values on both sides will be returned.
85-
86- !!! note
87- It is completely optional to use this method to adjust power values before
88- proposing them, because the PowerManager will do this automatically. This
89- method is provided for convenience, and for granular control when there are
90- two possible power values, both of which fall within the available bounds.
91-
92- Args:
93- power: The power value to adjust.
94-
95- Returns:
96- A tuple of the closest power values to the desired power that fall within
97- the available bounds for the actor.
98- """
99-
100-
10149@dataclasses .dataclass (frozen = True , kw_only = True )
102- class _Report ( Report ) :
50+ class _Report :
10351 """Current PowerManager report for a set of components."""
10452
10553 target_power : Power | None
0 commit comments