home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 380593243

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/pull/1252#issuecomment-380593243 https://api.github.com/repos/pydata/xarray/issues/1252 380593243 MDEyOklzc3VlQ29tbWVudDM4MDU5MzI0Mw== 1217238 2018-04-11T20:57:37Z 2018-04-11T20:57:37Z MEMBER

I think the code is in pretty good shape here.

My main concern is about the stability of the netcdftime package, which it looks like might need to be renamed? https://github.com/Unidata/netcdftime/issues/36

As for resampling, this would indeed require custom logic for netcdf datetimes. But I think it would be relatively doable. The key thing would dividing an array of datetimes into frequency groups. Then we could reuse xarray's existing logic for resampling, e.g., https://github.com/pydata/xarray/blob/9b76f219ec314dcb0c9a310c097a34f5c751fdd6/xarray/core/groupby.py#L234-L235

For example, if using freq='1AS' (annual frequency, start), we would need a function that maps netcdftime.datetime objects onto a netcdftime.datetime object corresponding to the start of a year, e.g., datetime(2000, 1, 1) -> datetime(2000, 1, 1) datetime(2000, 1, 2) -> datetime(2000, 1, 1) datetime(2000, 1, 3) -> datetime(2000, 1, 1) ... datetime(2000, 12, 31) -> datetime(2000, 1, 1) datetime(2001, 1, 1) -> datetime(2001, 1, 1) ... datetime(2001, 12, 31) -> datetime(2001, 1, 1)

Pandas does this logic with offset classes. These are somewhat complex because pandas handles complex business day logic. For netcdftime, we could potentially start from scratch and only handle the important cases for climate science (e.g., round to start for year, quarter, month, day, hour, second).

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