From f49e23f3ad8dabab29ae8640152b880fb6169e95 Mon Sep 17 00:00:00 2001 From: Riskfolio Date: Fri, 19 Jul 2024 23:58:25 -0500 Subject: [PATCH] Format files --- riskfolio/src/AuxFunctions.py | 2 +- riskfolio/src/PlotFunctions.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/riskfolio/src/AuxFunctions.py b/riskfolio/src/AuxFunctions.py index c9acab7b..440864ac 100644 --- a/riskfolio/src/AuxFunctions.py +++ b/riskfolio/src/AuxFunctions.py @@ -723,7 +723,7 @@ def two_diff_gap_stat(dist, clustering, max_k=10): for k in cluster_k: if k == 1: W_list.append(-np.inf) - elif k > min(max_k, np.sqrt(n))+2: + elif k > min(max_k, np.sqrt(n)) + 2: break else: level = cluster_lvls[level_k[cluster_k.index(k)]] # get k clusters diff --git a/riskfolio/src/PlotFunctions.py b/riskfolio/src/PlotFunctions.py index 5953aa92..4feca4fb 100644 --- a/riskfolio/src/PlotFunctions.py +++ b/riskfolio/src/PlotFunctions.py @@ -2882,7 +2882,7 @@ def plot_clusters( root, nodes = hr.to_tree(clustering, rd=True) nodes = np.array([i.dist for i in nodes]) nodes.sort() - leaders_threshold = nodes[np.max(L)+1] + leaders_threshold = nodes[np.max(L) + 1] color_threshold = np.max(leaders_threshold) colors = af.color_list(k) hr.set_link_color_palette(colors) @@ -3185,7 +3185,7 @@ def plot_dendrogram( root, nodes = hr.to_tree(clustering, rd=True) nodes = np.array([i.dist for i in nodes]) nodes.sort() - leaders_threshold = nodes[np.max(L)+1] + leaders_threshold = nodes[np.max(L) + 1] color_threshold = np.max(leaders_threshold) colors = af.color_list(k) # color list hr.set_link_color_palette(colors)