Skip to content

Exposing/documenting CFTimeIndex as public API #2140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
shoyer opened this issue May 16, 2018 · 4 comments · Fixed by #2141
Closed

Exposing/documenting CFTimeIndex as public API #2140

shoyer opened this issue May 16, 2018 · 4 comments · Fixed by #2141

Comments

@shoyer
Copy link
Member

shoyer commented May 16, 2018

I think we expose CFTimeIndex as public API, as either xarray.CFTimeIndex or xarray.coding.CFTimeIndex. Otherwise the only way to make this thing is by putting cftime datetime objects into an xarray object, and/or users will start importing it from xarray.coding.cftimeindex.

We should also add it to the API docs, for which it will need at least a minimally informative docstring, too.

CC @spencerkclark @jhamman

@shoyer
Copy link
Member Author

shoyer commented May 16, 2018

Potentially it would also make sense to add a specialized constructor that is an alias for wrapping cftime.num2date in a CFTimeIndex, but we can save that for later.

@shoyer shoyer mentioned this issue May 16, 2018
@jhamman
Copy link
Member

jhamman commented May 16, 2018

I'd like to see a utility that adds a calendar argument to pandas' date_range. When non-standard calendars are used, it would return a CFTimeIndex. Since that isn't going to happen right away, let's just expose the index class now.

@jhamman
Copy link
Member

jhamman commented May 16, 2018

I'm working on the doc update now.

@spencerkclark
Copy link
Member

Great, thanks @jhamman

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants