mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-01 07:38:11 +08:00
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:
co-authored by
Matt Weiden
parent
db7a485796
commit
d99b84ba09
@@ -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)
|
||||
|
||||
@@ -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)))
|
||||
Reference in New Issue
Block a user