diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 5dde1e3af..983f98917 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -45,6 +45,7 @@ - Provide access to `capacity` (maximum number of elements) in `MovingWindow`. - Methods to retrieve oldest and newest timestamp of valid samples are added to both. - `MovingWindow` exposes underlying buffers `window` method. + - `len(window)` and `len(buffer)` should be replaced with `window.count_valid()` and `buffer.count_valid()`, respectively. - `OrderedRingBuffer.window`: - By default returns a copy. - Can also return a view if the window contains `None` values and if `force_copy` is set to `True`. diff --git a/src/frequenz/sdk/timeseries/_moving_window.py b/src/frequenz/sdk/timeseries/_moving_window.py index 7317fb74a..69da7caf3 100644 --- a/src/frequenz/sdk/timeseries/_moving_window.py +++ b/src/frequenz/sdk/timeseries/_moving_window.py @@ -315,15 +315,6 @@ def count_valid(self) -> int: """ return self._buffer.count_valid() - def __len__(self) -> int: - """ - Return the size of the `MovingWindow`s underlying buffer. - - Returns: - The size of the `MovingWindow`. - """ - return self.count_valid() - @overload def __getitem__(self, key: SupportsIndex) -> float: """See the main __getitem__ method.