home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 522397677

This data as json

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
522397677 MDU6SXNzdWU1MjIzOTc2Nzc= 3521 cftime_range example doesn't work 15331990 closed 0     1 2019-11-13T18:31:26Z 2019-11-13T18:34:43Z 2019-11-13T18:34:43Z CONTRIBUTOR      

MCVE Code Sample

python import xarray as xr xr.cftime_range(start='2000', periods=6, freq='2MS', calendar='noleap')

Expected Output

The output from the example

Problem Description

```

ValueError Traceback (most recent call last) <ipython-input-3-4ff834de4bd2> in <module> 1 import xarray as xr ----> 2 xr.cftime_range(start='2000', periods=6, freq='2MS', calendar='noleap')

~/anaconda3/envs/py3/lib/python3.7/site-packages/xarray/coding/cftime_offsets.py in cftime_range(start, end, periods, freq, normalize, name, closed, calendar) 961 962 if start is not None: --> 963 start = to_cftime_datetime(start, calendar) 964 start = _maybe_normalize_date(start, normalize) 965 if end is not None:

~/anaconda3/envs/py3/lib/python3.7/site-packages/xarray/coding/cftime_offsets.py in to_cftime_datetime(date_str_or_date, calendar) 677 "a calendar type must be provided" 678 ) --> 679 date, _ = _parse_iso8601_with_reso(get_date_type(calendar), date_str_or_date) 680 return date 681 elif isinstance(date_str_or_date, cftime.datetime):

~/anaconda3/envs/py3/lib/python3.7/site-packages/xarray/coding/cftimeindex.py in _parse_iso8601_with_reso(date_type, timestr) 114 # 1.0.3.4. 115 replace["dayofwk"] = -1 --> 116 return default.replace(**replace), resolution 117 118

cftime/_cftime.pyx in cftime._cftime.datetime.replace()

ValueError: Replacing the dayofyr or dayofwk of a datetime is not supported. ```

Output of xr.show_versions()

xarray: 0.14.0 pandas: 0.25.2 numpy: 1.17.2 scipy: 1.3.1 netCDF4: 1.5.3 pydap: None h5netcdf: 0.7.4 h5py: 2.9.0 Nio: None zarr: None cftime: 1.0.4.2 nc_time_axis: None PseudoNetCDF: None rasterio: 1.1.0 cfgrib: None iris: None bottleneck: 1.2.1 dask: 2.6.0 distributed: 2.6.0 matplotlib: 3.1.1 cartopy: 0.17.0 seaborn: None numbagg: None setuptools: 41.4.0 pip: 19.3.1 conda: None pytest: 5.2.1 IPython: 7.9.0 sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3521/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 1.087ms · About: xarray-datasette