File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/frequenz/sdk/timeseries Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -306,14 +306,23 @@ async def sink_buffer(sample: Sample[Quantity]) -> None:
306306 asyncio .create_task (self ._resampler .resample (), name = "resample" )
307307 )
308308
309+ def count_valid (self ) -> int :
310+ """
311+ Count the number of valid samples in this `MovingWindow`.
312+
313+ Returns:
314+ The number of valid samples in this `MovingWindow`.
315+ """
316+ return self ._buffer .count_valid ()
317+
309318 def __len__ (self ) -> int :
310319 """
311320 Return the size of the `MovingWindow`s underlying buffer.
312321
313322 Returns:
314323 The size of the `MovingWindow`.
315324 """
316- return self ._buffer . count_valid ()
325+ return self .count_valid ()
317326
318327 @overload
319328 def __getitem__ (self , key : SupportsIndex ) -> float :
You can’t perform that action at this time.
0 commit comments