Issue 1:
The documentation for the function, scipy.cluster.hierarchy.linkage, claims that the function can receive either a condensed (1D) or redundant distance matrix. Alternatively, the original observation vectors can also be given as well, and scipy.cluster.hierarchy.linkage will use scipy.spatial.distance.pdist to calculate the distance matrix.

It seems to me, from testing as well as reading the code, that scipy.cluster.hierarchy.linkage cannot handle redundant distance matrices. According to the code, if the dimension of the input array is 2, then it goes ahead and treats it as a matrix of original observation vectors.

from line 636 in scipy/cluster/hierarchy.py 0.14.0

elif len(s) == 2:
X = y
n = s[0]
m = s[1]
if method not in _cpy_linkage_methods:
raise ValueError('Invalid method: %s' % method)
if method in _cpy_non_euclid_methods:
dm = distance.pdist(X, metric)
Z = np.zeros((n - 1, 4))
_hierarchy_wrap.linkage_wrap(dm, Z, n,
int(_cpy_non_euclid_methods[method]))
elif method in _cpy_euclid_methods:
if metric != 'euclidean':
raise ValueError(("Method '%s' requires the distance metric "
"to be euclidean") % method)
dm = distance.pdist(X, metric)
Z = np.zeros((n - 1, 4))
_hierarchy_wrap.linkage_euclid_wrap(dm, Z, X, m, n,
int(_cpy_euclid_methods[method]))

where s is the shape tuple of the input matrix.

To fix, the documentation should either be corrected, or perhaps scipy.spatial.distance.is_valid_dm should be used to assess whether the input 2D array is a redundant distance matrix versus a vector of observations.

Issue 2:
the document for scipy.cluster.hierarchy.linkage() function states that it accepts redundant distance matrix as input:

http://docs.scipy.org/doc/scipy/reference/generated/scipy.cluster.hierarchy.linkage.html

"y : ndarray

A condensed or redundant distance matrix. A condensed distance matrix is a flat array containing the upper triangular of the distance matrix. This is the form that pdist returns. Alternatively, a collection of m observation vectors in n dimensions may be passed as an m by n array."

This feature of accepting redundant distance matrix as input is also introduced by many popular books like "SciPy and NumPy: An Overview for Developers" By Eli Bressert:

http://books.google.co.uk/books?id=c-xzkDMDev0C&pg=PA48&dq=scipy+linkage+input&hl=en&sa=X&ei=4BzUUZqpNoSbPaj3gLgN&ved=0CDgQ6AEwAQ#v=onepage&q=scipy%20linkage%20input&f=false

However, when distance matrix is specified as input to the linkage() function, it is silently considered to be observation vectors. This can be seen by reading the source code :

https://github.com/scipy/scipy/blob/master/scipy/cluster/hierarchy.py

If the input is a 2-dimensional matrix, it is not checked by predicate scipy.spatial.distance.is_valid_dm(). Rather, it is simply taken as observation vectors for hierarchical clustering. It may be also seen from the following example:

arr = scipy.array([[0,5],[1,5],[-1,5],[0,-5],[1,-5],[-1,-5], [-1.1,-5]])
pd = pdist(arr)
dm = squareform(pd)
linkage(pd)
linkage(dm) # result is different from the previous

I think this issue has relatively serious consequence if users do not check their clustering results carefully.

I suggest: either update the documentation for linkage() function to reflect the real functionality, or add a predicate check using scipy.spatial.distance.is_valid_dm() if two dimensional matrix is given as input so distance matrix is processed properly in the linkage() function.