home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 825305166

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/5155#issuecomment-825305166 https://api.github.com/repos/pydata/xarray/issues/5155 825305166 MDEyOklzc3VlQ29tbWVudDgyNTMwNTE2Ng== 6628425 2021-04-23T00:45:56Z 2021-04-23T00:45:56Z MEMBER

Great, thanks!

Thus, I suggest we return "standard" as the calendar of numpy-backed datetime indexes.

I might actually lean toward your original thought, i.e. having dt.calendar return "proleptic_gregorian" for NumPy dates. As you noted, this is technically the calendar that numpy.datetime64 values use with coarser precision. It is also what xarray currently chooses for the calendar encoding attribute for NumPy dates by default (i.e. if no "calendar" attribute exists in the variable's encoding).

(There is of course the complication that the NumPy dates could have been decoded from a file with a calendar attribute of "standard" or "gregorian", in which case, if we are being as true to the underlying data as possible, returning "proleptic_gregorian" as the calendar type would then technically be incorrect. I'm not sure if there is really anything we could do about that though, since the encoding attributes can be lost through things like timedelta arithmetic. Arguably too, if someone wanted to quibble about that, I suppose their first issue should be with decoding those values to NumPy dates to begin with.)

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