home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 406894349

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/2301#issuecomment-406894349 https://api.github.com/repos/pydata/xarray/issues/2301 406894349 MDEyOklzc3VlQ29tbWVudDQwNjg5NDM0OQ== 6628425 2018-07-22T20:28:09Z 2018-07-22T20:28:09Z MEMBER

@jhamman @shoyer when you get a chance, I think this is ready for review.

I did a few more things since first pushing this PR: - Previously CFTimeIndex would raise an error if it contained an empty array; I'm not really sure what the use case would be, but to be consistent with the way DatetimeIndex behaves, I made modifications to allow for this (in some cases date_range returns an empty index). I also added the ability to give a CFTimeIndex a name. - The repr of CFTimeIndex previously provided no information regarding the calendar type of the index; I found this somewhat inconvenient, so I added a custom __unicode__ method to CFTimeIndex, which pandas.Index uses to build its repr. I think the result looks decent (I updated the examples above), but the implementation is a bit crude (relying on a number of private API functions of the base Index class). Maybe there is a better way or maybe we should put this off until later? - I added arguments to the constructor for CFTimeIndex that makes it more analogous to the constructor for a DatetimeIndex, allowing one to either pass dates directly, or create dates using arguments one can pass to date_range (inspired by https://github.com/pydata/xarray/issues/2140#issuecomment-389590577).

I hope the general approach seems reasonable, though if you had something else in mind for how to implement this originally, I'd be open to changing things. I tried to keep things as basic as I could (the pandas date_range function is fairly involved!).

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