Skip to content

Commit

Permalink
document zarr functions properly
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-sheep committed Sep 23, 2024
1 parent 045d7c9 commit 9b4b4f5
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/anndata/io.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

from typing import TYPE_CHECKING

from ._core.sparse_dataset import sparse_dataset
from ._io.h5ad import read_h5ad, write_h5ad
from ._io.read import (
Expand All @@ -14,17 +16,19 @@
from ._io.specs import read_elem, write_elem
from ._io.write import write_csvs, write_loom

if TYPE_CHECKING:
from ._core.anndata import AnnData

def read_zarr(*args, **kw):
from ._io.zarr import read_zarr

return read_zarr(*args, **kw)

try:
from ._io.zarr import read_zarr, write_zarr
except ImportError as e:
_zarr_exc = e

Check warning on line 25 in src/anndata/io.py

View check run for this annotation

Codecov / codecov/patch

src/anndata/io.py#L24-L25

Added lines #L24 - L25 were not covered by tests

def write_zarr(*args, **kw):
from ._io.zarr import write_zarr
def read_zarr(*_, **__) -> AnnData:
raise _zarr_exc from None

Check warning on line 28 in src/anndata/io.py

View check run for this annotation

Codecov / codecov/patch

src/anndata/io.py#L27-L28

Added lines #L27 - L28 were not covered by tests

return write_zarr(*args, **kw)
def write_zarr(*_, **__) -> None:
raise _zarr_exc from None

Check warning on line 31 in src/anndata/io.py

View check run for this annotation

Codecov / codecov/patch

src/anndata/io.py#L30-L31

Added lines #L30 - L31 were not covered by tests


__all__ = [
Expand Down

0 comments on commit 9b4b4f5

Please sign in to comment.