Skip to content

Commit

Permalink
Covered a few more edge conditions for scipy.cluster.hierarchy.is_val…
Browse files Browse the repository at this point in the history
…id_linkage.
  • Loading branch information
damian.eads committed Nov 25, 2008
1 parent 8dae4fa commit 7c6ceaa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scipy/cluster/hierarchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1241,11 +1241,11 @@ def is_valid_linkage(Z, warning=False, throw=False, name=None):
raise ValueError('Linkage \'%s\' uses the same cluster more than once.' % name)
else:
raise ValueError('Linkage uses the same cluster more than once.')
if _check_hierarchy_not_all_clusters_used(Z):
if name:
raise ValueError('Linkage \'%s\' does not use all clusters.' % name)
else:
raise ValueError('Linkage does not use all clusters.')
# if _check_hierarchy_not_all_clusters_used(Z):
# if name:
# raise ValueError('Linkage \'%s\' does not use all clusters.' % name)
# else:
# raise ValueError('Linkage does not use all clusters.')
except Exception, e:
if throw:
raise
Expand Down

0 comments on commit 7c6ceaa

Please sign in to comment.