Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
rename to indexed
Browse files Browse the repository at this point in the history
  • Loading branch information
Koncopd committed Nov 20, 2023
1 parent 62ee801 commit 7615a80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lnschema_core/mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class BackedAccessor:
pass


class ListDataset:
class IndexedDataset:
pass


Expand Down
13 changes: 9 additions & 4 deletions lnschema_core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
from lamindb_setup import _check_instance_setup
from upath import UPath

from lnschema_core.mocks import AnnDataAccessor, BackedAccessor, ListDataset, QuerySet
from lnschema_core.mocks import (
AnnDataAccessor,
BackedAccessor,
IndexedDataset,
QuerySet,
)
from lnschema_core.types import (
AnnDataLike,
CharField,
Expand Down Expand Up @@ -2063,12 +2068,12 @@ def from_anndata(
"""
pass

def filelist_dataset(
def indexed(
self,
labels: Optional[Union[str, List[str]]] = None,
encode_labels: bool = True,
stream: bool = False,
) -> "ListDataset":
) -> "IndexedDataset":
"""Make a dataset to use with dataloaders.
Works only with AnnData files, the files should have the same label keys and variables.
Expand All @@ -2077,7 +2082,7 @@ def filelist_dataset(
>>> import lamindb as ln
>>> from torch.utils.data import DataLoader
>>> dataset = ln.Dataset.filter(description="my dataset").one()
>>> ds = dataset.filelist_dataset(labels=["cell_type", "batch"])
>>> ds = dataset.indexed(labels=["cell_type", "batch"])
>>> dl = Dataloader(ds, batch_size=128, shuffle=True)
"""
pass
Expand Down

0 comments on commit 7615a80

Please sign in to comment.