Skip to content

DOC: Add redirect for moved classes #16200

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

Merged
merged 2 commits into from
May 2, 2017

Conversation

TomAugspurger
Copy link
Contributor

The new redirects in this commit are for Resampler and Styler

Refactor how we do redirects. Moved all the logic into the
config file, where you state the methods / classes to be redirected.
Removed all the logic from the template, and just look up in the
new html_context variable.

Closes #16186

Running a test locally ATM.

The new redirects in this commit are for Resampler and Styler

Refactor how we do redirects. Moved all the logic into the
config file, where you state the methods / classes to be redirected.
Removed all the logic from the template, and just look up in the
new html_context variable.

Closes pandas-dev#16186
@TomAugspurger
Copy link
Contributor Author

Redirects on my local build look OK.

cc @jorisvandenbossche

@TomAugspurger TomAugspurger added this to the 0.20.0 milestone May 2, 2017
Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

Looks good!

mod, classname = new.rsplit('.', 1)
klass = getattr(importlib.import_module(mod), classname)
methods = [x for x in dir(klass)
if not x.startswith('_') or x.startswith('__')]
Copy link
Member

Choose a reason for hiding this comment

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

The first check already covers the second?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the second is to include the __ methods. We have http://pandas.pydata.org/pandas-docs/stable/generated/pandas.tseries.resample.Resampler.__iter__.html

I could just whitelist __iter__... We document that and __array__ on Categorical.

@codecov
Copy link

codecov bot commented May 2, 2017

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #16200   +/-   ##
=======================================
  Coverage   90.86%   90.86%           
=======================================
  Files         162      162           
  Lines       50871    50871           
=======================================
  Hits        46225    46225           
  Misses       4646     4646
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 20fda22...d3ca180. Read the comment docs.

@TomAugspurger TomAugspurger merged commit ef0ad36 into pandas-dev:master May 2, 2017
@TomAugspurger TomAugspurger deleted the api-redirect branch May 3, 2017 18:24
pcluo pushed a commit to pcluo/pandas that referenced this pull request May 22, 2017
* DOC: Add redirect for moved classes

The new redirects in this commit are for Resampler and Styler

Refactor how we do redirects. Moved all the logic into the
config file, where you state the methods / classes to be redirected.
Removed all the logic from the template, and just look up in the
new html_context variable.

Closes pandas-dev#16186

* Only redirect for used dunder methods
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.

2 participants