Skip to content

Commit

Permalink
address remaining comments
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-sheep committed Feb 13, 2024
1 parent 2bbbb91 commit 7ebfc51
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
6 changes: 0 additions & 6 deletions anndata/_core/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,12 +1007,6 @@ def axis_indices(adata: AnnData, axis: Literal["obs", 0, "var", 1]) -> pd.Index:
return getattr(adata, f"{axis_name}_names")


def axis_size(adata: AnnData, axis: Literal["obs", 0, "var", 1]) -> int:
"""Helper function to get adata.shape[dim]."""
ax, _ = _resolve_axis(axis)
return adata.shape[ax]


# TODO: Resolve https://github.com/scverse/anndata/issues/678 and remove this function
def concat_Xs(adatas, reindexers, axis, fill_value):
"""
Expand Down
4 changes: 2 additions & 2 deletions anndata/tests/test_awkward.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
[ak.to_regular(ak.Array([["a", "b"], ["c", "d"], ["e", "f"]]), 1), (3, 2)],
],
)
def test_dim_len(array, shape):
"""Test that dim_len returns the right value for awkward arrays."""
def test_axis_len(array, shape):
"""Test that axis_len returns the right value for awkward arrays."""
for axis, size in enumerate(shape):
assert size == axis_len(array, axis)

Expand Down
5 changes: 0 additions & 5 deletions anndata/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,3 @@ def is_hidden(attr) -> bool:
for item in type.__dir__(cls)
if not is_hidden(getattr(cls, item, None))
]


@deprecated("axis_len", FutureWarning)
def dim_len(x, axis: Literal[0, 1]) -> int | None:
return axis_len(x, axis)

0 comments on commit 7ebfc51

Please sign in to comment.