Skip to content

Commit

Permalink
Merge pull request #55 from KrishnaswamyLab/dev
Browse files Browse the repository at this point in the history
Bugfixes to address warnings from sklearn, anndata changes
  • Loading branch information
dburkhardt authored Aug 10, 2020
2 parents 429aa54 + 8286f14 commit 8e20078
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ language: python
python:
- '3.5'
- '3.6'
- 3.7-dev
- '3.7'
- '3.8'
cache:
- pip
- apt
Expand All @@ -29,4 +30,3 @@ deploy:
branch: master
after_success:
- coveralls

4 changes: 2 additions & 2 deletions graphtools/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def _check_duplicates(self, distances, indices):
"Detected zero distance between {} pairs of samples. "
"Consider removing duplicates to avoid errors in "
"downstream processing.".format(
np.sum(np.sum(distances[:, 1:] == 0))
np.sum(np.sum(distances[:, 1:] == 0)) // 2
),
RuntimeWarning,
)
Expand Down Expand Up @@ -408,7 +408,7 @@ def build_kernel_to_data(
search_knn = min(search_knn * self.search_multiplier, knn_max)
if search_knn > self.data_nu.shape[0] / 2:
knn_tree = NearestNeighbors(
search_knn, algorithm="brute", n_jobs=self.n_jobs
n_neighbors=search_knn, algorithm="brute", n_jobs=self.n_jobs
).fit(self.data_nu)
if len(update_idx) > 0:
if search_knn == knn_max:
Expand Down
2 changes: 1 addition & 1 deletion graphtools/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.5.1"
__version__ = "1.5.2"
2 changes: 1 addition & 1 deletion test/test_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def test_pca():
def test_anndata_input():
X = np.random.normal(0, 1, (10, 2))
E = Estimator(verbose=0)
E.fit(X)
E.fit(X.astype(np.float32))
E2 = Estimator(verbose=0)
E2.fit(anndata.AnnData(X))
np.testing.assert_allclose(
Expand Down
2 changes: 1 addition & 1 deletion test/test_knn.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_duplicate_data():
RuntimeWarning,
r"Detected zero distance between samples ([0-9and,\s]*). Consider removing duplicates to avoid errors in downstream processing.",
):
build_graph(np.vstack([data, data[:10]]), n_pca=20, decay=10, thresh=1e-4)
build_graph(np.vstack([data, data[:9]]), n_pca=20, decay=10, thresh=1e-4)


def test_duplicate_data_many():
Expand Down

0 comments on commit 8e20078

Please sign in to comment.