issues
88 rows where repo = 13221727, type = "issue" and user = 10194086 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: comments, 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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2083501344 | I_kwDOAMm_X858L7Ug | 8612 | more frequency string updates? | mathause 10194086 | closed | 0 | 5 | 2024-01-16T09:56:48Z | 2024-02-15T16:53:37Z | 2024-02-15T16:53:37Z | MEMBER | What is your issue?I looked a bit into the frequency string update & found 3 issues we could improve upon.
I have played around with 2. and 3. and can open a PR if you are on board. @spencerkclark @aulemahal
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/8612/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
1918089795 | I_kwDOAMm_X85yU7pD | 8252 | cannot use negative step to sel from zarr (without dask) | mathause 10194086 | closed | 0 | 0 | 2023-09-28T18:52:07Z | 2024-02-10T02:57:33Z | 2024-02-10T02:57:33Z | MEMBER | What happened?As per: https://github.com/pydata/xarray/pull/8246#discussion_r1340357405 Passing a negative step in a What did you expect to happen?zarr should allow negative step (probably?) Minimal Complete Verifiable Example```Python import xarray as xr create a zarr datasetair = xr.tutorial.open_dataset("air_temperature") air.to_zarr("test.zarr") ds = xr.open_dataset("test.zarr", engine="zarr") ds.air[::-1, ].load() note that this works if the dataset is backed by daskds_dask = xr.open_dataset("test.zarr", engine="zarr", chunks="auto") ds_dask.air[::-1, ].load() ``` MVCE confirmation
Relevant log output```Python File ~/code/xarray/xarray/core/parallelcompat.py:93, in guess_chunkmanager(manager) 91 if isinstance(manager, str): 92 if manager not in chunkmanagers: ---> 93 raise ValueError( 94 f"unrecognized chunk manager {manager} - must be one of: {list(chunkmanagers)}" 95 ) 97 return chunkmanagers[manager] 98 elif isinstance(manager, ChunkManagerEntrypoint): 99 # already a valid ChunkManager so just pass through ValueError: unrecognized chunk manager dask - must be one of: [] ``` Anything else we need to know?The error comes from https://github.com/zarr-developers/zarr-python/blob/6ec746ef1242dd9fec26b128cc0b3455d28ad6f0/zarr/indexing.py#L174 so it would need an upstream fix first. cc @dcherian is this what you had in mind? Environment
INSTALLED VERSIONS
------------------
commit: f6d69a1f6d952dcd67609c97f3fb3069abdda586
python: 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:40:32) [GCC 12.3.0]
python-bits: 64
OS: Linux
OS-release: 6.2.0-33-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: ('en_US', 'UTF-8')
libhdf5: 1.14.2
libnetcdf: 4.9.2
xarray: 2023.9.1.dev8+gf6d69a1f
pandas: 2.1.1
numpy: 1.24.4
scipy: 1.11.3
netCDF4: 1.6.4
pydap: installed
h5netcdf: 1.2.0
h5py: 3.9.0
Nio: None
zarr: 2.16.1
cftime: 1.6.2
nc_time_axis: 1.4.1
PseudoNetCDF: 3.2.2
iris: 3.7.0
bottleneck: 1.3.7
dask: 2023.9.2
distributed: None
matplotlib: 3.8.0
cartopy: 0.22.0
seaborn: 0.12.2
numbagg: 0.2.2
fsspec: 2023.9.2
cupy: None
pint: 0.20.1
sparse: 0.14.0
flox: 0.7.2
numpy_groupies: 0.10.1
setuptools: 68.2.2
pip: 23.2.1
conda: None
pytest: 7.4.2
mypy: None
IPython: 8.15.0
sphinx: None
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/8252/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
2105703882 | I_kwDOAMm_X859gn3K | 8679 | Dataset.weighted along a dimension not on weights errors | mathause 10194086 | open | 0 | 2 | 2024-01-29T15:03:39Z | 2024-02-04T11:24:54Z | MEMBER | What happened?
What did you expect to happen?This used to work and was "broken" by #8606. However, we may want to fix this by ignoring (?) those data vars instead (#7027). Minimal Complete Verifiable Example```Python import xarray as xr ds = xr.Dataset({"a": (("y", "x"), [[1, 2]]), "scalar": 1}) weights = xr.DataArray([1, 2], dims="x") ds.weighted(weights).mean("y") ``` MVCE confirmation
Relevant log output```Python ValueError Traceback (most recent call last) Cell In[1], line 6 3 ds = xr.Dataset({"a": (("y", "x"), [[1, 2]]), "scalar": 1}) 4 weights = xr.DataArray([1, 2], dims="x") ----> 6 ds.weighted(weights).mean("y") File ~/code/xarray/xarray/util/deprecation_helpers.py:115, in _deprecate_positional_args.<locals>._decorator.<locals>.inner(args, kwargs) 111 kwargs.update({name: arg for name, arg in zip_args}) 113 return func(args[:-n_extra_args], kwargs) --> 115 return func(*args, kwargs) File ~/code/xarray/xarray/core/weighted.py:497, in Weighted.mean(self, dim, skipna, keep_attrs) 489 @_deprecate_positional_args("v2023.10.0") 490 def mean( 491 self, (...) 495 keep_attrs: bool | None = None, 496 ) -> T_Xarray: --> 497 return self._implementation( 498 self._weighted_mean, dim=dim, skipna=skipna, keep_attrs=keep_attrs 499 ) File ~/code/xarray/xarray/core/weighted.py:558, in DatasetWeighted._implementation(self, func, dim, kwargs) 555 def _implementation(self, func, dim, kwargs) -> Dataset: 556 self._check_dim(dim) --> 558 return self.obj.map(func, dim=dim, **kwargs) File ~/code/xarray/xarray/core/dataset.py:6924, in Dataset.map(self, func, keep_attrs, args, kwargs) 6922 if keep_attrs is None: 6923 keep_attrs = _get_keep_attrs(default=False) -> 6924 variables = { 6925 k: maybe_wrap_array(v, func(v, *args, kwargs)) 6926 for k, v in self.data_vars.items() 6927 } 6928 if keep_attrs: 6929 for k, v in variables.items(): File ~/code/xarray/xarray/core/dataset.py:6925, in <dictcomp>(.0) 6922 if keep_attrs is None: 6923 keep_attrs = _get_keep_attrs(default=False) 6924 variables = { -> 6925 k: maybe_wrap_array(v, func(v, args, *kwargs)) 6926 for k, v in self.data_vars.items() 6927 } 6928 if keep_attrs: 6929 for k, v in variables.items(): File ~/code/xarray/xarray/core/weighted.py:286, in Weighted._weighted_mean(self, da, dim, skipna)
278 def _weighted_mean(
279 self,
280 da: T_DataArray,
281 dim: Dims = None,
282 skipna: bool | None = None,
283 ) -> T_DataArray:
284 """Reduce a DataArray by a weighted File ~/code/xarray/xarray/core/weighted.py:276, in Weighted._weighted_sum(self, da, dim, skipna)
268 def _weighted_sum(
269 self,
270 da: T_DataArray,
271 dim: Dims = None,
272 skipna: bool | None = None,
273 ) -> T_DataArray:
274 """Reduce a DataArray by a weighted File ~/code/xarray/xarray/core/weighted.py:231, in Weighted._reduce(da, weights, dim, skipna)
227 da = da.fillna(0.0)
229 # File ~/code/xarray/xarray/util/deprecation_helpers.py:140, in deprecate_dims.<locals>.wrapper(args, kwargs)
132 emit_user_level_warning(
133 "The File ~/code/xarray/xarray/core/computation.py:1885, in dot(dim, arrays, *kwargs) 1883 dim = tuple(d for d, c in dim_counts.items() if c > 1) 1884 else: -> 1885 dim = parse_dims(dim, all_dims=tuple(all_dims)) 1887 dot_dims: set[Hashable] = set(dim) 1889 # dimensions to be parallelized File ~/code/xarray/xarray/core/utils.py:1046, in parse_dims(dim, all_dims, check_exists, replace_none) 1044 dim = (dim,) 1045 if check_exists: -> 1046 _check_dims(set(dim), set(all_dims)) 1047 return tuple(dim) File ~/code/xarray/xarray/core/utils.py:1131, in _check_dims(dim, all_dims) 1129 if wrong_dims: 1130 wrong_dims_str = ", ".join(f"'{d!s}'" for d in wrong_dims) -> 1131 raise ValueError( 1132 f"Dimension(s) {wrong_dims_str} do not exist. Expected one or more of {all_dims}" 1133 ) ValueError: Dimension(s) 'y' do not exist. Expected one or more of {'x'} ``` Anything else we need to know?No response EnvironmentNewest main (i.e. 2024.01) |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/8679/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue | ||||||||
1455395909 | I_kwDOAMm_X85Wv5RF | 7298 | html repr fails for empty cftime arrays | mathause 10194086 | closed | 0 | 1 | 2022-11-18T16:09:00Z | 2024-01-15T21:49:36Z | 2024-01-15T21:49:35Z | MEMBER | What happened?The html repr of a cftime array wants to display the "calendar", which it cannot if it is empty. What did you expect to happen?No error. Minimal Complete Verifiable Example```Python import numpy as np import xarray as xr data_obs = np.random.randn(3) time_obs = xr.date_range("2000-01-01", periods=3, freq="YS", calendar="noleap") obs = xr.DataArray(data_obs, coords={"time": time_obs}) o = obs[:0] xr.core.formatting_html.array_repr(o) ``` MVCE confirmation
Relevant log output```Python ValueError Traceback (most recent call last) Input In [1], in <cell line: 12>() 8 obs = xr.DataArray(data_obs, coords={"time": time_obs}) 10 o = obs[:0] ---> 12 xr.core.formatting_html.array_repr(o) File ~/code/xarray/xarray/core/formatting_html.py:318, in array_repr(arr) 316 if hasattr(arr, "xindexes"): 317 indexes = _get_indexes_dict(arr.xindexes) --> 318 sections.append(index_section(indexes)) 320 sections.append(attr_section(arr.attrs)) 322 return _obj_repr(arr, header_components, sections) File ~/code/xarray/xarray/core/formatting_html.py:195, in _mapping_section(mapping, name, details_func, max_items_collapse, expand_option_name, enabled) 188 expanded = _get_boolean_with_default( 189 expand_option_name, n_items < max_items_collapse 190 ) 191 collapsed = not expanded 193 return collapsible_section( 194 name, --> 195 details=details_func(mapping), 196 n_items=n_items, 197 enabled=enabled, 198 collapsed=collapsed, 199 ) File ~/code/xarray/xarray/core/formatting_html.py:155, in summarize_indexes(indexes) 154 def summarize_indexes(indexes): --> 155 indexes_li = "".join( 156 f"
File ~/code/xarray/xarray/core/formatting_html.py:156, in <genexpr>(.0) 154 def summarize_indexes(indexes): 155 indexes_li = "".join( --> 156 f"
File ~/code/xarray/xarray/core/formatting_html.py:140, in summarize_index(coord_names, index) 138 index_id = f"index-{uuid.uuid4()}" 139 preview = escape(inline_index_repr(index)) --> 140 details = short_index_repr_html(index) 142 data_icon = _icon("icon-database") 144 return ( 145 f" {name} {preview} "
(...)
150 f"{details} "
151 )
File ~/code/xarray/xarray/core/formatting_html.py:132, in short_index_repr_html(index) 129 if hasattr(index, "repr_html"): 130 return index.repr_html() --> 132 return f" {escape(repr(index))}" File ~/code/xarray/xarray/core/indexes.py:547, in PandasIndex.repr(self) 546 def repr(self): --> 547 return f"PandasIndex({repr(self.index)})" File ~/code/xarray/xarray/coding/cftimeindex.py:353, in CFTimeIndex.repr(self) 345 end_str = format_times( 346 self.values[-REPR_ELLIPSIS_SHOW_ITEMS_FRONT_END:], 347 display_width, 348 offset=offset, 349 first_row_offset=offset, 350 ) 351 datastr = "\n".join([front_str, f"{' '*offset}...", end_str]) --> 353 attrs_str = format_attrs(self) 354 # oneliner only if smaller than display_width 355 full_repr_str = f"{klass_name}([{datastr}], {attrs_str})" File ~/code/xarray/xarray/coding/cftimeindex.py:272, in format_attrs(index, separator) 267 def format_attrs(index, separator=", "): 268 """Format attributes of CFTimeIndex for repr.""" 269 attrs = { 270 "dtype": f"'{index.dtype}'", 271 "length": f"{len(index)}", --> 272 "calendar": f"'{index.calendar}'", 273 "freq": f"'{index.freq}'" if len(index) >= 3 else None, 274 } 276 attrs_str = [f"{k}={v}" for k, v in attrs.items()] 277 attrs_str = f"{separator}".join(attrs_str) File ~/code/xarray/xarray/coding/cftimeindex.py:698, in CFTimeIndex.calendar(self) 695 """The calendar used by the datetimes in the index.""" 696 from .times import infer_calendar_name --> 698 return infer_calendar_name(self) File ~/code/xarray/xarray/coding/times.py:374, in infer_calendar_name(dates) 371 return sample.calendar 373 # Error raise if dtype is neither datetime or "O", if cftime is not importable, and if element of 'O' dtype is not cftime. --> 374 raise ValueError("Array does not contain datetime objects.") ValueError: Array does not contain datetime objects. ``` Anything else we need to know?Bisected to 7379923de756a2bcc59044d548f8ab7a68b91d4e use Environment |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/7298/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
1959175248 | I_kwDOAMm_X850xqRQ | 8367 | `da.xindexes` or `da.indexes` raises an error if there are none (in the repr) | mathause 10194086 | closed | 0 | 1 | 2023-10-24T12:45:12Z | 2023-12-06T17:06:16Z | 2023-12-06T17:06:16Z | MEMBER | What happened?
What did you expect to happen?Displaying an empty Mappable? Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output```Python Out[9]: --------------------------------------------------------------------------- ValueError Traceback (most recent call last) File ~/.conda/envs/xarray_dev/lib/python3.10/site-packages/IPython/core/formatters.py:708, in PlainTextFormatter.call(self, obj) 701 stream = StringIO() 702 printer = pretty.RepresentationPrinter(stream, self.verbose, 703 self.max_width, self.newline, 704 max_seq_length=self.max_seq_length, 705 singleton_pprinters=self.singleton_printers, 706 type_pprinters=self.type_printers, 707 deferred_pprinters=self.deferred_printers) --> 708 printer.pretty(obj) 709 printer.flush() 710 return stream.getvalue() File ~/.conda/envs/xarray_dev/lib/python3.10/site-packages/IPython/lib/pretty.py:410, in RepresentationPrinter.pretty(self, obj) 407 return meth(obj, self, cycle) 408 if cls is not object \ 409 and callable(cls.dict.get('repr')): --> 410 return _repr_pprint(obj, self, cycle) 412 return _default_pprint(obj, self, cycle) 413 finally: File ~/.conda/envs/xarray_dev/lib/python3.10/site-packages/IPython/lib/pretty.py:778, in repr_pprint(obj, p, cycle) 776 """A pprint that just redirects to the normal repr function.""" 777 # Find newlines and replace them with p.break() --> 778 output = repr(obj) 779 lines = output.splitlines() 780 with p.group(): File ~/code/xarray/xarray/core/indexes.py:1659, in Indexes.repr(self) 1657 def repr(self): 1658 indexes = formatting._get_indexes_dict(self) -> 1659 return formatting.indexes_repr(indexes) File ~/code/xarray/xarray/core/formatting.py:474, in indexes_repr(indexes, max_rows) 473 def indexes_repr(indexes, max_rows: int | None = None) -> str: --> 474 col_width = _calculate_col_width(chain.from_iterable(indexes)) 476 return _mapping_repr( 477 indexes, 478 "Indexes", (...) 482 max_rows=max_rows, 483 ) File ~/code/xarray/xarray/core/formatting.py:341, in _calculate_col_width(col_items) 340 def _calculate_col_width(col_items): --> 341 max_name_length = max(len(str(s)) for s in col_items) if col_items else 0 342 col_width = max(max_name_length, 7) + 6 343 return col_width ValueError: max() arg is an empty sequence ``` Anything else we need to know?No response Environment
INSTALLED VERSIONS
------------------
commit: ccc8f9987b553809fb6a40c52fa1a8a8095c8c5f
python: 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:40:32) [GCC 12.3.0]
python-bits: 64
OS: Linux
OS-release: 6.2.0-35-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: ('en_US', 'UTF-8')
libhdf5: 1.14.2
libnetcdf: 4.9.2
xarray: 2023.9.1.dev8+gf6d69a1f
pandas: 2.1.1
numpy: 1.24.4
scipy: 1.11.3
netCDF4: 1.6.4
pydap: installed
h5netcdf: 1.2.0
h5py: 3.9.0
Nio: None
zarr: 2.16.1
cftime: 1.6.2
nc_time_axis: 1.4.1
PseudoNetCDF: 3.2.2
iris: 3.7.0
bottleneck: 1.3.7
dask: 2023.9.2
distributed: None
matplotlib: 3.8.0
cartopy: 0.22.0
seaborn: 0.12.2
numbagg: 0.2.2
fsspec: 2023.9.2
cupy: None
pint: 0.20.1
sparse: 0.14.0
flox: 0.7.2
numpy_groupies: 0.10.1
setuptools: 68.2.2
pip: 23.2.1
conda: None
pytest: 7.4.2
mypy: 1.5.1
IPython: 8.15.0
sphinx: None
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/8367/reactions", "total_count": 2, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
722168932 | MDU6SXNzdWU3MjIxNjg5MzI= | 4513 | where should keep_attrs be set in groupby, resample, weighted etc.? | mathause 10194086 | closed | 0 | 2 | 2020-10-15T09:36:43Z | 2023-11-10T16:58:35Z | 2023-11-10T16:58:35Z | MEMBER | I really should not open this can of worms but per https://github.com/pydata/xarray/issues/4450#issuecomment-697507489:
Also as I try to fix the
So the working consensus seems to be to to (Edit: looking at this it is only half as bad, "only" Detailed analysis
```python
import xarray as xr
ds = xr.tutorial.open_dataset("air_temperature")
da = ds.air
```
### coarsen
```python
ds.coarsen(time=2, keep_attrs=True).mean() # keeps global attributes
ds.coarsen(time=2).mean(keep_attrs=True) # keeps DataArray attributes
ds.coarsen(time=2, keep_attrs=True).mean(keep_attrs=True) # keeps both
da.coarsen(time=2).mean(keep_attrs=True) # error
da.coarsen(time=2, keep_attrs=True).mean() # keeps DataArray attributes
```
### groupby
```python
ds.groupby("time.month").mean(keep_attrs=True) # keeps both
da.groupby("time.month").mean(keep_attrs=True) # keeps DataArray attributes
ds.groupby("time.month", keep_attrs=True).mean() # error
da.groupby("time.month", keep_attrs=True).mean() # error
```
### groupby_bins
```python
ds.groupby_bins(ds.lat, np.arange(0, 90, 10)).mean(keep_attrs=True) # keeps both
da.groupby_bins(ds.lat, np.arange(0, 90, 10)).mean(keep_attrs=True) # keeps DataArray attrs
ds.groupby_bins(ds.lat, np.arange(0, 90, 10), keep_attrs=True) # errors
da.groupby_bins(ds.lat, np.arange(0, 90, 10), keep_attrs=True) # errors
```
### resample
```python
ds.resample(time="A").mean(keep_attrs=True) # keeps both
da.resample(time="A").mean(keep_attrs=True) # keeps DataArray attributes
ds.resample(time="A", keep_attrs=False).mean() # ignored
da.resample(time="A", keep_attrs=False).mean() # ignored
```
### rolling
```python
ds.rolling(time=2).mean(keep_attrs=True) # keeps both
da.rolling(time=2).mean(keep_attrs=True) # keeps DataArray attributes
ds.rolling(time=2, keep_attrs=True).mean() # DeprecationWarning; keeps both
da.rolling(time=2, keep_attrs=True).mean() # DeprecationWarning; keeps DataArray attributes
```
see #4510
### rolling_exp
```python
ds.rolling_exp(time=5, keep_attrs=True).mean() # ignored
da.rolling_exp(time=5, keep_attrs=True).mean() # ignored
ds.rolling_exp(time=5).mean(keep_attrs=True) # keeps both
da.rolling_exp(time=5).mean(keep_attrs=True) # keeps DataArray attributes
```
### weighted
```python
ds.weighted(ds.lat).mean(keep_attrs=True) # keeps both
da.weighted(ds.lat).mean(keep_attrs=True) # keeps DataArray attrs
```
edit: moved |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4513/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
1986324822 | I_kwDOAMm_X852ZOlW | 8436 | align fails when more than one xindex is set | mathause 10194086 | closed | 0 | 2 | 2023-11-09T20:07:52Z | 2023-11-10T12:53:49Z | 2023-11-10T12:53:49Z | MEMBER | What happened?I tried a DataArray with more than one dimension coordinate. Unfortunately What did you expect to happen?No response Minimal Complete Verifiable Example```Python import numpy as np import xarray as xr data = np.arange(12).reshape(3, 4) y = [10, 20, 30] s = ["a", "b", "c"] x = [1, 2, 3, 4] da = xr.DataArray(data, dims=("y", "x"), coords={"x": x, "y": y, "s": ("y", s)}) da = da.set_xindex("s") xr.align(da, da.y) # errors da + da # errors da + da.x # errors ``` MVCE confirmation
Relevant log output```PythonValueError Traceback (most recent call last) /home/mathause/code/mesmer/devel/prepare_for_surfer.ipynb Cell 28 line 1 12 da = xr.DataArray(data, dims=("y", "x"), coords={"x": x, "y": y, "s": ("y", s)}) 13 da = da.set_xindex("s") ---> 15 xr.align(da, da.y) # errors 17 da + da.x # errors File ~/.conda/envs/mesmer_dev/lib/python3.9/site-packages/xarray/core/alignment.py:888, in align(join, copy, indexes, exclude, fill_value, *objects) 692 """ 693 Given any number of Dataset and/or DataArray objects, returns new 694 objects with aligned indexes and dimension sizes. ref='~/.conda/envs/mesmer_dev/lib/python3.9/site-packages/xarray/core/alignment.py:0'>0;32m (...) 878 879 """ 880 aligner = Aligner( 881 objects, 882 join=join, ref='~/.conda/envs/mesmer_dev/lib/python3.9/site-packages/xarray/core/alignment.py:0'>0;32m (...) 886 fill_value=fill_value, 887 ) --> 888 aligner.align() 889 return aligner.results File ~/.conda/envs/mesmer_dev/lib/python3.9/site-packages/xarray/core/alignment.py:573, in Aligner.align(self) 571 self.find_matching_indexes() 572 self.find_matching_unindexed_dims() --> 573 self.assert_no_index_conflict() 574 self.align_indexes() 575 self.assert_unindexed_dim_sizes_equal() File ~/.conda/envs/mesmer_dev/lib/python3.9/site-packages/xarray/core/alignment.py:318, in Aligner.assert_no_index_conflict(self) 314 if dup: 315 items_msg = ", ".join( 316 f"{k!r} ({v} conflicting indexes)" for k, v in dup.items() 317 ) --> 318 raise ValueError( 319 "cannot re-index or align objects with conflicting indexes found for " 320 f"the following {msg}: {items_msg}\n" 321 "Conflicting indexes may occur when\n" 322 "- they relate to different sets of coordinate and/or dimension names\n" 323 "- they don't have the same type\n" 324 "- they may be used to reindex data along common dimensions" 325 ) ValueError: cannot re-index or align objects with conflicting indexes found for the following dimensions: 'y' (2 conflicting indexes) Conflicting indexes may occur when - they relate to different sets of coordinate and/or dimension names - they don't have the same type - they may be used to reindex data along common dimensions ``` Anything else we need to know?No response Environment
INSTALLED VERSIONS
------------------
commit: feba6984aa914327408fee3c286dae15969d2a2f
python: 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:40:32) [GCC 12.3.0]
python-bits: 64
OS: Linux
OS-release: 6.2.0-36-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: ('en_US', 'UTF-8')
libhdf5: 1.14.2
libnetcdf: 4.9.2
xarray: 2023.9.1.dev8+gf6d69a1f
pandas: 2.1.1
numpy: 1.24.4
scipy: 1.11.3
netCDF4: 1.6.4
pydap: installed
h5netcdf: 1.2.0
h5py: 3.9.0
Nio: None
zarr: 2.16.1
cftime: 1.6.2
nc_time_axis: 1.4.1
PseudoNetCDF: 3.2.2
iris: 3.7.0
bottleneck: 1.3.7
dask: 2023.9.2
distributed: None
matplotlib: 3.8.0
cartopy: 0.22.0
seaborn: 0.12.2
numbagg: 0.2.2
fsspec: 2023.9.2
cupy: None
pint: 0.20.1
sparse: 0.14.0
flox: 0.7.2
numpy_groupies: 0.10.1
setuptools: 68.2.2
pip: 23.2.1
conda: None
pytest: 7.4.2
mypy: 1.5.1
IPython: 8.15.0
sphinx: None
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/8436/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
1657036222 | I_kwDOAMm_X85ixF2- | 7730 | flox performance regression for cftime resampling | mathause 10194086 | closed | 0 | 8 | 2023-04-06T09:38:03Z | 2023-10-15T03:48:44Z | 2023-10-15T03:48:44Z | MEMBER | What happened?Running an in-memory What did you expect to happen?flox to be at least on par with our naive implementation Minimal Complete Verifiable Example```Python import numpy as np import xarray as xr arr = np.random.randn(10, 10, 36530) time = xr.date_range("2000", periods=30365, calendar="noleap") da = xr.DataArray(arr, dims=("y", "x", "time"), coords={"time": time}) using maxprint("max:") xr.set_options(use_flox=True) %timeit da.groupby("time.year").max("time") %timeit da.groupby("time.year").max("time", engine="flox") xr.set_options(use_flox=False) %timeit da.groupby("time.year").max("time") as reference%timeit [da.sel(time=str(year)).max("time") for year in range(2000, 2030)] using meanprint("mean:") xr.set_options(use_flox=True) %timeit da.groupby("time.year").mean("time") %timeit da.groupby("time.year").mean("time", engine="flox") xr.set_options(use_flox=False) %timeit da.groupby("time.year").mean("time") as reference%timeit [da.sel(time=str(year)).mean("time") for year in range(2000, 2030)] ``` MVCE confirmation
Relevant log output```Python max: 158 ms ± 4.41 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) 28.1 ms ± 318 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) 11.5 ms ± 52.3 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) mean: 95.6 ms ± 10.8 ms per loop (mean ± std. dev. of 7 runs, 10 loops each) 34.8 ms ± 2.88 ms per loop (mean ± std. dev. of 7 runs, 10 loops each) 15.2 ms ± 232 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) ``` Anything else we need to know?No response Environment
INSTALLED VERSIONS
------------------
commit: f8127fc9ad24fe8b41cce9f891ab2c98eb2c679a
python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0]
python-bits: 64
OS: Linux
OS-release: 5.15.0-69-generic
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.9.1
xarray: main
pandas: 1.5.3
numpy: 1.23.5
scipy: 1.10.1
netCDF4: 1.6.3
pydap: installed
h5netcdf: 1.1.0
h5py: 3.8.0
Nio: None
zarr: 2.14.2
cftime: 1.6.2
nc_time_axis: 1.4.1
PseudoNetCDF: 3.2.2
iris: 3.4.1
bottleneck: 1.3.7
dask: 2023.3.2
distributed: 2023.3.2.1
matplotlib: 3.7.1
cartopy: 0.21.1
seaborn: 0.12.2
numbagg: 0.2.2
fsspec: 2023.3.0
cupy: None
pint: 0.20.1
sparse: 0.14.0
flox: 0.6.10
numpy_groupies: 0.9.20
setuptools: 67.6.1
pip: 23.0.1
conda: None
pytest: 7.2.2
mypy: None
IPython: 8.12.0
sphinx: None
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/7730/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
748684119 | MDU6SXNzdWU3NDg2ODQxMTk= | 4601 | Don't type check __getattr__? | mathause 10194086 | open | 0 | 8 | 2020-11-23T10:41:21Z | 2023-09-25T05:33:09Z | MEMBER | In #4592 I had the issue that mypy did not raise an error on a missing method: ```python from xarray.core.common import DataWithCoords hasattr(xr.core.common.DataWithCoords, "reduce") # -> False def test(x: "DataWithCoords"): x.reduce() # mypy does not error ``` This is because ```python class A: pass class B: def getattr(self, name): ... def testA(x: "A"): x.reduce() # mypy errors def testB(x: "B"): x.reduce() # mypy does not error ``` The solution seems to be to not typecheck ```python from typing import no_type_check class C: @no_type_check def getattr(self, name): ... def testC(x: "C"): x.reduce() # mypy errors ``` The only Using Thoughts? All errors
```python-traceback
xarray/core/common.py:370: error: "DataWithCoords" has no attribute "isel"
xarray/core/common.py:374: error: "DataWithCoords" has no attribute "dims"
xarray/core/common.py:378: error: "DataWithCoords" has no attribute "indexes"
xarray/core/common.py:381: error: "DataWithCoords" has no attribute "sizes"
xarray/core/common.py:698: error: "DataWithCoords" has no attribute "_groupby_cls"
xarray/core/common.py:761: error: "DataWithCoords" has no attribute "_groupby_cls"
xarray/core/common.py:866: error: "DataWithCoords" has no attribute "_rolling_cls"; maybe "_rolling_exp_cls"?
xarray/core/common.py:977: error: "DataWithCoords" has no attribute "_coarsen_cls"
xarray/core/common.py:1108: error: "DataWithCoords" has no attribute "dims"
xarray/core/common.py:1109: error: "DataWithCoords" has no attribute "dims"
xarray/core/common.py:1133: error: "DataWithCoords" has no attribute "indexes"
xarray/core/common.py:1144: error: "DataWithCoords" has no attribute "_resample_cls"; maybe "resample"?
xarray/core/common.py:1261: error: "DataWithCoords" has no attribute "isel"
xarray/core/alignment.py:278: error: "DataAlignable" has no attribute "copy"
xarray/core/alignment.py:283: error: "DataAlignable" has no attribute "dims"
xarray/core/alignment.py:286: error: "DataAlignable" has no attribute "indexes"
xarray/core/alignment.py:288: error: "DataAlignable" has no attribute "sizes"
xarray/core/alignment.py:348: error: "DataAlignable" has no attribute "dims"
xarray/core/alignment.py:351: error: "DataAlignable" has no attribute "copy"
xarray/core/alignment.py:353: error: "DataAlignable" has no attribute "reindex"
xarray/core/alignment.py:356: error: "DataAlignable" has no attribute "encoding"
xarray/core/weighted.py:157: error: "DataArray" has no attribute "notnull"
xarray/core/dataset.py:3792: error: "Dataset" has no attribute "virtual_variables"
xarray/core/dataset.py:6135: error: "DataArray" has no attribute "isnull"
```
Edit: one problem is certainly the method injection, as mypy cannot detect those types. |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4601/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue | ||||||||
235224055 | MDU6SXNzdWUyMzUyMjQwNTU= | 1449 | time.units truncated when saving to_netcdf | mathause 10194086 | closed | 0 | 6 | 2017-06-12T12:58:37Z | 2023-09-13T13:25:25Z | 2023-09-13T13:25:24Z | MEMBER | When I manually specify the
Some programs seem to require the hours to be present to interpret the time properly (e.g. panoply). When specifying the hour, a 'T' is added.
When xarray defines the
xarray version 0.9.6 |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/1449/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
1371397741 | I_kwDOAMm_X85Rvd5t | 7027 | don't apply `weighted`, `groupby`, etc. to `DataArray` without `dims`? | mathause 10194086 | open | 0 | 1 | 2022-09-13T12:44:34Z | 2023-08-26T19:13:39Z | MEMBER | What is your issue?Applying e.g. ```python import xarray as xr air = xr.tutorial.open_dataset("air_temperature") air.attrs = {} add variable without dimsair["foo"] = 5 print("resample") print(air.resample(time="MS").mean(dim="time").foo.dims) print("groupby") print(air.groupby("time.year").mean(dim="time").foo.dims) print("weighted") print(air.weighted(weights=air.time.dt.year).mean("lat").foo.dims) print("where") print(air.where(air.air > 5).foo.dims) ``` Results
Related #6952 - I am sure there are other issues, but couldn't find them quickly...
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/7027/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue | ||||||||
1719805837 | I_kwDOAMm_X85mgieN | 7860 | diff of cftime.Datetime | mathause 10194086 | open | 0 | 3 | 2023-05-22T14:21:06Z | 2023-08-04T12:01:33Z | MEMBER | What happened?A cftime variable returns a timedelta64[ns] when calling What did you expect to happen?We can Minimal Complete Verifiable Example```Python import xarray as xr air = xr.tutorial.open_dataset("air_temperature", use_cftime=True) air.time + air.time.diff("time") / 2 ``` MVCE confirmation
Relevant log output
Anything else we need to know?
Environment
INSTALLED VERSIONS
------------------
commit: d8ec3a3f6b02a8b941b484b3d254537af84b5fde
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: 5.14.21-150400.24.63-default
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_GB.UTF-8
LOCALE: ('en_US', 'UTF-8')
libhdf5: 1.12.2
libnetcdf: 4.9.1
xarray: 2023.2.1.dev20+g06a87062
pandas: 1.5.3
numpy: 1.23.5
scipy: 1.10.1
netCDF4: 1.6.2
pydap: installed
h5netcdf: 1.1.0
h5py: 3.8.0
Nio: None
zarr: 2.13.6
cftime: 1.6.2
nc_time_axis: 1.4.1
PseudoNetCDF: 3.2.2
iris: 3.4.1
bottleneck: 1.3.6
dask: 2023.2.1
distributed: 2023.2.1
matplotlib: 3.7.0
cartopy: 0.21.1
seaborn: 0.12.2
numbagg: 0.2.2
fsspec: 2023.1.0
cupy: None
pint: 0.20.1
sparse: 0.14.0
flox: 0.6.8
numpy_groupies: 0.9.20
setuptools: 67.4.0
pip: 23.0.1
conda: None
pytest: 7.2.1
mypy: None
IPython: 8.11.0
sphinx: None
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/7860/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue | ||||||||
594669577 | MDU6SXNzdWU1OTQ2Njk1Nzc= | 3937 | compose weighted with groupby, coarsen, resample, rolling etc. | mathause 10194086 | open | 0 | 7 | 2020-04-05T22:00:40Z | 2023-07-27T18:10:10Z | MEMBER | It would be nice to make However, it is not entirely clear to me how that should be done. One way would be to do:
Or
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3937/reactions", "total_count": 2, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue | ||||||||
715730538 | MDU6SXNzdWU3MTU3MzA1Mzg= | 4491 | deprecate pynio backend | mathause 10194086 | closed | 0 | 21 | 2020-10-06T14:27:20Z | 2022-11-26T15:40:37Z | 2022-11-26T15:40:37Z | MEMBER | We are currently not testing with the newest version of netCDF4 because it is incompatible with pynio (the newest version is 1.5.4, we are at 1.5.3). This is unlikely to be fixed, see conda-forge/pynio-feedstock#90. Therefore we need to think how to setup the tests so we use the newest version of netCDF4. Maybe just remove it from And long term what to do with the pynio backend? Deprecate? Move to an external repo? |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4491/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
1372729718 | I_kwDOAMm_X85R0jF2 | 7036 | index refactor: more `_coord_names` than `_variables` on Dataset | mathause 10194086 | closed | 0 | 3 | 2022-09-14T10:19:00Z | 2022-09-27T10:35:40Z | 2022-09-27T10:35:40Z | MEMBER | What happened?
What did you expect to happen?Well it seems this assumption is now wrong. Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
Anything else we need to know?The error comes from here Bisected to #5692 - which probably does not help too much. Environment |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/7036/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
1094725752 | I_kwDOAMm_X85BQDB4 | 6142 | dimensions: type as `str | Iterable[Hashable]`? | mathause 10194086 | open | 0 | 14 | 2022-01-05T20:39:00Z | 2022-06-26T11:57:40Z | MEMBER | What happened?We generally type dimensions as:
However, this is in conflict with passing a tuple of independent dimensions to a method - e.g. Also mypy requires an What did you expect to happen?In the community call today we discussed to change this to
i.e. if a single dim is passed it has to be a string and wrapping it in a list is a convenience function. Special use cases with The disadvantage could be that it is a bit more difficult to explain in the docstrings? @shoyer - did I get this right from the discussion? Other options
This could be too restrictive. @keewis mentioned that tuple dimension names are already used somwehere in the xarray repo. Also we discussed in another issue or PR (which I cannot find right know) that we want to keep allowing
This is too restrictive in the other direction and will probably lead to a lot of downstream troubles. Naming a single dimension with a tuple will be a very rare case, in contrast to passing several dimension names as a tuple.
Minimal Complete Verifiable ExampleNo response Relevant log outputNo response Anything else we need to know?
but tuples are not actually allowed: ```python import xarray as xr xr.DataArray([1], dims=("x", "y")) ValueError: different number of dimensions on data and dims: 1 vs 2xr.DataArray([1], dims=[("x", "y")]) TypeError: dimension ('x', 'y') is not a string```
EnvironmentN/A |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/6142/reactions", "total_count": 2, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue | ||||||||
685739084 | MDU6SXNzdWU2ODU3MzkwODQ= | 4375 | allow using non-dimension coordinates in polyfit | mathause 10194086 | open | 0 | 1 | 2020-08-25T19:40:55Z | 2022-04-09T02:58:48Z | MEMBER |
Example: ```python da = xr.DataArray( [1, 3, 2], dims=["x"], coords=dict(x=["a", "b", "c"], y=("x", [0, 1, 2])) ) print(da) da.polyfit("y", 1)
KeyError Traceback (most recent call last) <ipython-input-80-9bb2dacf50f7> in <module> 5 print(da) 6 ----> 7 da.polyfit("y", 1) ~/.conda/envs/ipcc_ar6/lib/python3.7/site-packages/xarray/core/dataarray.py in polyfit(self, dim, deg, skipna, rcond, w, full, cov) 3507 """ 3508 return self._to_temp_dataset().polyfit( -> 3509 dim, deg, skipna=skipna, rcond=rcond, w=w, full=full, cov=cov 3510 ) 3511 ~/.conda/envs/ipcc_ar6/lib/python3.7/site-packages/xarray/core/dataset.py in polyfit(self, dim, deg, skipna, rcond, w, full, cov) 6005 skipna_da = skipna 6006 -> 6007 x = get_clean_interp_index(self, dim, strict=False) 6008 xname = "{}_".format(self[dim].name) 6009 order = int(deg) + 1 ~/.conda/envs/ipcc_ar6/lib/python3.7/site-packages/xarray/core/missing.py in get_clean_interp_index(arr, dim, use_coordinate, strict) 246 247 if use_coordinate is True: --> 248 index = arr.get_index(dim) 249 250 else: # string ~/.conda/envs/ipcc_ar6/lib/python3.7/site-packages/xarray/core/common.py in get_index(self, key) 378 """ 379 if key not in self.dims: --> 380 raise KeyError(key) 381 382 try: KeyError: 'y' ``` Describe the solution you'd like Would be nice if that worked. Describe alternatives you've considered One could just set the non-dimension coordinate as index, e.g.: Additional context Allowing this may be as easy as replacing by
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4375/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue | ||||||||
144630996 | MDU6SXNzdWUxNDQ2MzA5OTY= | 810 | correct DJF mean | mathause 10194086 | closed | 0 | 4 | 2016-03-30T15:36:42Z | 2022-04-06T16:19:47Z | 2016-05-04T12:56:30Z | MEMBER | This started as a question and I add it as reference. Maybe you have a comment. There are several ways to calculate time series of seasonal data (starting from monthly or daily data): ``` load librariesimport pandas as pd import matplotlib.pyplot import numpy as np import xarray as xr Create Example Datasettime = pd.date_range('2000.01.01', '2010.12.31', freq='M') data = np.random.rand(*time.shape) ds = xr.DataArray(data, coords=dict(time=time)) (1) using resampleds_res = ds.resample('Q-FEB', 'time') ds_res = ds_res.sel(time=ds_res['time.month'] == 2) ds_res = ds_res.groupby('time.year').mean('time') (2) this is wrongds_season = ds.where(ds['time.season'] == 'DJF').groupby('time.year').mean('time') (3) using where and rollingmask other months with nands_DJF = ds.where(ds['time.season'] == 'DJF') rolling mean -> only Jan is not nanhowever, we loose Jan/ Feb in the first year and Dec in the lastds_DJF = ds_DJF.rolling(min_periods=3, center=True, time=3).mean() make annual meands_DJF = ds_DJF.groupby('time.year').mean('time') ds_res.plot(marker='*') ds_season.plot() ds_DJF.plot() plt.show() ``` (1) The first is to use resample with 'Q-FEB' as argument. This works fine. It does include Jan/ Feb in the first year, and Dec in the last year + 1. If this makes sense can be debated. One case where this does not work is when you have, say, two regions in your data set, for one you want to calculate DJF and for the other you want NovDecJan. (2) Using 'time.season' is wrong as it combines Jan, Feb and Dec from the same year. (3) The third uses |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/810/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
310833761 | MDU6SXNzdWUzMTA4MzM3NjE= | 2037 | to_netcdf -> _fill_value without NaN | mathause 10194086 | open | 0 | 8 | 2018-04-03T13:20:19Z | 2022-03-10T10:59:17Z | MEMBER | Code Sample, a copy-pastable example if possible```python Your code hereimport xarray as xr import numpy as np x = np.arange(10.) da = xr.Dataset(data_vars=dict(data=('dim1', x)), coords=dict(dim1=('dim1', x))) da.to_netcdf('tst.nc') ``` Problem descriptionApologies if this was discussed somwhere and it probably does not matter much, but Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2037/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue | ||||||||
1150251120 | I_kwDOAMm_X85Ej3Bw | 6304 | add join argument to xr.broadcast? | mathause 10194086 | open | 0 | 1 | 2022-02-25T09:52:14Z | 2022-02-25T21:50:16Z | MEMBER | Is your feature request related to a problem?
This is not how the (default) broadcasting (arithmetic join) works, e.g. the following first does an inner join and then broadcasts: ```python import xarray as xr da1 = xr.DataArray([[0, 1, 2]], dims=("y", "x"), coords={"x": [0, 1, 2]}) da2 = xr.DataArray([0, 1, 2, 3, 4], dims="x", coords={"x": [0, 1, 2, 3, 4]}) da1 + da2 ```
Describe the solution you'd likeAdd a
Describe alternatives you've considered
Additional context
```python import numpy as np import xarray as xr da = xr.DataArray(np.arange(6).reshape(3, 2), coords={"dim_0": [0, 1, 2]}) w = xr.DataArray([1, 1, 1, 1, 1, 1], coords={"dim_0": [0, 1, 2, 4, 5, 6]}) da.weighted(w).quantile(0.5) ``` |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/6304/reactions", "total_count": 4, "+1": 4, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue | ||||||||
1111644832 | I_kwDOAMm_X85CQlqg | 6186 | upstream dev CI: enable bottleneck again | mathause 10194086 | closed | 0 | 2 | 2022-01-22T18:11:25Z | 2022-02-07T09:05:24Z | 2022-02-07T09:05:24Z | MEMBER | bottleneck cannot be built with python 3.10. See https://github.com/pydata/xarray/actions/runs/1731371015 |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/6186/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
975385095 | MDU6SXNzdWU5NzUzODUwOTU= | 5721 | pandas deprecates Index.get_loc with method | mathause 10194086 | closed | 0 | 7 | 2021-08-20T08:24:16Z | 2022-01-27T21:06:40Z | 2022-01-27T21:06:40Z | MEMBER | pandas deprecates the
We should fix this before pandas releases because the warning will not be silent (
We use this here:
https://github.com/pydata/xarray/blob/4bb9d9c6df77137f05e85c7cc6508fe7a93dc0e4/xarray/core/indexes.py#L233-L235
Is this only ever called with one item? Then we might be able to use
```python
indexer = self.index.get_indexer(
[label_value], method=method, tolerance=tolerance
).item()
if indexer == -1:
raise KeyError(label_value)
```
---
https://github.com/pydata/xarray/blob/3956b73a7792f41e4410349f2c40b9a9a80decd2/xarray/core/missing.py#L571-L572
This one could be easy to fix (replace with `imin = index.get_indexer([minval], method="nearest").item()`)
---
It is also defined in `CFTimeIndex`, which complicates things:
https://github.com/pydata/xarray/blob/eea76733770be03e78a0834803291659136bca31/xarray/coding/cftimeindex.py#L461-L466
because `get_indexer` expects an iterable and thus the `if isinstance(key, str)` test no longer works.
@benbovy @spencerkclark |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/5721/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
432074821 | MDU6SXNzdWU0MzIwNzQ4MjE= | 2889 | nansum vs nanmean for all-nan vectors | mathause 10194086 | closed | 0 | 3 | 2019-04-11T15:04:39Z | 2022-01-05T21:59:48Z | 2019-04-11T16:08:02Z | MEMBER | ```python import xarray as xr import numpy as np ds = xr.DataArray([np.NaN, np.NaN]) ds.mean() ds.sum() ``` Problem description
Expected OutputI would expect both to return Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2889/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
1086797050 | I_kwDOAMm_X85AxzT6 | 6101 | enable pytest-xdist again (after dask release) | mathause 10194086 | closed | 0 | 0 | 2021-12-22T12:57:03Z | 2022-01-03T08:29:48Z | 2022-01-03T08:29:48Z | MEMBER | I disabled pytest-xdist because a dask issue renders our CI unusable. As soon as dask releases a new version we should revert #6077 again. |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/6101/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
307783090 | MDU6SXNzdWUzMDc3ODMwOTA= | 2007 | rolling: allow control over padding | mathause 10194086 | open | 0 | 20 | 2018-03-22T19:27:07Z | 2021-07-14T19:10:47Z | MEMBER | Code Sample, a copy-pastable example if possible```python import numpy as np import xarray as xr x = np.arange(1, 366) y = np.random.randn(365) ds = xr.DataArray(y, dims=dict(dayofyear=x)) ds.rolling(center=True, dayofyear=31).mean() ``` Problem description
Is there a way to do this? Should xarray support this feature? This might also belong to SO... |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2007/reactions", "total_count": 3, "+1": 3, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue | ||||||||
788534915 | MDU6SXNzdWU3ODg1MzQ5MTU= | 4824 | combine_by_coords can succed when it shouldn't | mathause 10194086 | open | 0 | 15 | 2021-01-18T20:39:29Z | 2021-07-08T17:44:38Z | MEMBER | What happened:
What you expected to happen:
Minimal Complete Verifiable Example: ```python import numpy as np import xarray as xr data = np.arange(5).reshape(1, 5) x = np.arange(5) x_name = "lat" da0 = xr.DataArray(data, dims=("t", x_name), coords={"t": [1], x_name: x}).to_dataset(name="a") x = x + 1e-6 da1 = xr.DataArray(data, dims=("t", x_name), coords={"t": [2], x_name: x}).to_dataset(name="a") ds = xr.combine_by_coords((da0, da1)) ds ``` returns:
```python-traceback ValueError: Resulting object does not have monotonic global indexes along dimension x ``` Anything else we need to know?:
cc @dcherian @TomNicholas Environment: Output of <tt>xr.show_versions()</tt> |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4824/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue | ||||||||
773750763 | MDU6SXNzdWU3NzM3NTA3NjM= | 4727 | xr.testing.assert_equal does not test for dtype | mathause 10194086 | open | 0 | 5 | 2020-12-23T13:14:41Z | 2021-07-04T04:08:51Z | MEMBER | In #4622 @toddrjen points out that ```python import numpy as np import xarray as xr import pandas as pd xr.testing.assert_equal( xr.DataArray(np.array(1, dtype=int)), xr.DataArray(np.array(1, dtype=float)) ) xr.testing.assert_equal( xr.DataArray(np.array(1, dtype=int)), xr.DataArray(np.array(1, dtype=object)) ) xr.testing.assert_equal( xr.DataArray(np.array("a", dtype=str)), xr.DataArray(np.array("a", dtype=object)) ) ``` This comes back to numpy, i.e. the following is True:
Depending on the situation one or the other is desirable or not. Thus, I would suggest to add a
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4727/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue | ||||||||
559217441 | MDU6SXNzdWU1NTkyMTc0NDE= | 3744 | Contour with vmin/ vmax differs from matplotlib | mathause 10194086 | open | 0 | 0 | 2020-02-03T17:11:24Z | 2021-07-04T02:03:02Z | MEMBER | MCVE Code Sample```python import numpy as np import xarray as xr import matplotlib as mpl import matplotlib.pyplot as plt data = xr.DataArray(np.arange(24).reshape(4, 6)) data.plot.contour(vmax=10, add_colorbar=True) ``` Expected Output
Problem DescriptionA xarray calculates the levels from Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3744/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue | ||||||||
587048587 | MDU6SXNzdWU1ODcwNDg1ODc= | 3883 | weighted operations: performance optimisations | mathause 10194086 | open | 0 | 3 | 2020-03-24T15:31:54Z | 2021-07-04T02:01:28Z | MEMBER | There was a discussion on the performance of the weighted mean/ sum in terms of memory footprint but also speed, and there may indeed be some things that can be optimized. See the posts at the end of the PR. However, the optimal implementation will probably depend on the use case and some profiling will be required. I'll just open an issue to keep track of this. @seth-p |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3883/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue | ||||||||
834641104 | MDU6SXNzdWU4MzQ2NDExMDQ= | 5053 | ImportError: module 'xarray.backends.*' has no attribute '*_backend' | mathause 10194086 | closed | 0 | 3 | 2021-03-18T10:44:33Z | 2021-04-25T16:23:20Z | 2021-04-25T16:23:19Z | MEMBER | What happened: I could not open the test dataset on master. It's a bit strange that this is not picked up by the tests, so probably something to do with the environment I have (I just updated all packages). @alexamici @aurghs does that tell you anything? I can also try to figure it out. Minimal Complete Verifiable Example: calling
Anything else we need to know?: And the traceback:
```python-traceback
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
~/conda/envs/xarray_dev/lib/python3.8/site-packages/pkg_resources/__init__.py in resolve(self)
2479 try:
-> 2480 return functools.reduce(getattr, self.attrs, module)
2481 except AttributeError as exc:
AttributeError: module 'xarray.backends.cfgrib_' has no attribute 'cfgrib_backend'
The above exception was the direct cause of the following exception:
ImportError Traceback (most recent call last)
<ipython-input-2-16bed41155fa> in <module>
----> 1 air = xr.tutorial.open_dataset("air_temperature")
~/code/xarray/xarray/tutorial.py in open_dataset(name, cache, cache_dir, github_url, branch, **kws)
93 raise OSError(msg)
94
---> 95 ds = _open_dataset(localfile, **kws)
96
97 if not cache:
~/code/xarray/xarray/backends/api.py in open_dataset(filename_or_obj, engine, chunks, cache, decode_cf, mask_and_scale, decode_times, decode_timedelta, use_cftime, concat_characters, decode_coords, drop_variables, backend_kwargs, *args, **kwargs)
491
492 if engine is None:
--> 493 engine = plugins.guess_engine(filename_or_obj)
494
495 backend = plugins.get_backend(engine)
~/code/xarray/xarray/backends/plugins.py in guess_engine(store_spec)
99
100 def guess_engine(store_spec):
--> 101 engines = list_engines()
102
103 for engine, backend in engines.items():
~/code/xarray/xarray/backends/plugins.py in list_engines()
95 def list_engines():
96 pkg_entrypoints = pkg_resources.iter_entry_points("xarray.backends")
---> 97 return build_engines(pkg_entrypoints)
98
99
~/code/xarray/xarray/backends/plugins.py in build_engines(pkg_entrypoints)
82 backend_entrypoints = BACKEND_ENTRYPOINTS.copy()
83 pkg_entrypoints = remove_duplicates(pkg_entrypoints)
---> 84 external_backend_entrypoints = backends_dict_from_pkg(pkg_entrypoints)
85 backend_entrypoints.update(external_backend_entrypoints)
86 backend_entrypoints = sort_backends(backend_entrypoints)
~/code/xarray/xarray/backends/plugins.py in backends_dict_from_pkg(pkg_entrypoints)
56 for pkg_ep in pkg_entrypoints:
57 name = pkg_ep.name
---> 58 backend = pkg_ep.load()
59 backend_entrypoints[name] = backend
60 return backend_entrypoints
~/conda/envs/xarray_dev/lib/python3.8/site-packages/pkg_resources/__init__.py in load(self, require, *args, **kwargs)
2470 if require:
2471 self.require(*args, **kwargs)
-> 2472 return self.resolve()
2473
2474 def resolve(self):
~/conda/envs/xarray_dev/lib/python3.8/site-packages/pkg_resources/__init__.py in resolve(self)
2480 return functools.reduce(getattr, self.attrs, module)
2481 except AttributeError as exc:
-> 2482 raise ImportError(str(exc)) from exc
2483
2484 def require(self, env=None, installer=None):
ImportError: module 'xarray.backends.cfgrib_' has no attribute 'cfgrib_backend'
```
Environment: Output of <tt>xr.show_versions()</tt>``` INSTALLED VERSIONS ------------------ commit: a6f51c680f4e4c3ed5101b9c1111f0b94d28a781 python: 3.8.6 | packaged by conda-forge | (default, Jan 25 2021, 23:21:18) [GCC 9.3.0] python-bits: 64 OS: Linux OS-release: 5.4.0-67-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.6 libnetcdf: 4.7.4 xarray: 0.16.2.dev111+g0d93c4f9.d20201219 pandas: 1.2.3 numpy: 1.20.1 scipy: 1.6.1 netCDF4: 1.5.6 pydap: installed h5netcdf: 0.10.0 h5py: 3.1.0 Nio: None zarr: 2.6.1 cftime: 1.4.1 nc_time_axis: 1.2.0 PseudoNetCDF: installed rasterio: 1.2.1 cfgrib: 0.9.8.5 iris: 2.4.0 bottleneck: 1.3.2 dask: 2021.03.0 distributed: 2021.03.0 matplotlib: 3.3.4 cartopy: 0.18.0 seaborn: 0.11.1 numbagg: installed pint: 0.16.1 setuptools: 49.6.0.post20210108 pip: 21.0.1 conda: None pytest: 6.2.2 IPython: 7.21.0 sphinx: None ```and my conda list:
```
# packages in environment at /home/mathause/conda/envs/xarray_dev:
#
# Name Version Build Channel
_libgcc_mutex 0.1 conda_forge conda-forge
_openmp_mutex 4.5 1_gnu conda-forge
affine 2.3.0 py_0 conda-forge
antlr-python-runtime 4.7.2 py38h578d9bd_1002 conda-forge
apipkg 1.5 py_0 conda-forge
appdirs 1.4.4 pyh9f0ad1d_0 conda-forge
asciitree 0.3.3 py_2 conda-forge
attrs 20.3.0 pyhd3deb0d_0 conda-forge
backcall 0.2.0 pyh9f0ad1d_0 conda-forge
backports 1.0 py_2 conda-forge
backports.functools_lru_cache 1.6.1 py_0 conda-forge
beautifulsoup4 4.9.3 pyhb0f4dca_0 conda-forge
black 20.8b1 py_1 conda-forge
bokeh 2.3.0 py38h578d9bd_0 conda-forge
boost-cpp 1.72.0 h9d3c048_4 conda-forge
boto3 1.17.30 pyhd8ed1ab_0 conda-forge
botocore 1.20.30 pyhd8ed1ab_0 conda-forge
bottleneck 1.3.2 py38h5c078b8_3 conda-forge
brotlipy 0.7.0 py38h497a2fe_1001 conda-forge
bzip2 1.0.8 h7f98852_4 conda-forge
c-ares 1.17.1 h7f98852_1 conda-forge
ca-certificates 2020.12.5 ha878542_0 conda-forge
cached-property 1.5.2 hd8ed1ab_1 conda-forge
cached_property 1.5.2 pyha770c72_1 conda-forge
cairo 1.16.0 h7979940_1007 conda-forge
cartopy 0.18.0 py38hab71064_13 conda-forge
cdat_info 8.2.1 pyh9f0ad1d_1 conda-forge
cdms2 3.1.5 pypi_0 pypi
cdtime 3.1.4 py38h49bcaf2_2 conda-forge
certifi 2020.12.5 py38h578d9bd_1 conda-forge
cf-units 2.1.4 py38hab2c0dc_2 conda-forge
cffi 1.14.5 py38ha65f79e_0 conda-forge
cfgrib 0.9.8.5 pyhd8ed1ab_0 conda-forge
cfgv 3.2.0 py_0 conda-forge
cfitsio 3.470 hb418390_7 conda-forge
cftime 1.4.1 py38h5c078b8_0 conda-forge
chardet 4.0.0 py38h578d9bd_1 conda-forge
click 7.1.2 pyh9f0ad1d_0 conda-forge
click-plugins 1.1.1 py_0 conda-forge
cligj 0.7.1 pyhd8ed1ab_0 conda-forge
cloudpickle 1.6.0 py_0 conda-forge
coverage 5.5 py38h497a2fe_0 conda-forge
coveralls 3.0.1 pyhd8ed1ab_0 conda-forge
cryptography 3.4.6 py38ha5dfef3_0 conda-forge
curl 7.75.0 h979ede3_0 conda-forge
cycler 0.10.0 py_2 conda-forge
cytoolz 0.11.0 py38h497a2fe_3 conda-forge
dask 2021.3.0 pyhd8ed1ab_0 conda-forge
dask-core 2021.3.0 pyhd8ed1ab_0 conda-forge
dataclasses 0.8 pyhc8e2a94_1 conda-forge
dbus 1.13.6 hfdff14a_1 conda-forge
decorator 4.4.2 py_0 conda-forge
distarray 2.12.2 py_1 conda-forge
distlib 0.3.1 pyh9f0ad1d_0 conda-forge
distributed 2021.3.0 py38h578d9bd_0 conda-forge
docopt 0.6.2 py_1 conda-forge
eccodes 2.20.0 ha0e6eb6_0 conda-forge
editdistance 0.5.3 py38h709712a_3 conda-forge
esmf 8.0.1 mpi_mpich_h3cbecb6_102 conda-forge
esmpy 8.0.1 mpi_mpich_py38h6f0bf2d_102 conda-forge
execnet 1.8.0 pyh44b312d_0 conda-forge
expat 2.2.10 h9c3ff4c_0 conda-forge
fasteners 0.14.1 py_3 conda-forge
filelock 3.0.12 pyh9f0ad1d_0 conda-forge
flake8 3.9.0 pyhd8ed1ab_0 conda-forge
fontconfig 2.13.1 hba837de_1004 conda-forge
freetype 2.10.4 h0708190_1 conda-forge
freexl 1.0.6 h7f98852_0 conda-forge
fsspec 0.8.7 pyhd8ed1ab_0 conda-forge
future 0.18.2 py38h578d9bd_3 conda-forge
g2clib 1.6.0 hf3f1b0b_9 conda-forge
geos 3.9.1 h9c3ff4c_2 conda-forge
geotiff 1.6.0 h11d48b3_4 conda-forge
gettext 0.19.8.1 h0b5b191_1005 conda-forge
giflib 5.2.1 h516909a_2 conda-forge
glib 2.66.7 h9c3ff4c_1 conda-forge
glib-tools 2.66.7 h9c3ff4c_1 conda-forge
gprof2dot 2019.11.30 py_0 conda-forge
gst-plugins-base 1.18.4 h29181c9_0 conda-forge
gstreamer 1.18.4 h76c114f_0 conda-forge
h5netcdf 0.10.0 pyhd8ed1ab_0 conda-forge
h5py 3.1.0 nompi_py38hafa665b_100 conda-forge
hdf4 4.2.13 h10796ff_1004 conda-forge
hdf5 1.10.6 mpi_mpich_h996c276_1014 conda-forge
heapdict 1.0.1 py_0 conda-forge
hypothesis 6.8.1 pyhd8ed1ab_0 conda-forge
icu 68.1 h58526e2_0 conda-forge
identify 2.1.3 pyhd8ed1ab_0 conda-forge
idna 2.10 pyh9f0ad1d_0 conda-forge
importlib-metadata 3.7.3 py38h578d9bd_0 conda-forge
importlib_metadata 3.7.3 hd8ed1ab_0 conda-forge
importlib_resources 5.1.2 py38h578d9bd_0 conda-forge
iniconfig 1.1.1 pyh9f0ad1d_0 conda-forge
ipython 7.21.0 py38h81c977d_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
iris 2.4.0 py38h578d9bd_1 conda-forge
isort 5.7.0 pyhd8ed1ab_0 conda-forge
jasper 1.900.1 h07fcdf6_1006 conda-forge
jedi 0.18.0 py38h578d9bd_2 conda-forge
jinja2 2.11.3 pyh44b312d_0 conda-forge
jmespath 0.10.0 pyh9f0ad1d_0 conda-forge
jpeg 9d h516909a_0 conda-forge
json-c 0.15 h98cffda_0 conda-forge
jsonschema 3.2.0 py38h32f6830_1 conda-forge
jupyter_core 4.7.1 py38h578d9bd_0 conda-forge
kealib 1.4.14 hcc255d8_2 conda-forge
kiwisolver 1.3.1 py38h1fd1430_1 conda-forge
krb5 1.17.2 h926e7f8_0 conda-forge
lazy-object-proxy 1.5.2 py38h497a2fe_1 conda-forge
lcms2 2.12 hddcbb42_0 conda-forge
ld_impl_linux-64 2.35.1 hea4e1c9_2 conda-forge
libaec 1.0.4 he1b5a44_1 conda-forge
libblas 3.8.0 17_openblas conda-forge
libcblas 3.8.0 17_openblas conda-forge
libcdms 3.1.2 h981a4fd_113 conda-forge
libcf 1.0.3 py38h88b7cc0_109 conda-forge
libclang 11.1.0 default_ha53f305_0 conda-forge
libcst 0.3.17 py38h578d9bd_0 conda-forge
libcurl 7.75.0 hc4aaa36_0 conda-forge
libdap4 3.20.6 hd7c4107_1 conda-forge
libdrs 3.1.2 h7918d09_113 conda-forge
libdrs_f 3.1.2 h5026c31_111 conda-forge
libedit 3.1.20191231 he28a2e2_2 conda-forge
libev 4.33 h516909a_1 conda-forge
libevent 2.1.10 hcdb4288_3 conda-forge
libffi 3.3 h58526e2_2 conda-forge
libgcc-ng 9.3.0 h2828fa1_18 conda-forge
libgdal 3.2.1 h38ff51b_7 conda-forge
libgfortran-ng 9.3.0 hff62375_18 conda-forge
libgfortran5 9.3.0 hff62375_18 conda-forge
libglib 2.66.7 h3e27bee_1 conda-forge
libgomp 9.3.0 h2828fa1_18 conda-forge
libiconv 1.16 h516909a_0 conda-forge
libkml 1.3.0 hd79254b_1012 conda-forge
liblapack 3.8.0 17_openblas conda-forge
libllvm10 10.0.1 he513fc3_3 conda-forge
libllvm11 11.1.0 hf817b99_0 conda-forge
libnetcdf 4.7.4 mpi_mpich_hdef422e_7 conda-forge
libnghttp2 1.43.0 h812cca2_0 conda-forge
libopenblas 0.3.10 pthreads_h4812303_5 conda-forge
libpng 1.6.37 hed695b0_2 conda-forge
libpq 13.1 hfd2b0eb_2 conda-forge
librttopo 1.1.0 h1185371_6 conda-forge
libspatialite 5.0.1 he52d314_3 conda-forge
libssh2 1.9.0 ha56f1ee_6 conda-forge
libstdcxx-ng 9.3.0 h6de172a_18 conda-forge
libtiff 4.2.0 hdc55705_0 conda-forge
libuuid 2.32.1 h14c3975_1000 conda-forge
libwebp-base 1.2.0 h7f98852_2 conda-forge
libxcb 1.13 h7f98852_1003 conda-forge
libxkbcommon 1.0.3 he3ba5ed_0 conda-forge
libxml2 2.9.10 h72842e0_3 conda-forge
libxslt 1.1.33 h15afd5d_2 conda-forge
line_profiler 3.1.0 py38h82cb98a_1 conda-forge
llvmlite 0.36.0 py38h4630a5e_0 conda-forge
locket 0.2.0 py_2 conda-forge
lxml 4.6.2 py38hf1fe3a4_1 conda-forge
lz4-c 1.9.3 h9c3ff4c_0 conda-forge
markupsafe 1.1.1 py38h497a2fe_3 conda-forge
matplotlib 3.3.4 py38h578d9bd_0 conda-forge
matplotlib-base 3.3.4 py38h0efea84_0 conda-forge
mccabe 0.6.1 py_1 conda-forge
mechanicalsoup 1.0.0 pyhd8ed1ab_0 conda-forge
monkeytype 20.5.0 pyh516909a_0 conda-forge
monotonic 1.5 py_0 conda-forge
more-itertools 8.7.0 pyhd8ed1ab_0 conda-forge
mpi 1.0 mpich conda-forge
mpi4py 3.0.3 py38he865349_5 conda-forge
mpich 3.4.1 h846660c_104 conda-forge
msgpack-python 1.0.2 py38h1fd1430_1 conda-forge
mypy 0.812 pyhd8ed1ab_0 conda-forge
mypy_extensions 0.4.3 py38h578d9bd_3 conda-forge
mysql-common 8.0.23 ha770c72_1 conda-forge
mysql-libs 8.0.23 h935591d_1 conda-forge
nbformat 5.1.2 pyhd8ed1ab_1 conda-forge
nc-time-axis 1.2.0 py_1 conda-forge
ncurses 6.2 h58526e2_4 conda-forge
netcdf-fortran 4.5.3 mpi_mpich_h7ad8bfe_1 conda-forge
netcdf4 1.5.6 nompi_py38h1cdf482_100 conda-forge
nodeenv 1.5.0 pyh9f0ad1d_0 conda-forge
nspr 4.30 h9c3ff4c_0 conda-forge
nss 3.62 hb5efdd6_0 conda-forge
numba 0.53.0 py38h5e62926_1 conda-forge
numbagg 0.1 pypi_0 pypi
numcodecs 0.7.3 py38h709712a_0 conda-forge
numpy 1.20.1 py38h18fd61f_0 conda-forge
olefile 0.46 pyh9f0ad1d_1 conda-forge
openblas 0.3.10 pthreads_h04b7a96_5 conda-forge
openjpeg 2.4.0 hf7af979_0 conda-forge
openssl 1.1.1j h7f98852_0 conda-forge
packaging 20.9 pyh44b312d_0 conda-forge
pandas 1.2.3 py38h51da96c_0 conda-forge
parso 0.8.1 pyhd8ed1ab_0 conda-forge
partd 1.1.0 py_0 conda-forge
pathspec 0.8.1 pyhd3deb0d_0 conda-forge
patsy 0.5.1 py_0 conda-forge
pcre 8.44 he1b5a44_0 conda-forge
pexpect 4.8.0 py38h32f6830_1 conda-forge
pickleshare 0.7.5 py38h32f6830_1002 conda-forge
pillow 8.1.2 py38ha0e1e83_0 conda-forge
pint 0.16.1 py_0 conda-forge
pip 21.0.1 pyhd8ed1ab_0 conda-forge
pixman 0.40.0 h36c2ea0_0 conda-forge
pluggy 0.13.1 py38h578d9bd_4 conda-forge
poppler 0.89.0 h2de54a5_5 conda-forge
poppler-data 0.4.10 0 conda-forge
postgresql 13.1 h6303168_2 conda-forge
pre-commit 2.11.1 py38h578d9bd_0 conda-forge
proj 7.2.0 h277dcde_2 conda-forge
prompt-toolkit 3.0.17 pyha770c72_0 conda-forge
pseudonetcdf 3.1.0 py_1 conda-forge
psutil 5.8.0 py38h497a2fe_1 conda-forge
pthread-stubs 0.4 h36c2ea0_1001 conda-forge
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
py 1.10.0 pyhd3deb0d_0 conda-forge
pycodestyle 2.7.0 pyhd8ed1ab_0 conda-forge
pycparser 2.20 pyh9f0ad1d_2 conda-forge
pydap 3.2.2 py38_1000 conda-forge
pyflakes 2.3.0 pyhd8ed1ab_0 conda-forge
pygments 2.8.1 pyhd8ed1ab_0 conda-forge
pyke 1.1.1 py38h578d9bd_1003 conda-forge
pyopenssl 20.0.1 pyhd8ed1ab_0 conda-forge
pyparsing 2.4.7 pyh9f0ad1d_0 conda-forge
pyqt 5.12.3 py38h578d9bd_7 conda-forge
pyqt-impl 5.12.3 py38h7400c14_7 conda-forge
pyqt5-sip 4.19.18 py38h709712a_7 conda-forge
pyqtchart 5.12 py38h7400c14_7 conda-forge
pyqtwebengine 5.12.1 py38h7400c14_7 conda-forge
pyrsistent 0.17.3 py38h497a2fe_2 conda-forge
pyshp 2.1.3 pyh44b312d_0 conda-forge
pysocks 1.7.1 py38h578d9bd_3 conda-forge
pytest 6.2.2 py38h578d9bd_0 conda-forge
pytest-cov 2.11.1 pyh44b312d_0 conda-forge
pytest-env 0.6.2 py_0 conda-forge
pytest-forked 1.3.0 pyhd3deb0d_0 conda-forge
pytest-profiling 1.7.0 py_1 conda-forge
pytest-xdist 2.2.1 pyhd8ed1ab_0 conda-forge
python 3.8.6 hffdb5ce_5_cpython conda-forge
python-dateutil 2.8.1 py_0 conda-forge
python-xxhash 2.0.0 py38h497a2fe_1 conda-forge
python_abi 3.8 1_cp38 conda-forge
pytz 2021.1 pyhd8ed1ab_0 conda-forge
pyyaml 5.4.1 py38h497a2fe_0 conda-forge
qt 5.12.9 hda022c4_4 conda-forge
rasterio 1.2.1 py38h57accd2_2 conda-forge
readline 8.0 he28a2e2_2 conda-forge
regex 2020.11.13 py38h497a2fe_1 conda-forge
regrid2 3.1.5 pypi_0 pypi
requests 2.25.1 pyhd3deb0d_0 conda-forge
s3transfer 0.3.4 pyhd8ed1ab_0 conda-forge
scipy 1.6.1 py38hb2138dd_0 conda-forge
seaborn 0.11.1 ha770c72_0 conda-forge
seaborn-base 0.11.1 pyhd8ed1ab_1 conda-forge
setuptools 49.6.0 py38h578d9bd_3 conda-forge
shapely 1.7.1 py38h4fc1155_4 conda-forge
six 1.15.0 pyh9f0ad1d_0 conda-forge
snuggs 1.4.7 py_0 conda-forge
sortedcontainers 2.3.0 pyhd8ed1ab_0 conda-forge
soupsieve 2.0.1 py38h32f6830_0 conda-forge
sparse 0.11.2 py_0 conda-forge
sqlite 3.34.0 h74cdb3f_0 conda-forge
statsmodels 0.12.2 py38h5c078b8_0 conda-forge
tblib 1.6.0 py_0 conda-forge
tiledb 2.2.5 h91fcb0e_0 conda-forge
tk 8.6.10 hed695b0_1 conda-forge
toml 0.10.2 pyhd8ed1ab_0 conda-forge
toolz 0.11.1 py_0 conda-forge
tornado 6.1 py38h497a2fe_1 conda-forge
traitlets 5.0.5 py_0 conda-forge
typed-ast 1.4.2 py38h497a2fe_0 conda-forge
typing_extensions 3.7.4.3 py_0 conda-forge
typing_inspect 0.6.0 pyh9f0ad1d_0 conda-forge
tzcode 2021a h7f98852_1 conda-forge
tzdata 2021a he74cb21_0 conda-forge
udunits2 2.2.27.27 h360fe7b_0 conda-forge
urllib3 1.26.4 pyhd8ed1ab_0 conda-forge
virtualenv 20.4.3 py38h578d9bd_0 conda-forge
wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge
webob 1.8.6 py_0 conda-forge
wheel 0.36.2 pyhd3deb0d_0 conda-forge
xarray 0.16.2.dev111+g0d93c4f9.d20201219 dev_0 <develop>
xerces-c 3.2.3 h9d8b166_2 conda-forge
xorg-kbproto 1.0.7 h14c3975_1002 conda-forge
xorg-libice 1.0.10 h516909a_0 conda-forge
xorg-libsm 1.2.3 hd9c2040_1000 conda-forge
xorg-libx11 1.7.0 h36c2ea0_0 conda-forge
xorg-libxau 1.0.9 h14c3975_0 conda-forge
xorg-libxdmcp 1.1.3 h516909a_0 conda-forge
xorg-libxext 1.3.4 h7f98852_1 conda-forge
xorg-libxrender 0.9.10 h7f98852_1003 conda-forge
xorg-renderproto 0.11.1 h14c3975_1002 conda-forge
xorg-xextproto 7.3.0 h14c3975_1002 conda-forge
xorg-xproto 7.0.31 h14c3975_1007 conda-forge
xxhash 0.8.0 h7f98852_3 conda-forge
xz 5.2.5 h516909a_1 conda-forge
yaml 0.2.5 h516909a_0 conda-forge
zarr 2.6.1 pyhd8ed1ab_0 conda-forge
zict 2.0.0 py_0 conda-forge
zipp 3.4.1 pyhd8ed1ab_0 conda-forge
zlib 1.2.11 h516909a_1010 conda-forge
zstd 1.4.9 ha95c52a_0 conda-forge
```
edit: added the traceback |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/5053/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
806218687 | MDU6SXNzdWU4MDYyMTg2ODc= | 4892 | disallow boolean coordinates? | mathause 10194086 | open | 0 | 2 | 2021-02-11T09:33:17Z | 2021-03-31T10:30:49Z | MEMBER | Today I stumbled over a small pitfall, which I think could be avoided: I am working with arrays that have axes labeled with categorical values and I ended up using True/False as labels for some binary categories:
I assume that this behavior is reasonable in most cases - And I for sure will stop using bools as binary category labels. That said in the above case the conceptually identical call results in completely different outcome. My (radical) proposal would be: forbid binary coordinates in general to avoid such confusion. Curious about your thoughts! Hth, Marti Originally posted by @martinitus in https://github.com/pydata/xarray/discussions/4861 |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4892/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue | ||||||||
683777199 | MDU6SXNzdWU2ODM3NzcxOTk= | 4364 | plt.pcolormesh will infer interval breaks per default | mathause 10194086 | open | 0 | 3 | 2020-08-21T19:15:57Z | 2021-03-19T14:09:52Z | MEMBER | Looking at some warnings in #3266 I saw that matplotlib will deprecate the old behaviour of ```python import numpy as np import matplotlib.pyplot as plt x = np.array([1, 2, 3]) y = np.array([1, 2, 3, 4, 5]) data = np.random.randn(*y.shape + x.shape) f, axes = plt.subplots(1, 2) for ax, shading, behavior in zip(axes, ["flat", "nearest"], ["old", "new"]): ax.pcolormesh(x, y, data, shading=shading, vmin=-0.75, vmax=0.75) ax.set_title(f"{behavior}: shading='{shading}'") ``` This is a good thing in general - we already do this for a long time with the This change was introduced in mpl 3.3.0 |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4364/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue | ||||||||
817951965 | MDU6SXNzdWU4MTc5NTE5NjU= | 4970 | minimum version and non-semantic versioning (netCDF4) | mathause 10194086 | closed | 0 | 1 | 2021-02-27T15:33:48Z | 2021-03-08T00:20:38Z | 2021-03-08T00:20:38Z | MEMBER | We currently pin netCDF4 to version 1.5. However, I think netCDF4 does not really follow semantic versioning, e.g. python 2 support was dropped in version 1.5.6. So they may actually be doing something like So I wonder if we would need to pin netCDF to version to version 1.5.4. |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4970/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
814806676 | MDU6SXNzdWU4MTQ4MDY2NzY= | 4945 | Upstream CI failing silently | mathause 10194086 | closed | 0 | 1 | 2021-02-23T20:30:29Z | 2021-02-24T08:14:00Z | 2021-02-24T08:14:00Z | MEMBER | The last 5 days our Upstream CI failed silently with a timeout after 6h: This was probably caused by #4934. As mentioned in dask/dask#4934 this is probably dask/dask#6738 which was merged 5 days ago. |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4945/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
803402841 | MDU6SXNzdWU4MDM0MDI4NDE= | 4881 | check mypy at the end of some CI runs? | mathause 10194086 | closed | 0 | 2 | 2021-02-08T10:04:44Z | 2021-02-22T16:33:50Z | 2021-02-22T16:33:50Z | MEMBER | We currently run mypy in the I think we should at least add this to |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4881/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
739008382 | MDU6SXNzdWU3MzkwMDgzODI= | 4570 | fix compatibility with h5py version 3 and unpin tests | mathause 10194086 | closed | 0 | 6 | 2020-11-09T13:00:01Z | 2021-02-17T08:41:20Z | 2021-02-17T08:41:20Z | MEMBER | h5py version 3.1 broke our tests. I pinned it to version 2.10 in #4569. We should therefore
The failures could be related to a change how strings are read: https://docs.h5py.org/en/latest/strings.html I am not sure if this has to be fixed in xarray or in h5necdf. I'd be happy if someone else took this one. Failed tests:
```
FAILED xarray/tests/test_backends.py::TestH5NetCDFData::test_zero_dimensional_variable
FAILED xarray/tests/test_backends.py::TestH5NetCDFData::test_write_store - As...
FAILED xarray/tests/test_backends.py::TestH5NetCDFData::test_roundtrip_test_data
FAILED xarray/tests/test_backends.py::TestH5NetCDFData::test_load - Assertion...
FAILED xarray/tests/test_backends.py::TestH5NetCDFData::test_dataset_compute
FAILED xarray/tests/test_backends.py::TestH5NetCDFData::test_roundtrip_object_dtype
FAILED xarray/tests/test_backends.py::TestH5NetCDFData::test_roundtrip_string_data
FAILED xarray/tests/test_backends.py::TestH5NetCDFData::test_orthogonal_indexing
FAILED xarray/tests/test_backends.py::TestH5NetCDFData::test_vectorized_indexing
FAILED xarray/tests/test_backends.py::TestH5NetCDFData::test_isel_dataarray
FAILED xarray/tests/test_backends.py::TestH5NetCDFData::test_array_type_after_indexing
FAILED xarray/tests/test_backends.py::TestH5NetCDFData::test_append_write - A...
FAILED xarray/tests/test_backends.py::TestH5NetCDFData::test_append_overwrite_values
FAILED xarray/tests/test_backends.py::TestH5NetCDFData::test_write_groups - A...
FAILED xarray/tests/test_backends.py::TestH5NetCDFData::test_encoding_kwarg_vlen_string
FAILED xarray/tests/test_backends.py::TestH5NetCDFData::test_compression_encoding
FAILED xarray/tests/test_backends.py::TestH5NetCDFFileObject::test_zero_dimensional_variable
FAILED xarray/tests/test_backends.py::TestH5NetCDFFileObject::test_write_store
FAILED xarray/tests/test_backends.py::TestH5NetCDFFileObject::test_roundtrip_test_data
FAILED xarray/tests/test_backends.py::TestH5NetCDFFileObject::test_load - Ass...
FAILED xarray/tests/test_backends.py::TestH5NetCDFFileObject::test_dataset_compute
FAILED xarray/tests/test_backends.py::TestH5NetCDFFileObject::test_roundtrip_object_dtype
FAILED xarray/tests/test_backends.py::TestH5NetCDFViaDaskData::test_encoding_kwarg_vlen_string
FAILED xarray/tests/test_backends.py::TestH5NetCDFViaDaskData::test_compression_encoding
FAILED xarray/tests/test_distributed.py::test_dask_distributed_netcdf_roundtrip[h5netcdf-NETCDF4]
FAILED xarray/tests/test_distributed.py::test_dask_distributed_read_netcdf_integration_test[h5netcdf-NETCDF4]
```
Example failure: ```python traceback
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4570/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
800118528 | MDU6SXNzdWU4MDAxMTg1Mjg= | 4858 | doctest failure with numpy 1.20 | mathause 10194086 | closed | 0 | 4 | 2021-02-03T08:57:43Z | 2021-02-07T21:57:34Z | 2021-02-07T21:57:34Z | MEMBER | What happened: Our doctests fail since numpy 1.20 came out: https://github.com/pydata/xarray/pull/4760/checks?check_run_id=1818512841#step:8:69 What you expected to happen: They don't ;-) Minimal Complete Verifiable Example: The following fails with numpy 1.20 while it converted ```python import numpy as np x = np.arange(10) x = np.pad(x, 1, "constant", constant_values=np.nan) ``` requires numpy 1.20 Anything else we need to know?:
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4858/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
802992417 | MDU6SXNzdWU4MDI5OTI0MTc= | 4875 | assigning values with incompatible dtype | mathause 10194086 | open | 0 | 0 | 2021-02-07T16:28:24Z | 2021-02-07T16:28:24Z | MEMBER | The behavior of xarray when assigning values with incompatible dtypes is a bit arbitrary. This is partly due to the behavior of numpy.... numpy 1.20 got a bit cleverer but still seems inconsistent at times... I am not sure what to do about this (and if we should actually be clever here).
```python import xarray as xr import numpy as np arr = np.array([2]) arr[0] = np.nan ValueError (since numpy 1.20)arr[0:1] = np.array([np.nan]) -> array([-9223372036854775808])da = xr.DataArray([5], dims="x") da[0] = np.nan <xarray.DataArray (x: 1)>array([-9223372036854775808])Dimensions without coordinates: x(because this gets converted to da.variable._data[0:1, 0:1] = np.array([np.nan]) (approximately). da[0] = 1.2345 casts constant_values to int```
pad ```python da.pad(x=1, constant_values=np.nan) ValueError: cannot convert float NaN to integerda.pad(x=1, constant_values=None) casts da to floatda.pad(x=1, constant_values=1.5) casts constant_values to int```
**shift**
```python
da.shift(x=1, fill_value=np.nan)
# ValueError: cannot convert float NaN to integer
# da.shift(x=1, fill_value=None)
# None not allowed by shift
da.shift(x=1, fill_value=1.5)
# casts fill_value to int
```
**rolling**
```python
da.rolling(x=1).construct("new_axis", stride=3, fill_value=np.nan)
# ValueError: cannot convert float NaN to integer
# da.rolling(x=1).construct("new_axis", stride=3, fill_value=None)
# None not allowed by rolling
da.rolling(x=3).construct("new_axis", stride=3, fill_value=1.5)
# casts fill_value to int
```
To check:
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4875/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue | ||||||||
785825401 | MDU6SXNzdWU3ODU4MjU0MDE= | 4808 | Upstream dev CI does not show "version info" | mathause 10194086 | closed | 0 | 3 | 2021-01-14T09:24:04Z | 2021-01-15T01:01:04Z | 2021-01-14T23:45:07Z | MEMBER | Would be nice if it did :-) |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4808/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
722437965 | MDU6SXNzdWU3MjI0Mzc5NjU= | 4514 | encode_cf_datetime: reference_date can not be "2000-02-30" | mathause 10194086 | closed | 0 | 3 | 2020-10-15T15:25:10Z | 2021-01-05T15:42:37Z | 2021-01-05T15:42:37Z | MEMBER | What happened: I try to save the result of What you expected to happen: The dataset can be saved. Minimal Complete Verifiable Example: ```python import cftime import xarray as xr time = xr.cftime_range("2000-02-30", "2001-01-01", freq="3M", calendar="360_day") dates = np.asarray(time) reference_date = xr.coding.times.infer_datetime_units(dates) 'days since 2000-02-30 00:00:00.000000'xr.coding.times.encode_cf_datetime(time) ValueError``` Traceback:
```python-traceback
---------------------------------------------------------------------------
OutOfBoundsDatetime Traceback (most recent call last)
~/.conda/envs/ipcc_ar6/lib/python3.7/site-packages/xarray/coding/times.py in encode_cf_datetime(dates, units, calendar)
367 # parse with cftime instead
--> 368 raise OutOfBoundsDatetime
369 assert dates.dtype == "datetime64[ns]"
OutOfBoundsDatetime:
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
<ipython-input-157-727cb22f83b1> in <module>
4 time = xr.cftime_range("2000-02-30", "2001-01-01", freq="3M", calendar="360_day")
5
----> 6 xr.coding.times.encode_cf_datetime(time)
~/.conda/envs/ipcc_ar6/lib/python3.7/site-packages/xarray/coding/times.py in encode_cf_datetime(dates, units, calendar)
385
386 except (OutOfBoundsDatetime, OverflowError):
--> 387 num = _encode_datetime_with_cftime(dates, units, calendar)
388
389 num = cast_to_int_if_safe(num)
~/.conda/envs/ipcc_ar6/lib/python3.7/site-packages/xarray/coding/times.py in _encode_datetime_with_cftime(dates, units, calendar)
332 return np.nan if d is None else cftime.date2num(d, units, calendar)
333
--> 334 return np.vectorize(encode_datetime)(dates)
335
336
~/.conda/envs/ipcc_ar6/lib/python3.7/site-packages/numpy/lib/function_base.py in __call__(self, *args, **kwargs)
2089 vargs.extend([kwargs[_n] for _n in names])
2090
-> 2091 return self._vectorize_call(func=func, args=vargs)
2092
2093 def _get_ufunc_and_otypes(self, func, args):
~/.conda/envs/ipcc_ar6/lib/python3.7/site-packages/numpy/lib/function_base.py in _vectorize_call(self, func, args)
2159 res = func()
2160 else:
-> 2161 ufunc, otypes = self._get_ufunc_and_otypes(func=func, args=args)
2162
2163 # Convert args to object arrays first
~/.conda/envs/ipcc_ar6/lib/python3.7/site-packages/numpy/lib/function_base.py in _get_ufunc_and_otypes(self, func, args)
2119
2120 inputs = [arg.flat[0] for arg in args]
-> 2121 outputs = func(*inputs)
2122
2123 # Performance note: profiling indicates that -- for simple
~/.conda/envs/ipcc_ar6/lib/python3.7/site-packages/xarray/coding/times.py in encode_datetime(d)
330
331 def encode_datetime(d):
--> 332 return np.nan if d is None else cftime.date2num(d, units, calendar)
333
334 return np.vectorize(encode_datetime)(dates)
cftime/_cftime.pyx in cftime._cftime.date2num()
cftime/_cftime.pyx in cftime._cftime._dateparse()
ValueError: day is out of range for month
```
Anything else we need to know?: This goes wrong here: https://github.com/pydata/xarray/blob/15537497136345ed67e9e8b089bcd4573df0b2ea/xarray/coding/times.py#L249-L250 A possible fix is to add the following lines:
To workaround set the encoding manually:
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4514/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
761266480 | MDU6SXNzdWU3NjEyNjY0ODA= | 4671 | windows test timeout | mathause 10194086 | closed | 0 | 3 | 2020-12-10T14:00:54Z | 2020-12-15T16:40:38Z | 2020-12-15T16:40:38Z | MEMBER | The windows tests seem to regularly time out after 60 min, which is annoying. All other tests seem to run about twice as fast... There is some stuff we can try (which may or may not help):
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4671/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
766450436 | MDU6SXNzdWU3NjY0NTA0MzY= | 4690 | Linux py36-bare-minimum will likely fail | mathause 10194086 | closed | 0 | 1 | 2020-12-14T13:41:56Z | 2020-12-14T19:47:59Z | 2020-12-14T19:47:59Z | MEMBER | The Linux py36-bare-minimum will likely fail with a This could be fixed by adding |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4690/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
755566566 | MDU6SXNzdWU3NTU1NjY1NjY= | 4643 | mamba does not use strict channel priority (in our CI) | mathause 10194086 | closed | 0 | 0 | 2020-12-02T19:54:19Z | 2020-12-05T00:30:11Z | 2020-12-05T00:30:11Z | MEMBER | We use mamba in the new CI: I just tested it and it is awesomely fast! However, it does not enforce strict channel priority, so packages from main get mixed in (see e.g. https://github.com/pydata/xarray/runs/1487637678#step:5:112 & search for
(note there is a cc @andersy005: mybe you could add this to #4604? |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4643/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
714993891 | MDU6SXNzdWU3MTQ5OTM4OTE= | 4487 | overloaded functions have several signatures in the docs | mathause 10194086 | closed | 0 | 5 | 2020-10-05T16:37:02Z | 2020-11-24T14:52:09Z | 2020-11-24T14:52:09Z | MEMBER | See (http://xarray.pydata.org/en/latest/generated/xarray.concat.html) Can this be fixed? Or do we actually want to show both? |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4487/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
741115905 | MDU6SXNzdWU3NDExMTU5MDU= | 4574 | nightly upstream test | mathause 10194086 | closed | 0 | 6 | 2020-11-11T22:31:53Z | 2020-11-22T02:37:14Z | 2020-11-22T02:37:14Z | MEMBER | As discussed in the call today it would be nice to remove the upstream test from our ci and setup a "nightly" job to test against the development versions of pandas etc. This should lead to less failures unrelated to specific PRs. Question: how are we going to see that the upstream build failed? Having the failure in random PRs is not clean but very visible... This could be done via github actions. See xpublish for an example setup: https://github.com/xarray-contrib/xpublish/tree/master/.github/workflows xref #4313 |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4574/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
723181209 | MDU6SXNzdWU3MjMxODEyMDk= | 4516 | py38-upstream-dev failure: 'CFTimeIndex' object has no attribute '_id' | mathause 10194086 | closed | 0 | 6 | 2020-10-16T12:39:01Z | 2020-10-23T01:08:50Z | 2020-10-23T01:08:50Z | MEMBER | Now that #4502 was fixed upstream we get a new issue in
The failure did not happen on the 14. Oct. (https://github.com/pydata/xarray/commit/db4f03e467d13229512f8f7924dc142db1b9486b the failures here are #4502) but it appeared on the 15. Oct. (https://github.com/pydata/xarray/commit/15537497136345ed67e9e8b089bcd4573df0b2ea) Maybe a change in pandas? I have not looked at it closely - maybe @spencerkclark sees what's going on? |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4516/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
724020766 | MDU6SXNzdWU3MjQwMjA3NjY= | 4521 | cfgrib does not work with newest eccodes version | mathause 10194086 | closed | 0 | 0 | 2020-10-18T14:35:37Z | 2020-10-19T22:21:13Z | 2020-10-19T22:21:13Z | MEMBER | See ecmwf/cfgrib#167. This causes our doc build to fail (#4520). The tests do not fail because todo - [ ] unpin docs again - [ ] it's probably quite a corner case but - should the tests fail? How would this be achieved...? |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4521/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
721833440 | MDU6SXNzdWU3MjE4MzM0NDA= | 4509 | test_dataarray.py not run in py38-all-but-dask | mathause 10194086 | closed | 0 | 2 | 2020-10-14T22:25:00Z | 2020-10-18T15:30:59Z | 2020-10-18T15:30:59Z | MEMBER | The See
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4509/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
718869334 | MDU6SXNzdWU3MTg4NjkzMzQ= | 4502 | dask dev upstream test failiures | mathause 10194086 | closed | 0 | 1 | 2020-10-11T16:12:13Z | 2020-10-16T12:17:58Z | 2020-10-16T12:17:57Z | MEMBER | Our upstream tests fail due to a change in dask. The likely culprit is dask/dask#6680 - ```python import xarray as xr import dask da = xr.DataArray(dask.array.array(""))
xr.zeros_like(da, dtype=bool)
What happened: ```python /home/vsts/work/1/s/xarray/tests/test_duck_array_ops.py:499: /home/vsts/work/1/s/xarray/testing.py:139: in compat_variable return a.dims == b.dims and (a._data is b._data or equiv(a.data, b.data)) /home/vsts/work/1/s/xarray/testing.py:36: in _data_allclose_or_equiv return duck_array_ops.array_equiv(arr1, arr2) /home/vsts/work/1/s/xarray/core/duck_array_ops.py:246: in array_equiv flag_array = (arr1 == arr2) | (isnull(arr1) & isnull(arr2)) /home/vsts/work/1/s/xarray/core/duck_array_ops.py:104: in isnull return zeros_like(data, dtype=bool) /home/vsts/work/1/s/xarray/core/duck_array_ops.py:56: in f return wrapped(args, *kwargs) /usr/share/miniconda/envs/xarray-tests/lib/python3.8/site-packages/dask/array/creation.py:174: in zeros_like return zeros( /usr/share/miniconda/envs/xarray-tests/lib/python3.8/site-packages/dask/array/wrap.py:78: in wrap_func_shape_as_first_arg return Array(dsk, name, chunks, dtype=dtype, meta=kwargs.get("meta", None)) /usr/share/miniconda/envs/xarray-tests/lib/python3.8/site-packages/dask/array/core.py:1083: in new meta = meta_from_array(meta, dtype=dtype) x = array('', dtype='<U1'), ndim = 0, dtype = dtype('bool')
``` |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4502/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
532878771 | MDU6SXNzdWU1MzI4Nzg3NzE= | 3595 | xr.Dataset.map drops attrs of DataArray | mathause 10194086 | closed | 0 | 6 | 2019-12-04T19:11:35Z | 2020-10-14T16:29:52Z | 2020-10-14T16:29:52Z | MEMBER | MCVE Code Sample```python import xarray as xr import numpy as np ds = xr.DataArray([1, 2], attrs=dict(tst="DataArray")).to_dataset(name="data") ds.attrs["tst"] = "Dataset" ds.map(np.mean, keep_attrs=True).data ``` returns
Expected Output
Problem DescriptionApplying In constrast EDIT: corrected example Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3595/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
679445858 | MDU6SXNzdWU2Nzk0NDU4NTg= | 4342 | unpin matplotlib in ci/requirements/doc.yml again | mathause 10194086 | closed | 0 | 0 | 2020-08-14T23:15:23Z | 2020-10-06T14:43:50Z | 2020-10-06T14:43:50Z | MEMBER | Matplotlib 3.3.1 broke the doc build so I pinned it to 3.3.0 - see #4340 The likely culprit is https://github.com/matplotlib/matplotlib/issues/18254 - thanks @jthielen for finding the matplotlib issue |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4342/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
681627420 | MDU6SXNzdWU2ODE2Mjc0MjA= | 4352 | da.sum(min_count=1) errors for integer data | mathause 10194086 | closed | 0 | 1 | 2020-08-19T07:52:35Z | 2020-10-02T09:28:27Z | 2020-10-02T09:28:27Z | MEMBER | What happened:
What you expected to happen:
Minimal Complete Verifiable Example:
Anything else we need to know?: Full traceback
```python
In [37]: da.sum(min_count=1)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-37-817bfdfe2211> in <module>
----> 1 da.sum(min_count=1)
~/code/xarray/xarray/core/common.py in wrapped_func(self, dim, axis, skipna, **kwargs)
44
45 def wrapped_func(self, dim=None, axis=None, skipna=None, **kwargs):
---> 46 return self.reduce(func, dim, axis, skipna=skipna, **kwargs)
47
48 else:
~/code/xarray/xarray/core/dataarray.py in reduce(self, func, dim, axis, keep_attrs, keepdims, **kwargs)
2336 """
2337
-> 2338 var = self.variable.reduce(func, dim, axis, keep_attrs, keepdims, **kwargs)
2339 return self._replace_maybe_drop_dims(var)
2340
~/code/xarray/xarray/core/variable.py in reduce(self, func, dim, axis, keep_attrs, keepdims, allow_lazy, **kwargs)
1591 data = func(input_data, axis=axis, **kwargs)
1592 else:
-> 1593 data = func(input_data, **kwargs)
1594
1595 if getattr(data, "shape", ()) == self.shape:
~/code/xarray/xarray/core/duck_array_ops.py in f(values, axis, skipna, **kwargs)
310
311 try:
--> 312 return func(values, axis=axis, **kwargs)
313 except AttributeError:
314 if not isinstance(values, dask_array_type):
~/code/xarray/xarray/core/duck_array_ops.py in f(*args, **kwargs)
46 else:
47 wrapped = getattr(eager_module, name)
---> 48 return wrapped(*args, **kwargs)
49
50 else:
<__array_function__ internals> in sum(*args, **kwargs)
TypeError: _sum_dispatcher() got an unexpected keyword argument 'min_count'
```
Environment: Output of <tt>xr.show_versions()</tt>INSTALLED VERSIONS ------------------ commit: a7fb5a9fa1a2b829181ea9e4986b959f315350dd python: 3.7.3 | packaged by conda-forge | (default, Jul 1 2019, 21:52:21) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 5.4.0-42-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.6 libnetcdf: 4.7.4 xarray: 0.15.2.dev64+g2542a63f pandas: 0.25.3 numpy: 1.17.3 scipy: 1.3.1 netCDF4: 1.5.4 pydap: installed h5netcdf: 0.7.4 h5py: 2.10.0 Nio: None zarr: 2.3.2 cftime: 1.0.4.2 nc_time_axis: None PseudoNetCDF: installed rasterio: 1.1.0 cfgrib: 0.9.5.4 iris: None bottleneck: 1.2.1 dask: 2.6.0 distributed: 2.6.0 matplotlib: 3.3.1 cartopy: 0.18.0 seaborn: 0.9.0 numbagg: None pint: None setuptools: 49.6.0.post20200814 pip: 19.3.1 conda: None pytest: 5.2.2 IPython: 7.17.0 sphinx: None |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4352/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
688115687 | MDU6SXNzdWU2ODgxMTU2ODc= | 4385 | warnings from internal use of apply_ufunc | mathause 10194086 | closed | 0 | 4 | 2020-08-28T14:28:56Z | 2020-08-30T16:37:52Z | 2020-08-30T16:37:52Z | MEMBER | Another follow up from #4060: Minimal Complete Verifiable Example:
We should probably check the warnings in the test suite - there may be others. |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4385/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
587735698 | MDU6SXNzdWU1ODc3MzU2OTg= | 3890 | error for apply_ufunc with exclude_dims and vectorize | mathause 10194086 | closed | 0 | 2 | 2020-03-25T14:26:36Z | 2020-08-24T13:37:49Z | 2020-08-24T13:37:49Z | MEMBER | I tried to use MCVE Code Sample```python import xarray as xr import scipy as sp import scipy.stats import numpy as np create dataarrays of unequal lengthds = xr.tutorial.open_dataset("air_temperature") da1 = ds.air da2 = ds.air.isel(time=slice(None, 50)) function that takes arguments of unequal length and requires vectorizingdef mannwhitneyu(x, y): _, p = sp.stats.mannwhitneyu(x, y) return p test that the function takes arguments of unequal lengthmannwhitneyu(da1.isel(lat=0, lon=0), da2.isel(lat=0, lon=0)) xr.apply_ufunc( mannwhitneyu, da1, da2, input_core_dims=[["time"], ["time"]], exclude_dims=set(["time"]), vectorize=True, ) ``` Returns
Expected OutputA DataArray. Problem DescriptionI can reproduce the problem in pure numpy:
The correct result is returned when the VersionsOutput of `xr.show_versions()`This is my development environment, so i think xarray should be 'master'. **PNC:/home/mathause/conda/envs/xarray_devel/lib/python3.7/site-packages/PseudoNetCDF/pncwarn.py:24:UserWarning: pyproj could not be found, so IO/API coordinates cannot be converted to lat/lon; to fix, install pyproj or basemap (e.g., `pip install pyproj)` INSTALLED VERSIONS ------------------ commit: None python: 3.7.3 | packaged by conda-forge | (default, Jul 1 2019, 21:52:21) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 4.15.0-91-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.1 xarray: 0.11.1+335.gb0c336f6 pandas: 0.25.3 numpy: 1.17.3 scipy: 1.3.1 netCDF4: 1.5.3 pydap: installed h5netcdf: 0.7.4 h5py: 2.10.0 Nio: None zarr: 2.3.2 cftime: 1.0.4.2 nc_time_axis: None PseudoNetCDF: installed rasterio: 1.1.0 cfgrib: 0.9.5.4 iris: None bottleneck: 1.2.1 dask: 2.6.0 distributed: 2.6.0 matplotlib: 3.1.2 cartopy: None seaborn: 0.9.0 numbagg: None setuptools: 41.6.0.post20191101 pip: 19.3.1 conda: installed pytest: 5.2.2 IPython: 7.9.0 sphinx: None |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3890/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
681904962 | MDU6SXNzdWU2ODE5MDQ5NjI= | 4354 | sum: min_count is not available for reduction with more than one dimensions | mathause 10194086 | closed | 0 | 0 | 2020-08-19T14:52:41Z | 2020-08-20T16:22:55Z | 2020-08-20T16:22:55Z | MEMBER | Is your feature request related to a problem? Please describe.
Describe the solution you'd like The logic to calculate the number of valid elements is here: https://github.com/pydata/xarray/blob/1be777fe725a85b8cc0f65a2bc41f4bc2ba18043/xarray/core/nanops.py#L35 I think this can be fixed by replacing
Additional context Potentially relevant for #4351 |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4354/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
592629388 | MDU6SXNzdWU1OTI2MjkzODg= | 3927 | use level of a MultiIndex for plotting? | mathause 10194086 | closed | 0 | 1 | 2020-04-02T13:24:05Z | 2020-05-25T16:32:15Z | 2020-05-25T16:32:15Z | MEMBER | It would be nice to be able to use a level of a MultiIndex for plotting. MCVE Code Sample```python import numpy as np import xarray as xr da = xr.DataArray( np.random.randn(10), dims="x", coords=dict( a=("x", np.arange(10, 20)), b=("x", np.arange(1, 11)) ) ) da = da.set_index(x=["a", "b"])
da
Is there a way to plot a line using one of the levels of the MultiIindex?
Expected OutputA line plot VersionsOutput of `xr.show_versions()`INSTALLED VERSIONS ------------------ commit: b3bafeefbd6e6d70bce505ae1f0d9d5a2b015089 python: 3.7.3 | packaged by conda-forge | (default, Jul 1 2019, 21:52:21) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 4.15.0-91-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.1 xarray: 0.11.1+335.gb0c336f6 pandas: 0.25.3 numpy: 1.17.3 scipy: 1.3.1 netCDF4: 1.5.3 pydap: installed h5netcdf: 0.7.4 h5py: 2.10.0 Nio: None zarr: 2.3.2 cftime: 1.0.4.2 nc_time_axis: None PseudoNetCDF: installed rasterio: 1.1.0 cfgrib: 0.9.5.4 iris: None bottleneck: 1.2.1 dask: 2.6.0 distributed: 2.6.0 matplotlib: 3.1.2 cartopy: 0.17.0 seaborn: 0.9.0 numbagg: None pint: None setuptools: 41.6.0.post20191101 pip: 19.3.1 conda: None pytest: 5.2.2 IPython: 7.9.0 sphinx: None |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3927/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
620351521 | MDU6SXNzdWU2MjAzNTE1MjE= | 4074 | [bug] when passing boolean weights to weighted mean | mathause 10194086 | closed | 0 | 0 | 2020-05-18T16:38:18Z | 2020-05-23T21:06:19Z | 2020-05-23T21:06:19Z | MEMBER | MCVE Code Sample```python import numpy as np import xarray as xr dta = xr.DataArray([1., 1., 1.]) wgt = xr.DataArray(np.array([1, 1, 0], dtype=np.bool)) dta.weighted(wgt).mean() ``` Returns
Expected Output
Problem DescriptionPassing a boolean array as weights to the weighted mean returns the wrong result because the
We'll need to convert it to int or float:
VersionsOutput of <tt>xr.show_versions()</tt>INSTALLED VERSIONS ------------------ commit: None python: 3.7.6 | packaged by conda-forge | (default, Mar 23 2020, 23:03:20) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 5.3.0-51-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.6 libnetcdf: 4.7.4 xarray: 0.15.1 pandas: 1.0.3 numpy: 1.18.1 scipy: 1.4.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: 1.1.1.2 nc_time_axis: None PseudoNetCDF: None rasterio: 1.1.3 cfgrib: None iris: None bottleneck: None dask: 2.16.0 distributed: 2.16.0 matplotlib: 3.2.1 cartopy: 0.17.0 seaborn: None numbagg: None setuptools: 46.1.3.post20200325 pip: 20.1 conda: None pytest: 5.4.1 IPython: 7.13.0 sphinx: 3.0.3 |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4074/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
559864146 | MDU6SXNzdWU1NTk4NjQxNDY= | 3750 | isort pre-commit hook does not skip text files | mathause 10194086 | closed | 0 | 4 | 2020-02-04T17:18:31Z | 2020-05-06T01:50:29Z | 2020-03-28T20:58:15Z | MEMBER | MCVE Code SampleAdd arbitrary change to the file
The pre-commit hook will fail. Expected Outputthe pre-commit hook to pass Problem Descriptionrunning |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3750/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
522457033 | MDU6SXNzdWU1MjI0NTcwMzM= | 3524 | xr.plot infers sequential colormap on diverging levels | mathause 10194086 | closed | 0 | 2 | 2019-11-13T20:32:46Z | 2020-04-05T13:41:25Z | 2020-04-05T13:41:25Z | MEMBER | MCVE Code Sample```python import numpy as np import xarray as xr data = np.random.randn(10, 10) data = np.abs(data) da = xr.DataArray(data) returns a diverging colormapda.plot(vmax=2, center=0, extend="both") returns a sequential colormapda.plot(levels=[-2, -1, 0, 1, 2], extend="both") ``` Expected OutputA diverging colormap, maybe? Problem DescriptionI was surprised by getting the viridis colormap until I realised that my data must all be positive and the colormap is infered from the data and not from levels. However, when specifying the range via Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3524/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
308030789 | MDU6SXNzdWUzMDgwMzA3ODk= | 2010 | rolling.mean vs rolling.construct.mean | mathause 10194086 | closed | 0 | 8 | 2018-03-23T13:34:05Z | 2020-03-26T02:02:59Z | 2020-03-26T02:02:59Z | MEMBER | Code Sample, a copy-pastable example if possible```python import xarray as xr import numpy as np x = np.arange(4.) ds = xr.DataArray(x, dims=('dim', )) ds.rolling(dim=3, center=True).mean() RESULT: array([nan, 1., 2., nan])ds.rolling(dim=3, center=True).construct('window').mean('window') RESULT: array([0.5, 1. , 2. , 2.5])``` Problem description
Expected OutputI would expect both ways to yield the same result. Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2010/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
180641734 | MDU6SXNzdWUxODA2NDE3MzQ= | 1029 | `flatten` as convinience method for stack all? | mathause 10194086 | closed | 0 | 6 | 2016-10-03T13:35:28Z | 2020-03-25T08:31:18Z | 2020-03-25T08:31:18Z | MEMBER | There is a bunch of operations that need to be conducted on a 1D array. It could be handy to have a convinience method that mimicks numpys
What do you think? |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/1029/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
84127296 | MDU6SXNzdWU4NDEyNzI5Ng== | 422 | add average function | mathause 10194086 | closed | 0 | 23 | 2015-06-02T17:53:53Z | 2020-03-19T14:29:42Z | 2020-03-19T14:29:42Z | MEMBER | It would be nice to be able to do |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/422/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
559794979 | MDU6SXNzdWU1NTk3OTQ5Nzk= | 3747 | The seaborn.apionly entry-point has been removed. | mathause 10194086 | closed | 0 | 2 | 2020-02-04T15:28:57Z | 2020-02-05T16:03:52Z | 2020-02-05T16:03:52Z | MEMBER | Seaborn recently dropped the There is a dedicated but it is not used in one place which now causes test failures Todo: double check if the supported versions of seaborn still require this workaround. |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3747/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
549679475 | MDU6SXNzdWU1NDk2Nzk0NzU= | 3694 | xr.dot requires equal indexes (join="exact") | mathause 10194086 | closed | 0 | 5 | 2020-01-14T16:28:15Z | 2020-01-20T12:09:27Z | 2020-01-20T12:09:27Z | MEMBER | MCVE Code Sample```python import xarray as xr import numpy as np d1 = xr.DataArray(np.arange(4), dims=["a"], coords=dict(a=[0, 1, 2, 3])) d2 = xr.DataArray(np.arange(4), dims=["a"], coords=dict(a=[0, 1, 2, 3])) note: different coordsd3 = xr.DataArray(np.arange(4), dims=["a"], coords=dict(a=[1, 2, 3, 4])) (d1 * d2).sum() # -> array(14) xr.dot(d1, d2) # -> array(14) (d2 * d3).sum() # -> array(8) xr.dot(d2, d3) # -> ValueError ``` Expected Output
Problem DescriptionThe last statement results in an
This is a problem for #2922 (weighted operations) - I think it is fine for the weights and data to not align. Fixing this may be as easy as specifying @fujiisoup Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3694/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
545764524 | MDU6SXNzdWU1NDU3NjQ1MjQ= | 3665 | Cannot roundtrip time in NETCDF4_CLASSIC | mathause 10194086 | closed | 0 | 4 | 2020-01-06T14:47:48Z | 2020-01-16T18:27:15Z | 2020-01-16T18:27:14Z | MEMBER | MCVE Code Sample``` python import numpy as np import xarray as xr time = xr.cftime_range("2006-01-01", periods=2, calendar="360_day") da = xr.DataArray(time, dims=["time"]) da.encoding["dtype"] = np.float da.to_netcdf("tst.nc", format="NETCDF4_CLASSIC") ds = xr.open_dataset("tst.nc") ds.to_netcdf("tst2.nc", format="NETCDF4_CLASSIC") ``` yields:
Or an example without ```python import numpy as np import xarray as xr time = xr.cftime_range("2006-01-01", periods=2, calendar="360_day") da = xr.DataArray(time, dims=["time"]) da.encoding["_FillValue"] = np.array([np.nan]) xr.backends.netcdf3.encode_nc3_variable(xr.conventions.encode_cf_variable(da)) ``` Expected OutputXarray can save the dataset/ an Problem DescriptionIf there is a time variable that can be encoded using integers only, but that has a Note: if the time cannot be encoded using integers only, it works: ``` python da = xr.DataArray(time, dims=["time"]) da.encoding["_FillValue"] = np.array([np.nan]) da.encoding["units"] = "days since 2006-01-01T12:00:00" xr.backends.netcdf3.encode_nc3_variable(xr.conventions.encode_cf_variable(da)) ``` Another note: when saving with NETCDF4 ``` python da = xr.DataArray(time, dims=["time"]) da.encoding["_FillValue"] = np.array([np.nan]) xr.backends.netCDF4_._encode_nc4_variable(xr.conventions.encode_cf_variable(da))
Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3665/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
539010474 | MDU6SXNzdWU1MzkwMTA0NzQ= | 3634 | "ValueError: Percentiles must be in the range [0, 100]" | mathause 10194086 | closed | 0 | 1 | 2019-12-17T11:34:35Z | 2019-12-17T13:50:06Z | 2019-12-17T13:50:06Z | MEMBER | MCVE Code Sample```python import xarray as xr da = xr.DataArray([0, 1, 2]) da.quantile(q=50)
Expected Output
Problem DescriptionBy wrapping BTW: thanks for #3559, makes my life easier! Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3634/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
523037716 | MDU6SXNzdWU1MjMwMzc3MTY= | 3535 | subtracting CFTimeIndex can cause pd.TimedeltaIndex to overflow | mathause 10194086 | closed | 0 | 2 | 2019-11-14T18:45:03Z | 2019-12-07T20:38:00Z | 2019-12-07T20:38:00Z | MEMBER | MCVE Code Sample
Expected Outputa timedelta Problem Descriptionreturns The offending lines are here Ultimately this is probably a pandas problem as it tries to convert @spencerkclark Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3535/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
509851476 | MDU6SXNzdWU1MDk4NTE0NzY= | 3423 | add `ALL_DIMS` in `xr.dot` | mathause 10194086 | closed | 0 | 0 | 2019-10-21T09:45:24Z | 2019-10-29T19:12:51Z | 2019-10-29T19:12:51Z | MEMBER | MCVE Code Sample```python import numpy as np import xarray as xr da_a = xr.DataArray(np.arange(3 * 2).reshape(3, 2), dims=['a', 'b']) da_b = xr.DataArray(np.arange(3 * 2 * 2).reshape(3, 2, 2), dims=['a', 'b', 'c']) xr.dot(da_a, da_b, dims=None)
To sum over all dimensions: ```python xr.dot(da_a, da_b, dims=['a', 'b', 'c'])
Problem Description
Therefore I suggest to allow I assume there is no intent to change the behavior of @fujiisoup @max-sixty Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3423/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
490229690 | MDU6SXNzdWU0OTAyMjk2OTA= | 3284 | specifying list of colors does not work for me | mathause 10194086 | closed | 0 | 1 | 2019-09-06T09:36:08Z | 2019-09-09T18:31:16Z | 2019-09-09T18:31:16Z | MEMBER | MCVE Code Sample```python import xarray as xr import numpy as np airtemps = xr.tutorial.load_dataset('air_temperature') air = airtemps.air.isel(time=0) levels = np.arange(225, 301, 25) colors = ['#ffffb2', '#fecc5c', '#fd8d3c', '#e31a1c'] this does not work for meair.plot.pcolormesh(levels=levels, colors=colors) ``` Expected OutputShould create a plot with the specified colors. According to the the docstring this should work. Or maybe I am doing something wrong here? Problem DescriptionInstead I get the following error: ```python /usr/local/Miniconda3-envs/envs/2019/envs/iacpy3_2019/lib/python3.7/site-packages/xarray/plot/utils.py in _process_cmap_cbar_kwargs(func, kwargs, data) 683 # colors is only valid when levels is supplied or the plot is of type 684 # contour or contourf --> 685 if colors and (('contour' not in func.name) and (not levels)): 686 raise ValueError("Can only specify colors with contour or levels") 687 ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() ``` Instead I use the following, which works:
Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3284/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
441341354 | MDU6SXNzdWU0NDEzNDEzNTQ= | 2948 | xr.merge fails when passing dict | mathause 10194086 | closed | 0 | 5 | 2019-05-07T17:06:07Z | 2019-06-12T15:33:26Z | 2019-06-12T15:33:26Z | MEMBER | Code Sample```python import xarray as xr a = xr.DataArray([1, 2], dims=('foo', ), name='a') b = xr.DataArray([3], dims=('bar', ), name='b') objects = dict(a=a, b=b) xr.merge(objects) ``` Problem descriptionThis returns an ``` python def merge(objects, compat='no_conflicts', join='outer'): """Merge any number of xarray objects into a single Dataset as variables.
... ``` Expected OutputEither the docs or the Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2948/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
407864596 | MDU6SXNzdWU0MDc4NjQ1OTY= | 2754 | silence warning for decode_cf_datetime? | mathause 10194086 | closed | 0 | 7 | 2019-02-07T19:38:38Z | 2019-02-19T20:47:26Z | 2019-02-19T20:47:26Z | MEMBER | Code Sample, a copy-pastable example if possible```python import xarray as xr import numpy as np x = np.arange(100) * 365 x = xr.coding.times.decode_cf_datetime(x, 'days since 2400-01-01', calendar='proleptic_gregorian') ``` Problem descriptionxarray still throws an error when decoding out-of-bounds dates for proleptic_gregorian - should this be silenced? Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2754/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
106595746 | MDU6SXNzdWUxMDY1OTU3NDY= | 577 | wrap lon coordinates to 360 | mathause 10194086 | closed | 0 | 4 | 2015-09-15T16:36:37Z | 2019-01-17T09:34:56Z | 2019-01-15T20:15:01Z | MEMBER | Assume I have two datasets with the same lat/ lon grid. However, one has |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/577/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
84068169 | MDU6SXNzdWU4NDA2ODE2OQ== | 418 | select range/ slice with method='nearest' | mathause 10194086 | closed | 0 | 5 | 2015-06-02T15:17:27Z | 2019-01-15T20:10:20Z | 2019-01-15T20:10:19Z | MEMBER | It would be nice to support nearest neighbour selection with a slice like so: Or is there another possibility how to achieve this functionality? use case: Often I look at a region with different data sets that don't have the same resolutions. It would be nice to be able to select the closest-matching region with an easy syntax. |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/418/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
310819233 | MDU6SXNzdWUzMTA4MTkyMzM= | 2036 | better error message for to_netcdf -> unlimited_dims | mathause 10194086 | closed | 0 | 4 | 2018-04-03T12:39:21Z | 2018-05-18T14:48:32Z | 2018-05-18T14:48:32Z | MEMBER | Code Sample, a copy-pastable example if possible```python Your code hereimport numpy as np import xarray as xr x = np.arange(10) da = xr.Dataset(data_vars=dict(data=('dim1', x)), coords=dict(dim1=('dim1', x), dim2=('dim2', x))) da.to_netcdf('tst.nc', format='NETCDF4_CLASSIC', unlimited_dims='dim1') ``` Problem descriptionThis creates the error The correct syntax is With I only tested with netCDF4 as backend. Expected Output
Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2036/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
317954266 | MDU6SXNzdWUzMTc5NTQyNjY= | 2085 | units = 'days' leads to timedelta64 for data variable | mathause 10194086 | closed | 0 | 5 | 2018-04-26T09:47:11Z | 2018-04-26T16:44:25Z | 2018-04-26T15:55:09Z | MEMBER | Code Sample```python import numpy as np import xarray as xr def test_units(units):
test_units('seconds') test_units('second') test_units('minutes') test_units('minute') test_units('days') test_units('day') test_units('months') test_units('years') ``` Problem descriptionReturns:
Expected OutputI would expect type float for all of them. Or is this expected behaviour? I have a dataset that reports 'consecutive dry days' and the dataset creator correctly set the units of the data to 'days', but I don't want this to be decoded (but the time axis should).... Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2085/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
295498327 | MDU6SXNzdWUyOTU0OTgzMjc= | 1896 | _color_palette not using full range of colors if seaborn is installed | mathause 10194086 | closed | 0 | 2 | 2018-02-08T12:43:45Z | 2018-02-16T21:08:32Z | 2018-02-16T21:08:32Z | MEMBER |
if seaborn is installed, and 1.00, ... 0.58, ... 0.00, ... otherwise Problem descriptionthe return value of The relevant code is here: https://github.com/pydata/xarray/blob/6aa225f5dae9cc997e232c11a63072923c8c0238/xarray/plot/utils.py#L115 https://github.com/pydata/xarray/blob/6aa225f5dae9cc997e232c11a63072923c8c0238/xarray/plot/utils.py#L143 The same logic in seaborn https://github.com/mwaskom/seaborn/blob/0beede57152ce80ce1d4ef5d0c0f1cb61d118375/seaborn/palettes.py#L411 Intuitively I prefer the xarray solution because this uses the full range of colors which I find beneficial, however there may be a reason for this I'm not aware of. Maybe @mwaskom will answer: mwaskom/seaborn#1372 Expected OutputOutput of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/1896/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
106581329 | MDU6SXNzdWUxMDY1ODEzMjk= | 576 | define fill value for where | mathause 10194086 | closed | 0 | 4 | 2015-09-15T15:27:32Z | 2017-08-08T17:00:30Z | 2017-08-08T17:00:30Z | MEMBER | It would be nice if
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/576/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
105442957 | MDU6SXNzdWUxMDU0NDI5NTc= | 561 | calculate percentiles | mathause 10194086 | closed | 0 | 3 | 2015-09-08T18:28:12Z | 2017-01-23T18:22:14Z | 2017-01-23T18:22:14Z | MEMBER | How would I calculate percentiles over a certain dimension?
Does not work. |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/561/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
144575316 | MDU6SXNzdWUxNDQ1NzUzMTY= | 808 | bottleneck version | mathause 10194086 | closed | 0 | 3 | 2016-03-30T12:36:54Z | 2017-01-07T07:43:34Z | 2017-01-07T07:43:34Z | MEMBER | Not sure if this is possible to specify in the
Feel free to close. |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/808/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
171956399 | MDU6SXNzdWUxNzE5NTYzOTk= | 975 | invalid timestamps in the future | mathause 10194086 | closed | 0 | 6 | 2016-08-18T17:29:02Z | 2016-08-25T22:39:26Z | 2016-08-25T22:39:26Z | MEMBER | If I have a netCDF file that has invalid timesteps from the 'future', it is wrongly converted to datetime64[ns]. ``` import netCDF4 as nc import numpy as np import xarray as xr create netCDF filencf = nc.Dataset('test_future.nc', 'w') ncf.createDimension('time') ncf.createVariable('time', np.int, dimensions=('time')) ncf.variables['time'].units = 'days since 1850-01-01 00:00:00' ncf.variables['time'].calendar = 'standard' ncf.variables['time'][:] = np.arange(850) * 365 ncf.close() open with xrds = xr.open_dataset('test_future.nc') this worksds ds.time is a datetime64[ns] objectthis failsds.time ``` If I choose chalendar='noleap' the dates wrap around! ``` ncf = nc.Dataset('test_future_noleap.nc', 'w') ncf.createDimension('time') ncf.createVariable('time', np.int, dimensions=('time')) ncf.variables['time'].units = 'days since 1850-01-01 00:00:00' ncf.variables['time'].calendar = 'noleap' ncf.variables['time'][:] = np.arange(850) * 365 ncf.close() open with xrds = xr.open_dataset('test_future_noleap.nc') after 2262 they go back to 1678!ds.time ``` If my 'invalid' time is from the 'past' it works as expected: ``` ncf = nc.Dataset('test_past.nc', 'w') ncf.createDimension('time') ncf.createVariable('time', np.int, dimensions=('time')) ncf.variables['time'].units = 'days since 1000-01-01 00:00:00' ncf.variables['time'].calendar = 'standard' ncf.variables['time'][:] = np.arange(850) * 365 ncf.close() open with xrds = xr.open_dataset('test_past.nc') this worksds ds.time is a objectds.time ``` |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/975/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
138443211 | MDU6SXNzdWUxMzg0NDMyMTE= | 784 | almost-equal grids | mathause 10194086 | closed | 0 | 6 | 2016-03-04T10:50:34Z | 2016-03-29T08:46:07Z | 2016-03-29T08:46:07Z | MEMBER | Sometimes it happens that you have two grids that are equal up to precision or "for practical purposes". xarray does not align them. Is there a possibility to still get them aligned (and not having to copy the coordinates from one to the other)? Examples:
- CESM output from the land model and the atmosphere model.
- I have a file with a region definition on a fine grid. If I regrid that to the model resolution with cdo the grids are equal up to |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/784/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
138519359 | MDU6SXNzdWUxMzg1MTkzNTk= | 786 | reindex and netCDF indexing | mathause 10194086 | closed | 0 | 2 | 2016-03-04T16:37:32Z | 2016-03-04T18:49:54Z | 2016-03-04T18:49:54Z | MEMBER | reindex can cause problems as long as the data is not loaded ``` import xarray as xr data = xr.DataArray([1, 2, 3], dims='x').to_dataset('name') data.to_netcdf('tst.nc') works finea = xr.open_dataset('tst.nc') a.load() a.reindex(x=[2, 0, 1]) problemb = xr.open_dataset('tst.nc') b.reindex(x=[2, 0, 1]) ``` |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/786/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
134321867 | MDU6SXNzdWUxMzQzMjE4Njc= | 766 | colormap with vmin vmax | mathause 10194086 | closed | 0 | 3 | 2016-02-17T16:02:30Z | 2016-02-18T08:38:50Z | 2016-02-18T08:06:05Z | MEMBER | When specifying a negative vmin and a positive vmax the ``` import xarray as xr import matplotlib.pyplot as plt airtemps = xr.tutorial.load_dataset('air_temperature') air2d = airtemps.air.isel(time=500) - 273.15 diverging colormapair2d.plot.pcolormesh() plt.show() viridisair2d.plot.pcolormesh(vmin=-24, vmax=24) plt.show() ------------------------------------------------------------the solution:diverging colormapair2d.plot.pcolormesh(vmin=-24, center=0) plt.show() ``` EDIT: solution and working example |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/766/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
67356079 | MDU6SXNzdWU2NzM1NjA3OQ== | 388 | DataArray and virtual variables | mathause 10194086 | closed | 0 | 2 | 2015-04-09T12:59:08Z | 2015-09-15T15:26:29Z | 2015-09-15T15:26:28Z | MEMBER | Now that we are at it... Why don't DataArrays have virtual variables? |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/388/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
105414928 | MDU6SXNzdWUxMDU0MTQ5Mjg= | 560 | replace time coordinates for whole year | mathause 10194086 | closed | 0 | 3 | 2015-09-08T16:09:52Z | 2015-09-08T16:40:52Z | 2015-09-08T16:40:52Z | MEMBER | It is quite convenient to select a whole year 1) Should 2) A possible workaround is:
Should this be added to the documentation or is this case too uncommon? |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/560/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
83530814 | MDU6SXNzdWU4MzUzMDgxNA== | 415 | Nearest neighbor lookups | mathause 10194086 | closed | 0 | 3 | 2015-06-01T14:34:03Z | 2015-06-02T07:29:24Z | 2015-06-01T18:27:21Z | MEMBER | Nearest neighbor lookups does not seem to work:
0.4.1
ValueError: not all values found in index 'x' Example from: http://xray.readthedocs.org/en/latest/indexing.html#nearest-neighbor-lookups (pandas version 0.16.1) |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/415/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
67332234 | MDU6SXNzdWU2NzMzMjIzNA== | 386 | "loosing" virtual variables | mathause 10194086 | closed | 0 | 4 | 2015-04-09T10:35:31Z | 2015-04-20T03:55:44Z | 2015-04-20T03:55:44Z | MEMBER | Once I take a mean over virtual variables, they are not available any more.
Is this intended behaviour? And could I get them back somehow? |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/386/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
67343193 | MDU6SXNzdWU2NzM0MzE5Mw== | 387 | Accessing virtual_variables | mathause 10194086 | closed | 0 | 1 | 2015-04-09T11:41:08Z | 2015-04-09T13:45:29Z | 2015-04-09T13:45:29Z | MEMBER | Virtual variables such as time.date can not be accessed by dot notation. ``` In [81]: ts.time.date AttributeError Traceback (most recent call last) <ipython-input-81-4206b510e310> in <module>() ----> 1 ts.time.date /home/mathause/.local/lib/python2.7/site-packages/xray/core/common.pyc in getattr(self, name) 115 pass 116 raise AttributeError("%r object has no attribute %r" % --> 117 (type(self).name, name)) 118 119 def dir(self): AttributeError: 'DataArray' object has no attribute 'date' ``` Compare
So maybe time.date is not a useful name. time_date? Or don't show these attributes to the user? |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/387/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]);