-
Notifications
You must be signed in to change notification settings - Fork 160
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
(fix): correct typing of AnnData.X
#1616
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1616 +/- ##
==========================================
- Coverage 86.85% 84.32% -2.53%
==========================================
Files 37 37
Lines 6027 6005 -22
==========================================
- Hits 5235 5064 -171
- Misses 792 941 +149
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn’t we unify this with ArrayDataStructureType
?
I don’t quite know why that one is an enum, maybe we can replace it with
ArrayDataStructureType = Union[All|Of|This|Here]
and then do
from typing import get_args
isinstance(get_args(ArrayDataStructureType))
I also didn't know but don't really question these sorts of things. I imagine it served a purpose at some point, but like I said in the related PR, that seems to have changed recently. |
I guess then we should unify the two. Either as part of this PR or later, as you wish |
We could maybe use import array_api_compat
class ArrayApiMeta(type):
def __instancecheck__(cls, instance: object) -> bool:
return array_api_compat.is_array_api_obj(instance)
class ArrayApi(meta=ArrayApiMeta):
pass |
I'm going to push back on the array-api here because I think it's out of scope and testing for it will be non-trivial. I think we should make a separate branch/PR for that specifically, and stick it in |
There's even an issue for this: #1195. I will milestone/sprint it so we have it on the radar now. |
Co-authored-by: Ilan Gold <ilanbassgold@gmail.com>
read_elem
andwrite_elem
from the main package #1598 (comment)