issues
2 rows where type = "issue" and user = 29361544 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: created_at (date), updated_at (date), closed_at (date)
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at ▲ | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1600983717 | I_kwDOAMm_X85fbRKl | 7563 | MultiIndex coordinates do not exist updating v2022.3 to v2022.12 | lkugler 29361544 | closed | 0 | 1 | 2023-02-27T11:17:34Z | 2023-08-29T14:23:30Z | 2023-08-29T14:23:30Z | NONE | What happened?Hi, thank you all for this amazing tool and its capabilities. I noticed my code breaking from an update of xarray of v2022.3 to v2022.12 I wanted to select the latitude inside the MultiIndex position=(lat, lon) but in the new version it doesn't seem to exist when I overwrite an existing index. It works though, when the DataArray is created with the MultiIndex in the first place. See the code example below. In the meantime I will use xarray v2022.3 Thank you! What did you expect to happen?In v2022.3 the output would be (selecting latitudes) ```python
``` Minimal Complete Verifiable Example```Python import xarray as xr import numpy as np import pandas as pd print(xr.version) def test_xarray_multiindex(): mda = xr.DataArray(np.random.rand(4), coords={"position": pd.Index([0.1, 0.2, 0.7, 0.9], name='position')}, dims="position") midx = pd.MultiIndex.from_arrays([[0.1, 0.2, 0.7, 0.9], [0.1, 0.2, 0.7, 0.9]], names=("lat", "lon")) mda['position'] = midx print(mda.lat) # <-- raises Error in xarray 2022.12 test_xarray_multiindex() ``` MVCE confirmation
Relevant log output```Python AttributeError Traceback (most recent call last) Cell In[1], line 16 13 print(mda) 14 print(mda.lat) # <-- raises Error in some xr versions ---> 16 test_xarray_multiindex() Cell In[1], line 14, in test_xarray_multiindex() 12 mda['position'] = midx 13 print(mda) ---> 14 print(mda.lat) File /home/swd/manual/nwp/2023.1/lib/python3.10/site-packages/xarray/core/common.py:268, in AttrAccessMixin.getattr(self, name) 266 with suppress(KeyError): 267 return source[name] --> 268 raise AttributeError( 269 f"{type(self).name!r} object has no attribute {name!r}" 270 ) AttributeError: 'DataArray' object has no attribute 'lat' ``` Anything else we need to know?No response Environment
INSTALLED VERSIONS
------------------
commit: None
python: 3.10.9 | packaged by conda-forge | (main, Feb 2 2023, 20:20:04) [GCC 11.3.0]
python-bits: 64
OS: Linux
OS-release: 4.18.0-372.19.1.el8_6.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: ('en_US', 'UTF-8')
libhdf5: 1.12.2
libnetcdf: 4.8.1
xarray: 2023.2.0
pandas: 1.5.3
numpy: 1.23.5
scipy: 1.10.0
netCDF4: 1.6.2
pydap: None
h5netcdf: 1.1.0
h5py: 3.8.0
Nio: None
zarr: None
cftime: 1.6.2
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
dask: 2023.2.0
distributed: 2023.2.0
matplotlib: 3.7.0
cartopy: 0.21.1
seaborn: None
numbagg: None
fsspec: 2023.1.0
cupy: None
pint: 0.20.1
sparse: None
flox: None
numpy_groupies: None
setuptools: 67.3.2
pip: 23.0
conda: None
pytest: None
mypy: None
IPython: 8.10.0
sphinx: None
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/7563/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
435170643 | MDU6SXNzdWU0MzUxNzA2NDM= | 2907 | xr.dot result differs from np.dot | lkugler 29361544 | closed | 0 | 4 | 2019-04-19T13:03:34Z | 2019-04-19T17:51:45Z | 2019-04-19T17:51:44Z | NONE | Code SampleHi, shouldn't the result of xr.dot be equivalent to np.dot? In np.dot I get values of ~280, and for xr.dot I get ~1100: ```python <xarray.DataArray 'models' (model name: 4)> array([283.6939 , 283.129198, 284.671649, 284.01668 ]) Coordinates: valid_time datetime64[ns] 2019-03-15T19:00:00 lat float64 45.89 lon float64 4.683 * model name (model name) |S5 'apple' 'juice' 'banana' 'milk' <xarray.DataArray 'weights' (models: 4)>
array([0.308999, 0.191562, 0.049474, 0.449983])
Coordinates:
lat float64 45.89
lon float64 4.683
Dimensions without coordinates: models
xr.dot(weights_da, models, dims=['models', 'model name']) <xarray.DataArray ()> array(1135.532891) Coordinates: lat float64 45.89 lon float64 4.683 valid_time datetime64[ns] 2019-03-15T19:00:00 ``` Problem descriptionWhat's going on below the surface? I mean if I create the array by hand (not from the file) I can't reproduce this. I don't think it's related to the file (as the values from the file work with numpy.dot). Something related to dask? Doing np.dot on the whole array (not just this piece here) results in a MemoryError. I'm Thanks for any advice! EDIT: I also tested it on python 3.7.3. xarray 0.11.3. Same result. Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2907/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE [issues] ( [id] INTEGER PRIMARY KEY, [node_id] TEXT, [number] INTEGER, [title] TEXT, [user] INTEGER REFERENCES [users]([id]), [state] TEXT, [locked] INTEGER, [assignee] INTEGER REFERENCES [users]([id]), [milestone] INTEGER REFERENCES [milestones]([id]), [comments] INTEGER, [created_at] TEXT, [updated_at] TEXT, [closed_at] TEXT, [author_association] TEXT, [active_lock_reason] TEXT, [draft] INTEGER, [pull_request] TEXT, [body] TEXT, [reactions] TEXT, [performed_via_github_app] TEXT, [state_reason] TEXT, [repo] INTEGER REFERENCES [repos]([id]), [type] TEXT ); CREATE INDEX [idx_issues_repo] ON [issues] ([repo]); CREATE INDEX [idx_issues_milestone] ON [issues] ([milestone]); CREATE INDEX [idx_issues_assignee] ON [issues] ([assignee]); CREATE INDEX [idx_issues_user] ON [issues] ([user]);