Skip to content

DOC: Add offsets methods to the API reference #24436

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
datapythonista opened this issue Dec 26, 2018 · 5 comments · Fixed by #24446
Closed

DOC: Add offsets methods to the API reference #24436

datapythonista opened this issue Dec 26, 2018 · 5 comments · Fixed by #24446
Labels
Datetime Datetime data dtype Docs Needs Discussion Requires discussion from core team before further action

Comments

@datapythonista
Copy link
Member

The methods of classes in pandas.tseries.offsets are not in the API reference. Not sure if there is a reason for it, or it just needs to be implemented.

We have the classes added to:
https://pandas-docs.github.io/pandas-docs-travis/api.html#date-offsets

But most of the attributes and methods are not in api.rst, so their pages are not generated. See for example:
https://pandas-docs.github.io/pandas-docs-travis/generated/pandas.tseries.offsets.MonthEnd.html#pandas.tseries.offsets.MonthEnd

Can they simply be added? Or is there a reason not to, or it's more complex than it looks like?

CC: @jbrockmendel @mroeschke

@datapythonista datapythonista added Docs Datetime Datetime data dtype Needs Discussion Requires discussion from core team before further action labels Dec 26, 2018
@mroeschke
Copy link
Member

I'd be good to at least add the methods and attributes for DateOffset as the rest of the offsets inherit from that class; there may be a lot of redundancy if we add the methods and attributes from all the offsets.

@datapythonista
Copy link
Member Author

I don't think the redundancy is great, but it's probably the best in this case.

If we don't add the attributes/methods for all offset classes, we have two problems:

Not sure if there is an option with the best of both worlds. May be we can render api.rst as we do with index.rst, and generate them with a jinja loop?

@mroeschke
Copy link
Member

Got it. I would be okay with the redundancy to maintain doc stability and/or avoid any hacky solution with rendering.

Moreover, I think some offsets have special methods of their own that would be difficult to render-control for, so I think the easiest thing is to display all methods and attributes.

@jreback
Copy link
Contributor

jreback commented Dec 26, 2018

i think we have an open issue about this FYI
yes we should add these (and reference them in time series.rst)

@datapythonista
Copy link
Member Author

I search for it, but I couldn't find the issue. Let me know if you do, we can close this.

I'll take care of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Docs Needs Discussion Requires discussion from core team before further action
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants