Skip to content

Commit 9acb694

Browse files
stability of seriation
1 parent c586053 commit 9acb694

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

precise/skaters/covarianceutil/covfunctions.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,15 @@ def to_symmetric(a):
2525
def seriation(cov, d=None):
2626
if d is None:
2727
d = cov_distance(cov=cov)
28-
d_square = to_symmetric( squareform(d) )
29-
clusters = linkage(d_square, method='single',optimal_ordering=True)
30-
return leaves_list(clusters)
28+
try:
29+
d_square = squareform( to_symmetric(d) )
30+
clusters = linkage(d_square, method='single',optimal_ordering=True)
31+
return leaves_list(clusters)
32+
except Exception as e:
33+
print('Strange error in seriation ')
34+
print(e)
35+
n = np.shape(cov)[0]
36+
return [i for i in range(n)]
3137

3238

3339
def cov_to_corrcoef(a):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name="precise",
10-
version="0.9.5",
10+
version="0.10.0",
1111
description="Online covariance, precision, portfolios and ensembles",
1212
long_description=README,
1313
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)