Skip to content

Commit 50155e1

Browse files
committed
Fix resampling actor documentation
The Raises: section is missing a ":" after the exception type, but we just remove the documentation because assertions shouldn't be documented, they are not intended to be caught by the users. Instead we document that samples shouldn't be empty. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 96a0bb9 commit 50155e1

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/frequenz/sdk/actor/resampling.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,13 @@ def average(samples: Sequence[Sample], resampling_period_s: float) -> float:
3333
"""Calculate average of the provided values.
3434
3535
Args:
36-
samples: sequences of samples to apply the average to
37-
resampling_period_s: value describing how often resampling should be performed,
38-
in seconds
36+
samples: sequences of samples to apply the average to. It must be
37+
non-empty.
38+
resampling_period_s: value describing how often resampling should be
39+
performed, in seconds
3940
4041
Returns:
4142
average of all the sample values
42-
43-
Raises:
44-
AssertionError if there are no provided samples
4543
"""
4644
assert len(samples) > 0, "Average cannot be given an empty list of samples"
4745
values = list(sample.value for sample in samples if sample.value is not None)

0 commit comments

Comments
 (0)