Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgayoso committed Dec 28, 2023
1 parent 1a5d0f9 commit 78aaca2
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 9 deletions.
38 changes: 31 additions & 7 deletions docs/notebooks/large_scale.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": [
"keep_output"
]
},
"outputs": [],
"source": [
"adata"
Expand All @@ -65,7 +69,11 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": [
"keep_output"
]
},
"outputs": [],
"source": [
"# Number of unique cell types\n",
Expand Down Expand Up @@ -205,7 +213,11 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": [
"keep_output"
]
},
"outputs": [],
"source": [
"import time\n",
Expand Down Expand Up @@ -241,7 +253,11 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": [
"keep_output"
]
},
"outputs": [],
"source": [
"bm.plot_results_table()"
Expand All @@ -250,7 +266,11 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": [
"keep_output"
]
},
"outputs": [],
"source": [
"bm.plot_results_table(min_max_scale=False)"
Expand All @@ -267,7 +287,11 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": [
"keep_output"
]
},
"outputs": [],
"source": [
"from rich import print\n",
Expand All @@ -293,7 +317,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
"version": "3.10.13"
},
"vscode": {
"interpreter": {
Expand Down
5 changes: 3 additions & 2 deletions tests/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ def test_compute_simpson_index():
D = scib_metrics.utils.cdist(X, X)
nbrs = NearestNeighbors(n_neighbors=30, algorithm="kd_tree").fit(X)
D, knn_idx = nbrs.kneighbors(X)
row_idx = np.arange(X.shape[0])[:, None]
scib_metrics.utils.compute_simpson_index(
jnp.array(D), jnp.array(knn_idx), jnp.array(labels), len(np.unique(labels))
jnp.array(D), jnp.array(knn_idx), jnp.array(row_idx), jnp.array(labels), len(np.unique(labels))
)


Expand All @@ -72,7 +73,7 @@ def test_lisi_knn():
harmonypy_lisi_res = harmonypy_lisi(
X, pd.DataFrame(labels, columns=["labels"]), label_colnames=["labels"], perplexity=10
)[:, 0]
assert np.testing.assert_allclose(lisi_res, harmonypy_lisi_res)
np.testing.assert_allclose(lisi_res, harmonypy_lisi_res)


def test_ilisi_clisi_knn():
Expand Down

0 comments on commit 78aaca2

Please sign in to comment.