-
Notifications
You must be signed in to change notification settings - Fork 13
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 broken doctest and tests on accessors #46
Conversation
Output type is now just `cupy.ndarray` instead of `cupy.core.core.ndarray`. Also updated pytest command in contributing.rst to include `--doctest-modules` flag.
cupy_xarray/tests/test_accessors.py
Outdated
dsk = DuckArrayModule("dask") | ||
dask_array_type = dsk.type |
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.
Let's just not do that
dsk = DuckArrayModule("dask") | |
dask_array_type = dsk.type | |
try: | |
import dask.array | |
dask_array_type = dask.array.Array | |
else: | |
dask_array_type = None |
There is some new importlib
way of doing this that I can't remember now
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.
Ok, done at 6229f99.
There is some new
importlib
way of doing this that I can't remember now
Do you mean importlib.util.find_spec
? That would allow us to get to the dask.array
module, but not the dask.array.Array
type. Unless there's another function I'm missing.
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.
yeah that one but maybe it's not a big deal here/
Co-Authored-By: Deepak Cherian <[email protected]>
Couple of tests to fix when running
pytest --verbose --doctest-modules cupy_xarray
:cupy_xarray.accessors.CupyDataArrayAccessor.as_cupy
, output type should now becupy.ndarray
instead ofcupy.core.core.ndarray
ModuleNotFoundError: No module named 'xarray.core.pycompat'
when running onxarray=2024.6.0
. Need to apply a patch similar in concept to Fix broken dask_array_type import #24, but without importingxarray.core.pycompat
(since it is a private function?). Specifically, change thefrom xarray.core.pycompat import dask_array_type
line to:Partially cherry-picked from #45. These changes will need to be tested locally with a CUDA GPU device for now, until we can get CI working somehow.