mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-15 20:57:56 +08:00
* 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>
16 lines
491 B
Python
16 lines
491 B
Python
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)))
|