Skip to content

Commit

Permalink
Merge pull request #74 from Pennycook/ignore-scipy-warning
Browse files Browse the repository at this point in the history
Ignore SciPy UserWarning about axis limits
  • Loading branch information
Pennycook authored Mar 5, 2024
2 parents 9bfd0fb + 4cc08d6 commit 7bf04f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion codebasin/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import itertools as it
import json
import logging
import warnings

from codebasin import util

Expand Down Expand Up @@ -166,8 +167,10 @@ def clustering(output_name, setmap):
clusters = hierarchy.linkage(squareform(matrix), method="average")

# Plot dendrogram of hierarchical clustering
# Ignore SciPy warning about axis limits, because we override them
fig, ax = plt.subplots()
hierarchy.dendrogram(clusters, labels=platforms, orientation="right")
with warnings.catch_warnings(action="ignore"):
hierarchy.dendrogram(clusters, labels=platforms, orientation="right")
ax.set_xlim(xmin=0, xmax=1)
ax.axvline(x=divergence(setmap), linestyle="--", label="Average")
ax.text(
Expand Down
Binary file modified examples/single-source/single-source-dendrogram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7bf04f6

Please sign in to comment.