Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemanspiff2007 committed Jan 17, 2025
1 parent a474f62 commit f28d1d0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
10 changes: 8 additions & 2 deletions src/HABApp/util/ring_counter/ring_counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ def __int__(self) -> int:
return self._value

def increase(self, value: int = 1) -> Self:
"""Increase the value of the ring counter by the given value."""
"""Increase the value of the ring counter by the given value.
:param value: How much to increase the value by.
"""
if value < 0:
msg = 'Value must be >= 0'
raise ValueError(msg)
Expand All @@ -69,7 +72,10 @@ def increase(self, value: int = 1) -> Self:
return self

def decrease(self, value: int = 1) -> Self:
"""Decrease the value of the ring counter by the given value."""
"""Decrease the value of the ring counter by the given value.
:param value: How much to decrease the value by.
"""
if value < 0:
msg = 'Value must be >= 0'
raise ValueError(msg)
Expand Down
2 changes: 1 addition & 1 deletion src/HABApp/util/ring_counter/ring_counter_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class RingCounterTracker:
"""Class that tracks a ring counter value and only allows increasing values.
"""Class that tracks a ring counter value and only allows increasing or decreasing values.
"""

__slots__ = ('_ignore', '_is_increasing', '_last_value', '_max_value', '_min_value')
Expand Down
2 changes: 0 additions & 2 deletions tests/test_utils/test_ring_counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ def test_ring_counter_tracker_increase() -> None:
assert values == set(range(-10, 11))




def test_ring_counter_tracker_decrease() -> None:
tracker = RingCounterTracker(100, direction='decreasing')

Expand Down

0 comments on commit f28d1d0

Please sign in to comment.