Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ __pycache__/
.ipynb_checkpoints

# docs
/docs/generated/
/docs/_build/
/docs/generated/*
!/docs/generated/anndata.types.ExtensionNamespace.rst

# IDEs
/.idea/
Expand Down
9 changes: 6 additions & 3 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,14 @@ Types used by the former:
Types used by the former:

```{eval-rst}
.. autosummary::
:toctree: generated/
.. toctree::
:hidden:

types.ExtensionNamespace
generated/anndata.types.ExtensionNamespace
```

{class}`scverse_misc.ExtensionNamespace`

(errors-api)=

## Errors and warnings
Expand All @@ -241,6 +243,7 @@ Types used by the former:

settings
settings.override
settings.reset
```

(types-api)=
Expand Down
7 changes: 6 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"sphinx_design",
"sphinxext.opengraph",
"scanpydoc", # needs to be before linkcode
"scverse_misc.sphinx_ext",
"sphinx.ext.linkcode",
"IPython.sphinxext.ipython_console_highlighting",
*(p.stem for p in _extension_dir.glob("*.py")),
Expand Down Expand Up @@ -136,11 +137,11 @@ def res(
pandas=("https://pandas.pydata.org/pandas-docs/version/2.3", None),
python=("https://docs.python.org/3", None),
scipy=("https://docs.scipy.org/doc/scipy", None),
scverse_misc=("https://scverse-misc.readthedocs.io/stable", None),
sklearn=("https://scikit-learn.org/stable", None),
xarray=("https://docs.xarray.dev/en/stable", None),
zarr=("https://zarr.readthedocs.io/en/stable/", None),
zarrs=("https://zarrs-python.readthedocs.io/en/stable/", None),
scverse_misc=("https://scverse-misc.readthedocs.io/stable", None),
annbatch=("https://annbatch.readthedocs.io/en/stable/", None),
)

Expand Down Expand Up @@ -175,6 +176,10 @@ def res(
"awkward.highlevel.Array": "ak.Array",
"numpy.int64": ("py:attr", "numpy.int64"),
"numpy.dtypes.StringDType": ("py:attr", "numpy.dtypes.StringDType"),
"numpy._typing._array_like.NDArray": ("py:data", "numpy.typing.NDArray"),
# For some reason after https://github.com/numpy/numpy/commit/cc5aaf2cc744dfbc0a16c1d20607853874307333
# sphinx is still looking for this type here even though our min bound is 1.26
"numpy._typing._array_like.GenericAlias": ("py:class", "types.GenericAlias"),
"pandas.DataFrame.iloc": ("py:attr", "pandas.DataFrame.iloc"),
"pandas.DataFrame.loc": ("py:attr", "pandas.DataFrame.loc"),
"pandas.core.series.Series": "pandas.Series",
Expand Down
5 changes: 5 additions & 0 deletions docs/generated/anndata.types.ExtensionNamespace.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
anndata.types.ExtensionNamespace
================================

.. version-deprecated:: 0.13.0
Use :class:`scverse_misc.ExtensionNamespace` instead
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ doc = [
"sphinxext.opengraph",
"myst-nb",
"scanpydoc[theme,typehints] >=0.17.1",
"scverse-misc[sphinx]",
"awkward>=2.6.3",
"IPython", # For syntax highlighting in notebooks
"myst-parser",
Expand Down
18 changes: 15 additions & 3 deletions src/anndata/_core/extensions.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
from __future__ import annotations

import sys
import warnings

from scverse_misc import make_register_namespace_decorator

from .anndata import AnnData

__all__ = ["register_anndata_namespace"]


register_anndata_namespace = make_register_namespace_decorator(
AnnData, "adata", "register_anndata_namespace", "numpy"
)
if sys.version_info >= (3, 12):
register_anndata_namespace = make_register_namespace_decorator(AnnData, "adata")
else:
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
r".*argument is deprecated and will be removed in the future",
DeprecationWarning,
)
register_anndata_namespace = make_register_namespace_decorator(
AnnData, "adata", "register_anndata_namespace", "numpy"
)
9 changes: 3 additions & 6 deletions src/anndata/experimental/pytorch/_annloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ def compose_convert(arr):


# AnnLoader has the same arguments as DataLoader, but uses BatchIndexSampler by default
@deprecated(
Deprecation("0.12.17", "Use :class:`annbatch.Loader` instead of `AnnLoader`")
)
class AnnLoader(DataLoader):
"""\
PyTorch DataLoader for AnnData objects.
Expand All @@ -128,9 +131,6 @@ class AnnLoader(DataLoader):
:class:`~anndata.experimental.AnnCollection` object or from an `AnnCollectionView` object.
Takes care of the required conversions.

.. deprecated:: 0.12.17
Use :class:`annbatch.Loader` instead.

Parameters
----------
adatas
Expand All @@ -152,9 +152,6 @@ class AnnLoader(DataLoader):
arguments for `AnnCollection` initialization.
"""

@deprecated(
Deprecation("0.12.17", "Use {class}`annbatch.Loader` instead of `AnnLoader`")
)
@old_positionals("batch_size", "shuffle", "use_default_converter", "use_cuda")
def __init__(
self,
Expand Down