Skip to content

Commit 4b0b438

Browse files
committed
Add notes to calculate_mean_and_stdv for empty input handling
Clarify the behavior of the function when the input list is empty or contains only None values, specifying that it returns (0, 0).
1 parent 7cc70a6 commit 4b0b438

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/imcflibs/imagej/misc.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,14 @@ def calculate_mean_and_stdv(values_list, round_decimals=0):
115115
-------
116116
tuple of (float, float)
117117
Mean and standard deviation of the input list.
118+
119+
Notes
120+
-----
121+
Returns (0, 0) when:
122+
- The input list is empty
123+
- After filtering out None values, no elements remain
118124
"""
125+
119126
filtered_list = [x for x in values_list if x is not None]
120127

121128
if not filtered_list:

0 commit comments

Comments
 (0)