Skip to content

Commit 73cac7f

Browse files
authored
Merge pull request #307 from OscarVanL/zerodivisionfix
Fixed ZeroDivisionError when mfa_longer list is empty
2 parents 5eee804 + d0ce1b3 commit 73cac7f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/mfa_extraction/fix_mismatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def fix(base_path: str, dur_path: str, trimmed_dur_path: str, use_norm: str):
105105

106106
logging.info(
107107
f"{t} stats: number of mfa with longer duration: {len(mfa_longer)}, total diff: {sum(mfa_longer)}"
108-
f", mean diff: {sum(mfa_longer)/len(mfa_longer)}"
108+
f", mean diff: {sum(mfa_longer)/len(mfa_longer) if len(mfa_longer) > 0 else 0}"
109109
)
110110
logging.info(
111111
f"{t} stats: number of mfa with shorter duration: {len(mfa_shorter)}, total diff: {sum(mfa_shorter)}"

0 commit comments

Comments
 (0)