Skip to content

Commit

Permalink
add module info to allowed types
Browse files Browse the repository at this point in the history
  • Loading branch information
eroell committed Mar 3, 2024
1 parent f0d3a6e commit f00a551
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion anndata/_core/anndata.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""\
Main class and helper functions.
"""

from __future__ import annotations

import collections.abc as cabc
Expand Down Expand Up @@ -512,7 +513,10 @@ def _init_as_actual(
if isinstance(X, s_type.value):
break
else:
class_names = ", ".join(c.__name__ for c in StorageType.classes())
class_names = ", ".join(

Check warning on line 516 in anndata/_core/anndata.py

View check run for this annotation

Codecov / codecov/patch

anndata/_core/anndata.py#L516

Added line #L516 was not covered by tests
f"{c.__module__}.{c.__name__}" for c in StorageType.classes()
)

raise ValueError(
f"`X` needs to be of one of {class_names}, not {type(X)}."
)
Expand Down

0 comments on commit f00a551

Please sign in to comment.