issues
10 rows where user = 6063709 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: comments, closed_at, 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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
677296128 | MDU6SXNzdWU2NzcyOTYxMjg= | 4336 | cftime_range fails for base cftime.datetime object | aidanheerdegen 6063709 | open | 0 | 8 | 2020-08-12T00:56:18Z | 2023-11-26T22:40:03Z | CONTRIBUTOR | What happened:
What you expected to happen: I expected Minimal Complete Verifiable Example:
Anything else we need to know?: Returns this error: ```python TypeError Traceback (most recent call last) <ipython-input-29-d090ea15e436> in <module> 2 import xarray 3 date = cftime.datetime(10,1,1) ----> 4 xarray.cftime_range(date, periods=3, freq='Y') /g/data3/hh5/public/apps/miniconda3/envs/analysis3-20.07/lib/python3.7/site-packages/xarray/coding/cftime_offsets.py in cftime_range(start, end, periods, freq, normalize, name, closed, calendar) 973 else: 974 offset = to_offset(freq) --> 975 dates = np.array(list(_generate_range(start, end, periods, offset))) 976 977 left_closed = False /g/data3/hh5/public/apps/miniconda3/envs/analysis3-20.07/lib/python3.7/site-packages/xarray/coding/cftime_offsets.py in _generate_range(start, end, periods, offset) 744 """ 745 if start: --> 746 start = offset.rollforward(start) 747 748 if end: /g/data3/hh5/public/apps/miniconda3/envs/analysis3-20.07/lib/python3.7/site-packages/xarray/coding/cftime_offsets.py in rollforward(self, date) 526 def rollforward(self, date): 527 """Roll date forward to nearest end of year""" --> 528 if self.onOffset(date): 529 return date 530 else: /g/data3/hh5/public/apps/miniconda3/envs/analysis3-20.07/lib/python3.7/site-packages/xarray/coding/cftime_offsets.py in onOffset(self, date) 522 """Check if the given date is in the set of possible dates created 523 using a length-one version of this offset class.""" --> 524 return date.day == _days_in_month(date) and date.month == self.month 525 526 def rollforward(self, date): /g/data3/hh5/public/apps/miniconda3/envs/analysis3-20.07/lib/python3.7/site-packages/xarray/coding/cftime_offsets.py in _days_in_month(date) 195 else: 196 reference = type(date)(date.year, date.month + 1, 1) --> 197 return (reference - timedelta(days=1)).day 198 199 TypeError: unsupported operand type(s) for -: 'cftime._cftime.datetime' and 'datetime.timedelta'
The error occurs here https://github.com/pydata/xarray/blob/master/xarray/coding/cftime_offsets.py#L197 because this operation is not defined for the base class https://github.com/Unidata/cftime/blob/master/cftime/_cftime.pyx#L1054 The relevant tests all seem to use datetime strings which are by default https://github.com/pydata/xarray/blob/master/xarray/coding/cftime_offsets.py#L788 Environment: Output of <tt>xr.show_versions()</tt>INSTALLED VERSIONS ------------------ commit: None python: 3.7.8 | packaged by conda-forge | (default, Jul 31 2020, 02:25:08) [GCC 7.5.0] python-bits: 64 OS: Linux OS-release: 2.6.32-754.18.2.el6.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: en_AU.utf8 LANG: en_AU.UTF-8 LOCALE: en_AU.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.4 xarray: 0.16.0 pandas: 1.1.0 numpy: 1.19.1 scipy: 1.5.2 netCDF4: 1.5.3 pydap: installed h5netcdf: 0.8.1 h5py: 2.10.0 Nio: 1.5.5 zarr: 2.4.0 cftime: 1.0.3.4 nc_time_axis: 1.2.0 PseudoNetCDF: None rasterio: 1.1.5 cfgrib: 0.9.8.4 iris: 2.4.0 bottleneck: 1.3.2 dask: 2.22.0 distributed: 2.22.0 matplotlib: 3.3.0 cartopy: 0.18.0 seaborn: 0.10.1 numbagg: None pint: 0.14 setuptools: 49.2.0.post20200712 pip: 20.1.1 conda: installed pytest: 6.0.1 IPython: 7.17.0 sphinx: 3.2.0 |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4336/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue | ||||||||
553930127 | MDU6SXNzdWU1NTM5MzAxMjc= | 3717 | reduce on groupby auto-adds axis argument and complains when axis argument is specified | aidanheerdegen 6063709 | open | 0 | 3 | 2020-01-23T04:29:58Z | 2022-04-06T15:38:59Z | CONTRIBUTOR | The behaviour of MCVE Code SampleI have repurposed someone else's nice code sample for this, thanks! ```python import pandas as pd import xarray as xr import numpy as np s_date = '1990-01-01' e_date = '2019-05-01' days = pd.date_range(start=s_date, end=e_date, freq='B', name='time') items = pd.Index([str(i) for i in range(300)], name = 'item') dat = xr.DataArray(np.random.rand(len(days), len(items)), coords=[days, items]) print(dat) def simplesum(array, axis): print(axis) return np.sum(array, axis) dat.groupby('time.month').reduce(simplesum) dat.groupby('time.month').reduce(simplesum, axis=0) ``` The The second ValueError Traceback (most recent call last) <ipython-input-42-381dec6862e6> in <module> ----> 1 dat.groupby('time.month').reduce(simplesum, axis=0) /g/data3/hh5/public/apps/miniconda3/envs/analysis3-20.01/lib/python3.7/site-packages/xarray/core/groupby.py in reduce(self, func, dim, axis, keep_attrs, shortcut, **kwargs) 836 check_reduce_dims(dim, self.dims) 837 --> 838 return self.map(reduce_array, shortcut=shortcut) 839 840 /g/data3/hh5/public/apps/miniconda3/envs/analysis3-20.01/lib/python3.7/site-packages/xarray/core/groupby.py in map(self, func, shortcut, args, kwargs) 755 grouped = self._iter_grouped() 756 applied = (maybe_wrap_array(arr, func(arr, *args, kwargs)) for arr in grouped) --> 757 return self._combine(applied, shortcut=shortcut) 758 759 def apply(self, func, shortcut=False, args=(), **kwargs): /g/data3/hh5/public/apps/miniconda3/envs/analysis3-20.01/lib/python3.7/site-packages/xarray/core/groupby.py in _combine(self, applied, restore_coord_dims, shortcut) 774 def _combine(self, applied, restore_coord_dims=False, shortcut=False): 775 """Recombine the applied objects like the original.""" --> 776 applied_example, applied = peek_at(applied) 777 coord, dim, positions = self._infer_concat_args(applied_example) 778 if shortcut: /g/data3/hh5/public/apps/miniconda3/envs/analysis3-20.01/lib/python3.7/site-packages/xarray/core/utils.py in peek_at(iterable) 180 """ 181 gen = iter(iterable) --> 182 peek = next(gen) 183 return peek, itertools.chain([peek], gen) 184 /g/data3/hh5/public/apps/miniconda3/envs/analysis3-20.01/lib/python3.7/site-packages/xarray/core/groupby.py in <genexpr>(.0) 754 else: 755 grouped = self._iter_grouped() --> 756 applied = (maybe_wrap_array(arr, func(arr, args, *kwargs)) for arr in grouped) 757 return self._combine(applied, shortcut=shortcut) 758 /g/data3/hh5/public/apps/miniconda3/envs/analysis3-20.01/lib/python3.7/site-packages/xarray/core/groupby.py in reduce_array(ar) 832 833 def reduce_array(ar): --> 834 return ar.reduce(func, dim, axis, keep_attrs=keep_attrs, **kwargs) 835 836 check_reduce_dims(dim, self.dims) /g/data3/hh5/public/apps/miniconda3/envs/analysis3-20.01/lib/python3.7/site-packages/xarray/core/variable.py in reduce(self, func, dim, axis, keep_attrs, keepdims, allow_lazy, **kwargs) 1511 dim = None 1512 if dim is not None and axis is not None: -> 1513 raise ValueError("cannot supply both 'axis' and 'dim' arguments") 1514 1515 if dim is not None: ValueError: cannot supply both 'axis' and 'dim' arguments ``` Expected OutputI would expect the output of both The second Problem DescriptionIt is impossible to specify a Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3717/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue | ||||||||
1120276279 | I_kwDOAMm_X85Cxg83 | 6226 | open_mfdataset fails with cftime index when using parallel and dask delayed client | aidanheerdegen 6063709 | closed | 0 | 6 | 2022-02-01T06:14:07Z | 2022-02-10T22:37:37Z | 2022-02-10T22:37:37Z | CONTRIBUTOR | What happened?A call to What did you expect to happen?I expected the call to Minimal Complete Verifiable Example```python import xarray as xr import numpy as np from dask.distributed import Client Need a main routine for dask.distributed if run as scriptif name == "main":
``` Relevant log output
Anything else we need to know?It seems similar to previous issues with pickling https://github.com/pydata/xarray/issues/5686 which was fixed in Environment``` INSTALLED VERSIONScommit: None python: 3.9.9 | packaged by conda-forge | (main, Dec 20 2021, 02:41:03) [GCC 9.4.0] python-bits: 64 OS: Linux OS-release: 4.18.0-348.2.1.el8.nci.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: en_AU.utf8 LANG: en_AU.ISO8859-1 LOCALE: ('en_US', 'UTF-8') libhdf5: 1.10.6 libnetcdf: 4.7.4 xarray: 0.20.2 pandas: 1.4.0 numpy: 1.22.1 scipy: 1.7.3 netCDF4: 1.5.6 pydap: installed h5netcdf: 0.13.1 h5py: 3.6.0 Nio: None zarr: 2.10.3 cftime: 1.5.2 nc_time_axis: 1.4.0 PseudoNetCDF: None rasterio: 1.2.6 cfgrib: 0.9.9.1 iris: 3.1.0 bottleneck: 1.3.2 dask: 2022.01.0 distributed: 2022.01.0 matplotlib: 3.5.1 cartopy: 0.19.0.post1 seaborn: 0.11.2 numbagg: None fsspec: 2022.01.0 cupy: 10.1.0 pint: 0.18 sparse: 0.13.0 setuptools: 59.8.0 pip: 21.3.1 conda: 4.11.0 pytest: 6.2.5 IPython: 8.0.1 sphinx: 4.4.0 ``` |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/6226/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
963688125 | MDU6SXNzdWU5NjM2ODgxMjU= | 5686 | xindexes set incorrectly for mfdataset with dask client and parallel=True | aidanheerdegen 6063709 | closed | 0 | 8 | 2021-08-09T06:29:41Z | 2021-08-09T23:44:10Z | 2021-08-09T22:36:53Z | CONTRIBUTOR | What happened: Using What you expected to happen: The Minimal Complete Verifiable Example: ```python import xarray as xr import numpy as np from dask.distributed import Client Need a main routine for dask.distributed if run as scriptif name == "main":
``` Anything else we need to know?: the https://github.com/pydata/xarray/blob/main/xarray/coding/cftimeindex.py#L677 because
Previously reported this as https://github.com/pydata/xarray/issues/5677 Environment: Output of <tt>xr.show_versions()</tt>INSTALLED VERSIONS ------------------ commit: None python: 3.9.6 | packaged by conda-forge | (default, Jul 11 2021, 03:39:48) [GCC 9.3.0] python-bits: 64 OS: Linux OS-release: 4.18.0-305.7.1.el8.nci.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: en_AU.utf8 LANG: en_AU.ISO8859-1 LOCALE: ('en_AU', 'UTF-8') libhdf5: 1.10.6 libnetcdf: 4.7.4 xarray: 0.19.0 pandas: 1.3.1 numpy: 1.21.1 scipy: 1.7.1 netCDF4: 1.5.6 pydap: installed h5netcdf: 0.11.0 h5py: 2.10.0 Nio: None zarr: 2.8.3 cftime: 1.5.0 nc_time_axis: 1.3.1 PseudoNetCDF: None rasterio: 1.2.6 cfgrib: 0.9.9.0 iris: 3.0.4 bottleneck: 1.3.2 dask: 2021.07.2 distributed: 2021.07.2 matplotlib: 3.4.2 cartopy: 0.19.0.post1 seaborn: 0.11.1 numbagg: None pint: 0.17 setuptools: 52.0.0.post20210125 pip: 21.1.3 conda: 4.10.3 pytest: 6.2.4 IPython: 7.26.0 sphinx: 4.1.2 |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/5686/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
962467654 | MDU6SXNzdWU5NjI0Njc2NTQ= | 5677 | sel slice fails with cftime index when using dask.distributed client | aidanheerdegen 6063709 | closed | 0 | 2 | 2021-08-06T07:16:20Z | 2021-08-09T06:30:26Z | 2021-08-09T06:30:26Z | CONTRIBUTOR | What happened: Tried to ```pythonKeyError Traceback (most recent call last) /g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/site-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance) 3360 try: -> 3361 return self._engine.get_loc(casted_key) 3362 except KeyError as err: /g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/site-packages/pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc() /g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/site-packages/pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc() pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item() pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item() KeyError: cftime.datetime(2086, 1, 1, 0, 0, 0, 0, calendar='gregorian', has_year_zero=False) The above exception was the direct cause of the following exception: KeyError Traceback (most recent call last) /g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/site-packages/pandas/core/indexes/base.py in get_slice_bound(self, label, side, kind) 5801 try: -> 5802 slc = self.get_loc(label) 5803 except KeyError as err: /g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/site-packages/xarray/coding/cftimeindex.py in get_loc(self, key, method, tolerance) 465 else: --> 466 return pd.Index.get_loc(self, key, method=method, tolerance=tolerance) 467 /g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/site-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance) 3362 except KeyError as err: -> 3363 raise KeyError(key) from err 3364 KeyError: cftime.datetime(2086, 1, 1, 0, 0, 0, 0, calendar='gregorian', has_year_zero=False) During handling of the above exception, another exception occurred: ValueError Traceback (most recent call last) src/cftime/_cftime.pyx in cftime._cftime.datetime.richcmp() src/cftime/_cftime.pyx in cftime._cftime.datetime.change_calendar() ValueError: change_calendar only works for real-world calendars During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) /local/v45/aph502/tmp/ipykernel_108691/1049912036.py in <module> ----> 1 u.sel(time=slice(start_time,end_time)) /g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/site-packages/xarray/core/dataarray.py in sel(self, indexers, method, tolerance, drop, **indexers_kwargs) 1313 Dimensions without coordinates: points 1314 """ -> 1315 ds = self._to_temp_dataset().sel( 1316 indexers=indexers, 1317 drop=drop, /g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/site-packages/xarray/core/dataset.py in sel(self, indexers, method, tolerance, drop, **indexers_kwargs) 2472 """ 2473 indexers = either_dict_or_kwargs(indexers, indexers_kwargs, "sel") -> 2474 pos_indexers, new_indexes = remap_label_indexers( 2475 self, indexers=indexers, method=method, tolerance=tolerance 2476 ) /g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/site-packages/xarray/core/coordinates.py in remap_label_indexers(obj, indexers, method, tolerance, **indexers_kwargs) 419 } 420 --> 421 pos_indexers, new_indexes = indexing.remap_label_indexers( 422 obj, v_indexers, method=method, tolerance=tolerance 423 ) /g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/site-packages/xarray/core/indexing.py in remap_label_indexers(data_obj, indexers, method, tolerance) 115 for dim, index in indexes.items(): 116 labels = grouped_indexers[dim] --> 117 idxr, new_idx = index.query(labels, method=method, tolerance=tolerance) 118 pos_indexers[dim] = idxr 119 if new_idx is not None: /g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/site-packages/xarray/core/indexes.py in query(self, labels, method, tolerance) 196 197 if isinstance(label, slice): --> 198 indexer = _query_slice(index, label, coord_name, method, tolerance) 199 elif is_dict_like(label): 200 raise ValueError( /g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/site-packages/xarray/core/indexes.py in _query_slice(index, label, coord_name, method, tolerance)
89 "cannot use /g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/site-packages/pandas/core/indexes/base.py in slice_indexer(self, start, end, step, kind) 5684 slice(1, 3, None) 5685 """ -> 5686 start_slice, end_slice = self.slice_locs(start, end, step=step) 5687 5688 # return a slice /g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/site-packages/pandas/core/indexes/base.py in slice_locs(self, start, end, step, kind) 5886 start_slice = None 5887 if start is not None: -> 5888 start_slice = self.get_slice_bound(start, "left") 5889 if start_slice is None: 5890 start_slice = 0 /g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/site-packages/pandas/core/indexes/base.py in get_slice_bound(self, label, side, kind) 5803 except KeyError as err: 5804 try: -> 5805 return self._searchsorted_monotonic(label, side) 5806 except ValueError: 5807 # raise the original KeyError /g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/site-packages/pandas/core/indexes/base.py in _searchsorted_monotonic(self, label, side) 5754 def _searchsorted_monotonic(self, label, side: str_t = "left"): 5755 if self.is_monotonic_increasing: -> 5756 return self.searchsorted(label, side=side) 5757 elif self.is_monotonic_decreasing: 5758 # np.searchsorted expects ascending sort order, have to reverse /g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/site-packages/pandas/core/base.py in searchsorted(self, value, side, sorter) 1219 @doc(_shared_docs["searchsorted"], klass="Index") 1220 def searchsorted(self, value, side="left", sorter=None) -> np.ndarray: -> 1221 return algorithms.searchsorted(self._values, value, side=side, sorter=sorter) 1222 1223 def drop_duplicates(self, keep="first"): /g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/site-packages/pandas/core/algorithms.py in searchsorted(arr, value, side, sorter) 1583 arr = ensure_wrapped_if_datetimelike(arr) 1584 -> 1585 return arr.searchsorted(value, side=side, sorter=sorter) 1586 1587 src/cftime/_cftime.pyx in cftime._cftime.datetime.richcmp() TypeError: cannot compare cftime.datetime(2086, 5, 16, 12, 0, 0, 0, calendar='noleap', has_year_zero=True) and cftime.datetime(2086, 1, 1, 0, 0, 0, 0, calendar='gregorian', has_year_zero=False) ``` So the slice indexing has created a bounding value with the wrong calendar, should be What you expected to happen: expected it to return the same slice it does without error if the client is not active. Minimal Complete Verifiable Example: I tried really really hard to create a synthetic example but I couldn't make one that
would fail, but loading the The dataset: xarray.DataArray 'u'
```python FWIWstart_time = '2086-01-01' end_time = '2086-12-31' u.sel(time=slice(start_time,end_time)) ``` Anything else we need to know?: I tried following the code execution through with by line 63
It is called here but it isn't obvious to me how that bad state is generated. Environment: Output of <tt>xr.show_versions()</tt>INSTALLED VERSIONS ------------------ commit: None python: 3.9.6 | packaged by conda-forge | (default, Jul 11 2021, 03:39:48) [GCC 9.3.0] python-bits: 64 OS: Linux OS-release: 4.18.0-326.el8.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: en_AU.utf8 LANG: en_US.UTF-8 LOCALE: ('en_AU', 'UTF-8') libhdf5: 1.10.6 libnetcdf: 4.7.4 xarray: 0.19.0 pandas: 1.3.1 numpy: 1.21.1 scipy: 1.7.0 netCDF4: 1.5.6 pydap: installed h5netcdf: 0.11.0 h5py: 2.10.0 Nio: None zarr: 2.8.3 cftime: 1.5.0 nc_time_axis: 1.3.1 PseudoNetCDF: None rasterio: 1.2.6 cfgrib: 0.9.9.0 iris: 3.0.4 bottleneck: 1.3.2 dask: 2021.07.2 distributed: 2021.07.2 matplotlib: 3.4.2 cartopy: 0.19.0.post1 seaborn: 0.11.1 numbagg: None pint: 0.17 setuptools: 52.0.0.post20210125 pip: 21.1.3 conda: 4.10.3 pytest: 6.2.4 IPython: 7.26.0 sphinx: 4.1.2 |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/5677/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
677307460 | MDU6SXNzdWU2NzczMDc0NjA= | 4337 | cftime_range does not support default cftime.datetime formatted output strings | aidanheerdegen 6063709 | closed | 0 | 5 | 2020-08-12T01:28:30Z | 2020-08-17T23:27:07Z | 2020-08-17T23:27:07Z | CONTRIBUTOR | Is your feature request related to a problem? Please describe. The
ValueError Traceback (most recent call last) <ipython-input-70-a16c1fcab8d6> in <module> 3 date = cftime.datetime(10,1,1).strftime() 4 print(date) ----> 5 xarray.cftime_range(date, periods=3, freq='Y') /g/data3/hh5/public/apps/miniconda3/envs/analysis3-20.07/lib/python3.7/site-packages/xarray/coding/cftime_offsets.py in cftime_range(start, end, periods, freq, normalize, name, closed, calendar) 963 964 if start is not None: --> 965 start = to_cftime_datetime(start, calendar) 966 start = _maybe_normalize_date(start, normalize) 967 if end is not None: /g/data3/hh5/public/apps/miniconda3/envs/analysis3-20.07/lib/python3.7/site-packages/xarray/coding/cftime_offsets.py in to_cftime_datetime(date_str_or_date, calendar) 683 "a calendar type must be provided" 684 ) --> 685 date, _ = _parse_iso8601_with_reso(get_date_type(calendar), date_str_or_date) 686 return date 687 elif isinstance(date_str_or_date, cftime.datetime): /g/data3/hh5/public/apps/miniconda3/envs/analysis3-20.07/lib/python3.7/site-packages/xarray/coding/cftimeindex.py in _parse_iso8601_with_reso(date_type, timestr) 101 102 default = date_type(1, 1, 1) --> 103 result = parse_iso8601(timestr) 104 replace = {} 105 /g/data3/hh5/public/apps/miniconda3/envs/analysis3-20.07/lib/python3.7/site-packages/xarray/coding/cftimeindex.py in parse_iso8601(datetime_string) 94 if match: 95 return match.groupdict() ---> 96 raise ValueError("no ISO-8601 match for string: %s" % datetime_string) 97 98 ValueError: no ISO-8601 match for string: 10-01-01 00:00:00 ``` Describe the solution you'd like
It would be good if Describe alternatives you've considered Specifying an ISO-8601 compatible format (using A work-around is to zero-pad manually
Additional context I think this is a relatively small addition to the codebase but would make it easier and less confusing to use the default format that is also used by the the function itself. It is easy to support as it is consistent and uniform. |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4337/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
481005183 | MDExOlB1bGxSZXF1ZXN0MzA3NTkwNDYw | 3220 | BUG: Fixes GH3215 | aidanheerdegen 6063709 | closed | 0 | 7 | 2019-08-15T05:55:36Z | 2019-08-28T06:45:42Z | 2019-08-28T06:45:35Z | CONTRIBUTOR | 0 | pydata/xarray/pulls/3220 | Explicit cast to numpy array to avoid np.ravel calling out to dask
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3220/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | pull | |||||
480512400 | MDU6SXNzdWU0ODA1MTI0MDA= | 3215 | decode_cf called on mfdataset throws error: 'Array' object has no attribute 'tolist' | aidanheerdegen 6063709 | closed | 0 | 9 | 2019-08-14T06:56:35Z | 2019-08-28T06:45:35Z | 2019-08-28T06:45:35Z | CONTRIBUTOR | MCVE Code Sample```python import xarray file = 'temp_048.nc' Works ok with open_datasetds = xarray.open_dataset(file, decode_cf=True) ds = xarray.open_dataset(file, decode_cf=False) ds = xarray.decode_cf(ds) Fails with open_mfdatasetds = xarray.open_mfdataset(file, decode_cf=True) ds = xarray.open_mfdataset(file, decode_cf=False) This line throws an exceptionds = xarray.decode_cf(ds) ``` Expected OutputNothing Problem DescriptionWhen opening data with Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3215/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
334778045 | MDU6SXNzdWUzMzQ3NzgwNDU= | 2244 | Implement shift for CFTimeIndex | aidanheerdegen 6063709 | closed | 0 | 3 | 2018-06-22T07:42:16Z | 2018-10-02T14:44:30Z | 2018-10-02T14:44:30Z | CONTRIBUTOR | Code Sample```python import numpy as np import xarray as xr import pandas as pd from cftime import num2date, DatetimeNoLeap times = num2date(np.arange(730), calendar='noleap', units='days since 0001-01-01') da = xr.DataArray(np.arange(730), coords=[times], dims=['time']) ``` Problem descriptionI am trying to shift a time index as I need to align datasets to a common start point. Directly incrementing one of the
If I want to shift a time index is the only way currently is to loop over all the individual elements of the index and add a time offset to each. Expected OutputI would expect to have CFTimeIndex shifted by the desired time delta. Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2244/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
102703065 | MDU6SXNzdWUxMDI3MDMwNjU= | 548 | Support for netcdf4/hdf5 compression | aidanheerdegen 6063709 | closed | 0 | 4 | 2015-08-24T04:22:07Z | 2015-10-08T01:08:51Z | 2015-10-08T01:08:51Z | CONTRIBUTOR | It would be great to be able to specify netCDF4 compression parameters when saving datasets. If this is unlikely to be supported, can you suggest a reasonable work-around? I am assuming it would involve directly accessing a backend? |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/548/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]);