Skip to content

Commit 7815890

Browse files
Copilotxadupre
andauthored
chore: name sankey flow balance tolerance constant
Agent-Logs-Url: https://github.com/sdpython/teachpyx/sessions/68526f45-813e-4c5a-959d-84afb8a8544a Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
1 parent ba232cc commit 7815890

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

teachpyx/faq/faq_python.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import os
55
import re
66

7+
FLOW_BALANCE_TOLERANCE = 1e-10
8+
79

810
def entier_grande_taille():
911
"""
@@ -869,7 +871,7 @@ def graph_sankey(
869871
"""
870872
if len(flows) < 2:
871873
raise ValueError("flows must contain at least two values.")
872-
if abs(sum(flows)) > 1e-10:
874+
if abs(sum(flows)) > FLOW_BALANCE_TOLERANCE:
873875
raise ValueError("The sum of all flows must be 0.")
874876
if labels is None:
875877
labels = [None] * len(flows)

0 commit comments

Comments
 (0)