def test_anndata_loader():
    x = np.random.randint(low=0, high=100, size=(15, 4))
    batch_ids = np.random.randint(low=0, high=2, size=(15,))
    n_batches = 2
    adata = AnnData(X=x, obs=dict(batch=batch_ids))
    _ = AnnDatasetFromAnnData(adata, batch_label='batch')
    dataset = AnnDatasetFromAnnData(adata, batch_label='batch')
    assert (dataset.n_batches == n_batches), 'AnnDatasetFromAnnData should not modify the anndata object'
def test_anndata_loader():
    x = np.random.randint(low=0, high=100, size=(15, 4))
    batch_ids = np.random.randint(low=0, high=2, size=(15,))
    n_batches = 2
    adata = AnnData(X=x, obs=dict(batch=batch_ids))
    _ = AnnDatasetFromAnnData(adata, batch_label='batch')
    dataset = AnnDatasetFromAnnData(adata, batch_label='batch')
    assert (dataset.n_batches == n_batches), 'AnnDatasetFromAnnData should not modify the anndata object'