Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(chore): remove anndata.read #1766

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions docs/release-notes/1766.breaking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove `anndata.read` {user}`ilan-gold`
13 changes: 0 additions & 13 deletions src/anndata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,6 @@
# We use these in tests by attribute access
from . import logging # noqa: F401, E402 isort: skip


def read(*args, **kwargs):
import warnings

warnings.warn(
"`anndata.read` is deprecated, use `anndata.read_h5ad` instead. "
"`ad.read` will be removed in mid 2024.",
FutureWarning,
)
return read_h5ad(*args, **kwargs)


_DEPRECATED_IO = (
"read_loom",
"read_hdf",
Expand Down Expand Up @@ -89,7 +77,6 @@ def __getattr__(attr_name: str) -> Any:
"concat",
"read_zarr",
"read_h5ad",
"read",
# Warnings
"OldFormatWarning",
"WriteWarning",
Expand Down
12 changes: 1 addition & 11 deletions tests/test_deprecations.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from scipy import sparse

import anndata.experimental
from anndata import AnnData, read
from anndata import AnnData
from anndata.tests.helpers import assert_equal


Expand Down Expand Up @@ -117,16 +117,6 @@ def test_deprecated_write_attribute(tmp_path):
assert_equal(A, attribute_A)


def test_deprecated_read(tmp_path):
memory = AnnData(np.random.randn(20, 10))
memory.write_h5ad(tmp_path / "file.h5ad")

with pytest.warns(FutureWarning, match=r"`anndata.read` is deprecated"):
from_disk = read(tmp_path / "file.h5ad")

assert_equal(memory, from_disk)


@pytest.mark.parametrize(
("old_name", "new_name", "module"),
(
Expand Down
Loading