Important bug fix--somehow, either through a change in atleast_2d() or scipy.spatial.distance.cdist(), the distance matrix calculation was producing an error. Removing a few transposes when defining those distance vectors fixes the problem.