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: don't include all methods/attributes of IntervalIndex #16221

Conversation

jorisvandenbossche
Copy link
Member

Alternative for #16050

I totally forgot I already had made such a "class without autosummary table" template before for Categorical, so I hope this should work for IntervalIndex as well.

@jorisvandenbossche jorisvandenbossche added this to the 0.20.0 milestone May 3, 2017
@jorisvandenbossche
Copy link
Member Author

@TomAugspurger I hope this fixes the warnings.

Maybe we could also use this for the other Index subclasses like DatetimeIndex, MultiIndex, ... although it would be nice to still have a list of those attributes that are special to them, and to refer to the main Index docstring page for a list of all methods. But not sure if such flexibility is possible with sphinx/jinja (and for a later PR in any case :-))

@codecov
Copy link

codecov bot commented May 4, 2017

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #16221   +/-   ##
=======================================
  Coverage   90.86%   90.86%           
=======================================
  Files         162      162           
  Lines       50887    50887           
=======================================
  Hits        46240    46240           
  Misses       4647     4647
Flag Coverage Δ
#multiple 88.65% <ø> (ø) ⬆️
#single 40.31% <ø> (ø) ⬆️

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 1002cc3...2775d9b. Read the comment docs.

@codecov
Copy link

codecov bot commented May 4, 2017

Codecov Report

Merging #16221 into master will decrease coverage by 0.62%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16221      +/-   ##
==========================================
- Coverage   90.86%   90.23%   -0.63%     
==========================================
  Files         162      164       +2     
  Lines       50887    50894       +7     
==========================================
- Hits        46240    45926     -314     
- Misses       4647     4968     +321
Flag Coverage Δ
#multiple 88.02% <ø> (-0.63%) ⬇️
#single 40.3% <ø> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/core/indexes/category.py 98.48% <ø> (ø) ⬆️
pandas/core/indexes/interval.py 92.58% <ø> (ø) ⬆️
pandas/io/formats/excel.py 73.15% <0%> (-23.49%) ⬇️
pandas/io/excel.py 61.68% <0%> (-18.94%) ⬇️
pandas/core/tools/datetimes.py 66.94% <0%> (-18.62%) ⬇️
pandas/core/config.py 69.72% <0%> (-18.37%) ⬇️
pandas/core/indexes/base.py 95.75% <0%> (-0.46%) ⬇️
pandas/compat/__init__.py 61.77% <0%> (-0.45%) ⬇️
pandas/io/parsers.py 95.32% <0%> (-0.33%) ⬇️
pandas/util/testing.py 78.87% <0%> (-0.2%) ⬇️
... and 33 more

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 1002cc3...4dc57b4. Read the comment docs.

@jorisvandenbossche
Copy link
Member Author

Another sphinx / rst mystery ...
So for some reason this works for Categorical, but not for IntervalIndex. No idea why.
And the strange thing is that I originally said in the PR that introduced this that "it was not yet working" :-) (#9721). But apparently is does, at least for Categorical.

@TomAugspurger
Copy link
Contributor

Strange... I thought I had tried it too, but I can't remember the outcome. Did you clear all the generated files before rebuilding?

@TomAugspurger
Copy link
Contributor

@jorisvandenbossche I wonder if it's cf40991#diff-4501fdb73fd4b9f09d44a3f4177d44aaR46

We special case .Categorical there.

No autosummary with methods for them.
Added to our hacks list in our numpydoc
@TomAugspurger
Copy link
Contributor

Here's what it looks like
screen shot 2017-05-04 at 3 06 10 pm

No new warnings with that.

I spent a bit longer trying to get a an autosummary with a subset of the Methods specified in a Methods section, but no luck. Will probably require some modifications to numpydoc (beyond just templates), which will have to wait till after the release.

@jorisvandenbossche
Copy link
Member Author

Aha, you have found out how I hacked it before .. :-) Thanks!

if what == "class" and name.endswith(".Categorical"):
if what == "class" and (name.endswith(".Categorical") or
name.endswith("CategoricalIndex") or
name.endswith("Interval") or
Copy link
Member Author

Choose a reason for hiding this comment

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

@TomAugspurger I think Interval class itself is OK to have with all its methods / attributes ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, right... Is that in the api.rst?

Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't look like it, but I'll remove it anyway.

@TomAugspurger
Copy link
Contributor

Doc build log looks good, merging:

@TomAugspurger TomAugspurger merged commit 8ebd65b into pandas-dev:master May 4, 2017
@jorisvandenbossche jorisvandenbossche deleted the intervalindex-without-autosummary branch May 4, 2017 21:19
@jorisvandenbossche
Copy link
Member Author

Great!

@jreback
Copy link
Contributor

jreback commented May 4, 2017

yep looks great. thanks guys!

pcluo pushed a commit to pcluo/pandas that referenced this pull request May 22, 2017
…v#16221)

* DOC: don't include all methods/attributes of IntervalIndex

* Change docs for CategoricalIndex and IntervalIndex

No autosummary with methods for them.
Added to our hacks list in our numpydoc

* Don't exclude Interval
stangirala pushed a commit to stangirala/pandas that referenced this pull request Jun 11, 2017
…v#16221)

* DOC: don't include all methods/attributes of IntervalIndex

* Change docs for CategoricalIndex and IntervalIndex

No autosummary with methods for them.
Added to our hacks list in our numpydoc

* Don't exclude Interval
yarikoptic added a commit to neurodebian/pandas that referenced this pull request Jul 12, 2017
Version 0.20.0

* tag 'v0.20.0': (742 commits)
  RLS: v0.20.0
  DOC: Whatsnew cleanup (pandas-dev#16245)
  TST: Test CategoricalIndex in test_is_categorical (pandas-dev#16243)
  TST: xfail some bottleneck on windows (pandas-dev#16240)
  DOC, TST: Document and Test Functions in dtypes/common.py (pandas-dev#16237)
  TST: Remove __init__ statements in testing (pandas-dev#16238)
  DOC: don't include all methods/attributes of IntervalIndex (pandas-dev#16221)
  PKG: Fix ModuleNotFoundError: No module named 'pandas.formats' (pandas-dev#16239)
  RLS: v0.20.0rc2
  CLN: make submodules of pandas.util private (pandas-dev#16223)
  MAINT: Remove tm.TestCase from testing (pandas-dev#16225)
  MAINT: Complete Conversion to Pytest Idiom (pandas-dev#16201)
  DOC: add whatsnew for 0.21.0
  DEPR: correct deprecation message for datetools (pandas-dev#16202)
  API Change repr name for table schema (pandas-dev#16204)
  DOC: Remove various warnings from doc build (pandas-dev#16206)
  DOC: add whatsnew for v0.20.1
  BUG: Fixed renaming of falsey names in build_table_schema (pandas-dev#16205)
  COMPAT: ensure proper extension dtype's don't pickle the cache (pandas-dev#16207)
  REF: register custom DisplayFormatter for table schema (pandas-dev#16198)
  ...
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.

3 participants