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/7515#issuecomment-1423258353,https://api.github.com/repos/pydata/xarray/issues/7515,1423258353,IC_kwDOAMm_X85U1TLx,2443309,2023-02-08T21:24:45Z,2023-02-08T21:24:45Z,MEMBER,"Here's a small example to get things started:
```python
x = aesara.shared(np.random.standard_normal((3, 4)))
xda = xr.DataArray(x, dims=('x', 'y'))
```
this currently returns the following error:
```python traceback
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[138], line 2
1 x = aesara.shared(np.random.standard_normal((3, 4)))
----> 2 xda = xr.DataArray(x, dims=('x', 'y'))
File ~/miniforge3/envs/demo-env/lib/python3.10/site-packages/xarray/core/dataarray.py:428, in DataArray.__init__(self, data, coords, dims, name, attrs, indexes, fastpath)
426 data = _check_data_shape(data, coords, dims)
427 data = as_compatible_data(data)
--> 428 coords, dims = _infer_coords_and_dims(data.shape, coords, dims)
429 variable = Variable(dims, data, attrs, fastpath=True)
430 indexes, coords = _create_indexes_from_coords(coords)
File ~/miniforge3/envs/demo-env/lib/python3.10/site-packages/xarray/core/dataarray.py:142, in _infer_coords_and_dims(shape, coords, dims)
140 dims = tuple(dims)
141 elif len(dims) != len(shape):
--> 142 raise ValueError(
143 ""different number of dimensions on data ""
144 f""and dims: {len(shape)} vs {len(dims)}""
145 )
146 else:
147 for d in dims:
ValueError: different number of dimensions on data and dims: 0 vs 2
```
This tells me there is a bit of work to do at the core of Aesara's numpy compatibility. Xarray will make frequent references to attributes like `data.shape`, `data.ndim`, etc expecting to get numpy-like results.
","{""total_count"": 3, ""+1"": 3, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1575494367
https://github.com/pydata/xarray/issues/7515#issuecomment-1422987752,https://api.github.com/repos/pydata/xarray/issues/7515,1422987752,IC_kwDOAMm_X85U0RHo,2443309,2023-02-08T17:29:36Z,2023-02-08T17:29:36Z,MEMBER,"Thanks all for the discussion. Welcome @brandonwillard, @twiecki, and @rlouf to the Xarray project. And thanks to @rabernat and @TomNicholas for helping orient the conversation.
As a next step, I think it would be fun to try putting an Aesara array into Xarray and see how it goes. In our experience, this process inevitably brings up a few issues where interaction between Xarray and Aesara developers is fruitful.","{""total_count"": 3, ""+1"": 3, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1575494367