Skip to content
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

DOC: Adding offsets to API ref #24446

Merged
merged 3 commits into from
Dec 27, 2018
Merged

DOC: Adding offsets to API ref #24446

merged 3 commits into from
Dec 27, 2018

Conversation

datapythonista
Copy link
Member

@datapythonista datapythonista commented Dec 26, 2018

Adding Date Offsets API documentation. Added in the same format as other sections. Detected what are properties and what are methods with the callable function. The order of the classes is the one already used. The order inside properties and methods is alphabetical.

@jreback In timeseries.rst we already have a table with the different offsets: https://pandas-docs.github.io/pandas-docs-travis/timeseries.html#dateoffset-objects Not sure what would you like to add more.

This is how it looks like:
offsets

CC: @mroeschke @jbrockmendel

@mroeschke
Copy link
Member

Is it possible to give Properties and Methods a different (smaller) heading style than the offset class? It's a bit difficult to pick out the offset from those two headings.

@datapythonista
Copy link
Member Author

Totally agree, but I think the short answer is no.

I copied the format of: https://pandas-docs.github.io/pandas-docs-travis/api.html#scalars

IMO, what we should do is split the API page in several sections (see the sections in the "API Reference" block in https://pandas-dev.github.io/pandas-sphinx-theme/pr-datapythonista_base/, but possibly with all Index classes in the same section). Then we should have at least one extra level of title/subtitle..., and we'll be able to do it.

Will open an issue soon, and see if there is agreement.

@jreback
Copy link
Contributor

jreback commented Dec 26, 2018

@jreback In timeseries.rst we already have a table with the different offsets: https://pandas-docs.github.io/pandas-docs-travis/timeseries.html#dateoffset-objects Not sure what would you like to add more.

it didn’t have clickable links before

@datapythonista
Copy link
Member Author

ah, I see, thanks for clarifying. But that's somehow unrelated, the class pages already existed, it's just that they are not links.

I'll add those in a separate PR.

@codecov
Copy link

codecov bot commented Dec 26, 2018

Codecov Report

Merging #24446 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24446   +/-   ##
=======================================
  Coverage    92.3%    92.3%           
=======================================
  Files         163      163           
  Lines       51977    51977           
=======================================
  Hits        47979    47979           
  Misses       3998     3998
Flag Coverage Δ
#multiple 90.71% <ø> (ø) ⬆️
#single 42.99% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b4b38f...29a5b5b. Read the comment docs.

5 similar comments
@codecov
Copy link

codecov bot commented Dec 26, 2018

Codecov Report

Merging #24446 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24446   +/-   ##
=======================================
  Coverage    92.3%    92.3%           
=======================================
  Files         163      163           
  Lines       51977    51977           
=======================================
  Hits        47979    47979           
  Misses       3998     3998
Flag Coverage Δ
#multiple 90.71% <ø> (ø) ⬆️
#single 42.99% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b4b38f...29a5b5b. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 26, 2018

Codecov Report

Merging #24446 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24446   +/-   ##
=======================================
  Coverage    92.3%    92.3%           
=======================================
  Files         163      163           
  Lines       51977    51977           
=======================================
  Hits        47979    47979           
  Misses       3998     3998
Flag Coverage Δ
#multiple 90.71% <ø> (ø) ⬆️
#single 42.99% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b4b38f...29a5b5b. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 26, 2018

Codecov Report

Merging #24446 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24446   +/-   ##
=======================================
  Coverage    92.3%    92.3%           
=======================================
  Files         163      163           
  Lines       51977    51977           
=======================================
  Hits        47979    47979           
  Misses       3998     3998
Flag Coverage Δ
#multiple 90.71% <ø> (ø) ⬆️
#single 42.99% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b4b38f...29a5b5b. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 26, 2018

Codecov Report

Merging #24446 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24446   +/-   ##
=======================================
  Coverage    92.3%    92.3%           
=======================================
  Files         163      163           
  Lines       51977    51977           
=======================================
  Hits        47979    47979           
  Misses       3998     3998
Flag Coverage Δ
#multiple 90.71% <ø> (ø) ⬆️
#single 42.99% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b4b38f...29a5b5b. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 26, 2018

Codecov Report

Merging #24446 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24446   +/-   ##
=======================================
  Coverage    92.3%    92.3%           
=======================================
  Files         163      163           
  Lines       51977    51977           
=======================================
  Hits        47979    47979           
  Misses       3998     3998
Flag Coverage Δ
#multiple 90.71% <ø> (ø) ⬆️
#single 42.99% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b4b38f...29a5b5b. Read the comment docs.

@datapythonista
Copy link
Member Author

Created #24448 for the links.

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you auto-generate these?


DateOffset.apply
DateOffset.copy
DateOffset.isAnchored
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are removing / not-advertising isAnchored

DateOffset.freqstr
DateOffset.kwds
DateOffset.name
DateOffset.nanos
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we consider .nanos private @jbrockmendel ?

@datapythonista
Copy link
Member Author

I "autogenerated" them, would you prefer to generate the content of api.rst dynamically? If we do it for date offsets, it probably makes sense to do it for everything.

Regarding the private methods, sphinx will warn (and eventually we'll make it fail for warnings). So it'd probably be a better option to just rename them to _isAnchored (or _is_anchored) and _nanos. Is there any reason to not do that?

Related to this PR, I created #24451 to split api.rst in multiple files.

@jreback jreback added this to the 0.24.0 milestone Dec 27, 2018
@jreback
Copy link
Contributor

jreback commented Dec 27, 2018

this is fine for now (and ok on the splitting).

@jreback jreback merged commit 74db5b5 into pandas-dev:master Dec 27, 2018
thoo added a commit to thoo/pandas that referenced this pull request Dec 28, 2018
* upstream/master: (26 commits)
  DOC: Fixing doc upload (no such remote origin) (pandas-dev#24459)
  BLD: for C extension builds on mac, target macOS 10.9 where possible (pandas-dev#24274)
  POC: _eadata (pandas-dev#24394)
  DOC: Correct location (pandas-dev#24456)
  CI: Moving CircleCI build to Travis (pandas-dev#24449)
  BUG: Infer compression by default in read_fwf() (pandas-dev#22200)
  DOC: Fix minor typo in whatsnew (pandas-dev#24453)
  DOC: Add dateutil to intersphinx pandas-dev#24437 (pandas-dev#24443)
  DOC: Adding links to offset classes in timeseries.rst (pandas-dev#24448)
  DOC: Adding offsets to API ref (pandas-dev#24446)
  DOC: fix flake8 issue in groupby.rst (pandas-dev#24363)
  DOC: Fixing more doc warnings (pandas-dev#24438)
  API: Simplify repeat signature (pandas-dev#24447)
  BUG: to_datetime(Timestamp, utc=True) localizes to UTC (pandas-dev#24441)
  CLN: Cython Py2/3 Compatible Imports (pandas-dev#23940)
  DOC: Fixing more doc warnings (pandas-dev#24431)
  DOC: Removing old release.rst (pandas-dev#24427)
  BUG-24408 Series.dt does not maintain own copy of index (pandas-dev#24426)
  DOC: Fixing several doc warnings (pandas-dev#24430)
  ENH: fill_value argument for shift pandas-dev#15486 (pandas-dev#24128)
  ...
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: Add offsets methods to the API reference
3 participants