Skip to content

Commit a0045f9

Browse files
authored
Fix seconds in MovingWindow doc example (#437)
Sleep uses seconds and the example does not work for a 5 minute window
2 parents e5f49b9 + aa3062c commit a0045f9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/frequenz/sdk/timeseries/_moving_window.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ async def run() -> None:
7272
send_task = asyncio.create_task(send_mock_data(resampled_data_sender))
7373
7474
window = MovingWindow(
75-
size=timedelta(minutes=5),
75+
size=timedelta(seconds=5),
7676
resampled_data_recv=resampled_data_receiver,
7777
input_sampling_period=timedelta(seconds=1),
7878
)
7979
8080
time_start = datetime.now(tz=timezone.utc)
81-
time_end = time_start + timedelta(minutes=5)
81+
time_end = time_start + timedelta(seconds=5)
8282
83-
# ... wait for 5 minutes until the buffer is filled
83+
# ... wait for 5 seconds until the buffer is filled
8484
await asyncio.sleep(5)
8585
8686
# return an numpy array from the window

0 commit comments

Comments
 (0)