Skip to content

Commit 8e20078

Browse files
authored
Merge pull request #55 from KrishnaswamyLab/dev
Bugfixes to address warnings from sklearn, anndata changes
2 parents 429aa54 + 8286f14 commit 8e20078

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ language: python
22
python:
33
- '3.5'
44
- '3.6'
5-
- 3.7-dev
5+
- '3.7'
6+
- '3.8'
67
cache:
78
- pip
89
- apt
@@ -29,4 +30,3 @@ deploy:
2930
branch: master
3031
after_success:
3132
- coveralls
32-

graphtools/graphs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def _check_duplicates(self, distances, indices):
288288
"Detected zero distance between {} pairs of samples. "
289289
"Consider removing duplicates to avoid errors in "
290290
"downstream processing.".format(
291-
np.sum(np.sum(distances[:, 1:] == 0))
291+
np.sum(np.sum(distances[:, 1:] == 0)) // 2
292292
),
293293
RuntimeWarning,
294294
)
@@ -408,7 +408,7 @@ def build_kernel_to_data(
408408
search_knn = min(search_knn * self.search_multiplier, knn_max)
409409
if search_knn > self.data_nu.shape[0] / 2:
410410
knn_tree = NearestNeighbors(
411-
search_knn, algorithm="brute", n_jobs=self.n_jobs
411+
n_neighbors=search_knn, algorithm="brute", n_jobs=self.n_jobs
412412
).fit(self.data_nu)
413413
if len(update_idx) > 0:
414414
if search_knn == knn_max:

graphtools/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.5.1"
1+
__version__ = "1.5.2"

test/test_estimator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def test_pca():
9595
def test_anndata_input():
9696
X = np.random.normal(0, 1, (10, 2))
9797
E = Estimator(verbose=0)
98-
E.fit(X)
98+
E.fit(X.astype(np.float32))
9999
E2 = Estimator(verbose=0)
100100
E2.fit(anndata.AnnData(X))
101101
np.testing.assert_allclose(

test/test_knn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_duplicate_data():
5151
RuntimeWarning,
5252
r"Detected zero distance between samples ([0-9and,\s]*). Consider removing duplicates to avoid errors in downstream processing.",
5353
):
54-
build_graph(np.vstack([data, data[:10]]), n_pca=20, decay=10, thresh=1e-4)
54+
build_graph(np.vstack([data, data[:9]]), n_pca=20, decay=10, thresh=1e-4)
5555

5656

5757
def test_duplicate_data_many():

0 commit comments

Comments
 (0)