Skip to content

Commit 6560d1f

Browse files
committed
Document what bounds overlapping with exclusion bounds look like
Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 8d9e44c commit 6560d1f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/frequenz/sdk/actor/_power_managing/_matryoshka.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,21 @@ def _check_exclusion_bounds_overlap(
9797
) -> tuple[bool, bool]:
9898
"""Check if the given bounds overlap with the given exclusion bounds.
9999
100+
When only the upper bound overlaps with exclusion bounds, the usable range is
101+
between the lower bound and the lower exclusion bound, like below.
102+
103+
===lb+++++++ex----ub-------ex===
104+
105+
When only the lower bound overlaps with exclusion bounds, the usable range is
106+
between the upper exclusion bound and the upper bound.
107+
108+
===ex------lb------ex++++++ub===
109+
110+
Both bounds overlapping with exclusion bounds (or given bounds are fully contained
111+
within exclusion bounds). In this case, there is no usable range.
112+
113+
===ex------lb------ub------ex===
114+
100115
Args:
101116
lower_bound: The lower bound to check.
102117
upper_bound: The upper bound to check.

0 commit comments

Comments
 (0)