kmapper/visuals.py
changed.
Other files ignored by Codecov
test/test_visuals.py
has changed.
1 | 1 | # A small helper class to house functions needed by KeplerMapper.visualize |
|
2 | 2 | import numpy as np |
|
3 | + | import scipy.sparse |
|
3 | 4 | from sklearn import preprocessing |
|
4 | 5 | import json |
|
5 | 6 | from collections import defaultdict |
266 | 267 | if X_names.shape[0] == 0: |
|
267 | 268 | X_names = np.array(["f_%s" % (i) for i in range(X.shape[1])]) |
|
268 | 269 | ||
270 | + | # be explicit about the allowed sparse formats |
|
271 | + | if scipy.sparse.issparse(X): |
|
272 | + | if X.format not in ["csr", "csc"]: |
|
273 | + | raise ValueError( |
|
274 | + | f"sparse matrix format must be csr or csc but found {X.format}") |
|
275 | + | ||
269 | 276 | # wrap cluster_X_mean, X_mean, and X_std in np.array(---).squeeze() |
|
270 | 277 | # to get the same treatment for dense and sparse arrays |
|
271 | 278 | cluster_X_mean = np.array( |
Files | Coverage |
---|---|
kmapper | 78.65% |
Project Totals (10 files) | 78.65% |
3.6=.6 TRAVIS_OS_NAME=linux
3.7=.7 TRAVIS_OS_NAME=linux