prepare - work around anndata bug (#1260)

* work around anndata bug 344

* fix accidental cut and paste error

* Use modified make_index_unique function

Temporarily copy code from https://github.com/theislab/anndata/pull/345
until the issue is resolved and released.

* Add notes and test for make_index_unique

* Lint fix

* Format python

Co-authored-by: Matt Weiden <538456+mweiden@users.noreply.github.com>
This commit is contained in:
Bruce Martin
2020-03-22 12:27:59 -07:00
committed by GitHub
co-authored by Matt Weiden
parent db7a485796
commit d99b84ba09
7 changed files with 86 additions and 29 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ class AdaptorTest(unittest.TestCase):
"single_dataset__var_names": None,
"diffexp__lfc_cutoff": 0.01,
"adaptor__anndata_adaptor__backed": self.backed,
"single_dataset__datapath" : self.data_locator
"single_dataset__datapath": self.data_locator,
}
config = AppConfig()
config.update(**args)
+15
View File
@@ -0,0 +1,15 @@
import unittest
import pandas as pd
from server.cli.prepare import make_index_unique
class CLIPrepareTests(unittest.TestCase):
""" Test cases for CLI prepare logic """
def test_make_index_unique(self):
index = pd.Index(["SNORD113", "SNORD113", "SNORD113-1"])
result = make_index_unique(index)
expected = pd.Index(["SNORD113", "SNORD113-2", "SNORD113-1"])
self.assertTrue(all(left == right for left, right in zip(result.values, expected.values)))