Skip to content

Commit

Permalink
minor fix for streaming correcly streaming anndata
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzocerrone committed Dec 4, 2024
1 parent 0428634 commit 98c30df
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
9 changes: 1 addition & 8 deletions docs/notebooks/image.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"source": [
"# Images/Labels/Tables\n",
"\n",
"In this notebook we will show how to use the `Image`, `Label` and `Table` objects."
"In this notebook we will show how to use the `Image`, `Label` and `Table` objects to do image processing."
]
},
{
Expand Down Expand Up @@ -305,13 +305,6 @@
"\n",
"feat_table.table"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ classifiers = [
# add your package dependencies here
dependencies = [
"numpy",
"anndata",
"anndata>=0.8.0,<0.11.0",
"pydantic",
"pandas>=1.2.0",
"requests",
Expand All @@ -52,6 +52,7 @@ test = ["zarr<3", "pytest", "pytest-cov"]

dev2 = [
"zarr<3",
"plotly",
"dask[distributed]",
"dask-image",
"napari",
Expand Down
20 changes: 11 additions & 9 deletions src/ngio/tables/_ad_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,22 @@ def custom_read_zarr(store: StoreOrGroup) -> AnnData:
def callback(func: Callable, elem_name: str, elem: Any, iospec: Any) -> Any:
if iospec.encoding_type == "anndata" or elem_name.endswith("/"):
ad_kwargs = {}
# Some of these elem fail on https
# So we only include the ones that are strictly necessary
# for fractal tables
base_elem = [
"X",
"layers",
# "layers",
"obs",
"obsm",
"obsp",
"uns",
# "obsm",
# "obsp",
# "uns",
"var",
"varm",
"varp",
# "varm",
# "varp",
]
# This should make sure that the function behaves the same as the original
# implementation.
base_elem += list(elem.keys())
# This fails on some https
# base_elem += list(elem.keys())
for k in set(base_elem):
v = elem.get(k)
if v is not None and not k.startswith("raw."):
Expand Down

0 comments on commit 98c30df

Please sign in to comment.