home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 709672708

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/4514#issuecomment-709672708 https://api.github.com/repos/pydata/xarray/issues/4514 709672708 MDEyOklzc3VlQ29tbWVudDcwOTY3MjcwOA== 6628425 2020-10-16T01:18:38Z 2020-10-16T01:18:56Z MEMBER

Thanks @mathause -- interestingly I happened to try this example out with a branch that's soon to be merged in cftime and it appears to work:

``` In [1]: import xarray as xr

In [2]: import cftime

In [3]: import numpy as np

In [4]: time = xr.cftime_range("2000-02-30", "2001-01-01", freq="3M", calendar="360_day")

In [5]: dates = np.asarray(time)

In [6]: reference_date = xr.coding.times.infer_datetime_units(dates)

In [7]: xr.coding.times.encode_cf_datetime(time) Out[7]: (array([ 0, 90, 180, 270]), 'days since 2000-02-30 00:00:00.000000', '360_day') ```

As a general point I think we should strive to be able to handle reference dates that might not be valid in all calendars (they might occur in the wild). Would we be ok labeling this as an upstream issue?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  722437965
Powered by Datasette · Queries took 0.952ms · About: xarray-datasette