html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/6847#issuecomment-1201147133,https://api.github.com/repos/pydata/xarray/issues/6847,1201147133,IC_kwDOAMm_X85HmAz9,8914493,2022-08-01T12:38:12Z,2022-08-01T12:38:12Z,NONE,"> Do you have to go through `__array__` (see #6845) or would accessing the underlying array using `DataArray.data` work for you? > > We could also add some properties under the `DataArray.cupy` namespace for convenience (See https://github.com/xarray-contrib/cupy-xarray) > > It'd be good to see a minimal example showcasing the operations you'd like to work. This would also make a great contribution to https://cupy-xarray.readthedocs.io/ Yes, I'll share a workflow example shortly. Ideally I'd like it to be agnostic, rather than CuPy, for example using Numba mapped arrays for arrays which are larger then GPU RAM. I have several which are a lot larger then the 48GB on the RTX8000 GPUs I'm using for this. I have a mix of a dataframe with points of interest, spatial references tables for coordinate transformation (similar to NTv2 grids), and then use interpolation to estimate characteristics from data in a NetCDF file around the local points of interest. At present I have a workaround where I convert the NetCDF file into a dictionary of arrays which is pickled. The image below shows the mapped output of this process on UK rainfall in 2019 (Data source: UK Met Office) ![image](https://user-images.githubusercontent.com/8914493/182149199-57347f5b-f8fd-48f9-843a-6d3e86f4e12e.png) ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1322112135 https://github.com/pydata/xarray/issues/6847#issuecomment-1201138802,https://api.github.com/repos/pydata/xarray/issues/6847,1201138802,IC_kwDOAMm_X85Hl-xy,8914493,2022-08-01T12:30:26Z,2022-08-01T12:30:26Z,NONE,"> I think ideally you could pass a `DataArray` to something that takes GPU arrays (like Numba kernels). If that doesn't make sense then perhaps passing the `DataArray.data` would be simpler. @rabernat made some [interesting points on Twitter](https://twitter.com/rabernat/status/1553003580122169344?s=20&t=oPBm0sFl0yaOxV-xKpPCnA) around not doing this though. My thoughts were similar until I read **@rabernat**'s comments as well and I see his point. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1322112135 https://github.com/pydata/xarray/issues/6847#issuecomment-1199531335,https://api.github.com/repos/pydata/xarray/issues/6847,1199531335,IC_kwDOAMm_X85Hf2VH,2448579,2022-07-29T15:26:19Z,2022-07-29T16:15:53Z,MEMBER,cc @jacobtomlinson as requested on Twitter,"{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1322112135 https://github.com/pydata/xarray/issues/6847#issuecomment-1199637580,https://api.github.com/repos/pydata/xarray/issues/6847,1199637580,IC_kwDOAMm_X85HgQRM,1610850,2022-07-29T16:10:12Z,2022-07-29T16:10:12Z,CONTRIBUTOR,I think ideally you could pass a `DataArray` to something that takes GPU arrays (like Numba kernels). If that doesn't make sense then perhaps passing the `DataArray.data` would be simpler. @rabernat made some [interesting points on Twitter](https://twitter.com/rabernat/status/1553003580122169344?s=20&t=oPBm0sFl0yaOxV-xKpPCnA) around not doing this though.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1322112135 https://github.com/pydata/xarray/issues/6847#issuecomment-1199524534,https://api.github.com/repos/pydata/xarray/issues/6847,1199524534,IC_kwDOAMm_X85Hf0q2,2448579,2022-07-29T15:23:26Z,2022-07-29T15:28:23Z,MEMBER,"Do you have to go through `__array__` (see #6845) or would accessing the underlying array using `DataArray.data` work for you? We could also add some properties under the `DataArray.cupy` namespace for convenience (See https://github.com/xarray-contrib/cupy-xarray) It'd be good to see a minimal example showcasing the operations you'd like to work. This would also make a great contribution to https://cupy-xarray.readthedocs.io/ ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1322112135