Skip to content

DOC: make deprecation warning more visible with red box #20357

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 5 commits into from
Mar 23, 2018

Conversation

Imanflow
Copy link
Contributor

@Imanflow Imanflow commented Mar 15, 2018

@jorisvandenbossche jorisvandenbossche changed the title DOC: update the pandas.DataFrame.from_csv docstring DOC: make deprecation warning more visible with red box Mar 15, 2018
@jorisvandenbossche
Copy link
Member

How it currently looks:

screenshot-2018-3-15 pandas dataframe from_csv pandas 0 23 0 dev0 604 g8ca08d1 documentation

So I think we need to add some more css to have it look better (border spacing). As comparison, the see also box:

screenshot-2018-3-15 pandas dataframe from_csv pandas 0 23 0 dev0 604 g8ca08d1 documentation 1

@jorisvandenbossche
Copy link
Member

Apparently I did something very similar for sklearn a while ago, so you can see there how I did it then: scikit-learn/scikit-learn#8914

@jreback jreback added the Docs label Mar 15, 2018
@jreback jreback added this to the 0.23.0 milestone Mar 15, 2018
@codecov
Copy link

codecov bot commented Mar 15, 2018

Codecov Report

Merging #20357 into master will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #20357      +/-   ##
==========================================
+ Coverage   91.77%    91.8%   +0.02%     
==========================================
  Files         152      152              
  Lines       49205    49216      +11     
==========================================
+ Hits        45159    45182      +23     
+ Misses       4046     4034      -12
Flag Coverage Δ
#multiple 90.19% <ø> (+0.02%) ⬆️
#single 41.84% <ø> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/core/window.py 96.26% <0%> (-0.01%) ⬇️
pandas/core/indexes/category.py 97.3% <0%> (ø) ⬆️
pandas/core/panel.py 97.29% <0%> (ø) ⬆️
pandas/core/series.py 93.84% <0%> (ø) ⬆️
pandas/core/base.py 96.78% <0%> (ø) ⬆️
pandas/core/arrays/categorical.py 96.21% <0%> (ø) ⬆️
pandas/core/generic.py 95.85% <0%> (ø) ⬆️
pandas/core/frame.py 97.18% <0%> (ø) ⬆️
pandas/core/indexes/datetimelike.py 96.72% <0%> (ø) ⬆️
pandas/plotting/_core.py 82.27% <0%> (ø) ⬆️
... and 4 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 7273ea0...13188ad. Read the comment docs.

@jreback
Copy link
Contributor

jreback commented Mar 15, 2018

lgtm. @jorisvandenbossche ?

@jorisvandenbossche
Copy link
Member

Don't merge yet. We should fix the styling.

@Imanflow you can take a look at the PR in sklearn I mentioned above how it was done there.

@Imanflow
Copy link
Contributor Author

For a reason I can't undersand, further changes in https://github.com/pandas-dev/pandas/blob/master/doc/source/themes/nature_with_gtoc/static/nature.css_tdoesn't get reflected when i do

# in pandas/doc
python make.py --single=pandas.DataFrame.from_csv

any clue?

@arminv
Copy link
Contributor

arminv commented Mar 21, 2018

I'm not sure why you can't see your changes, but based on how @jorisvandenbossche fixed this issue before and #20349, you need:

div.admonition p.admonition-title + p, div.deprecated p {
    display: inline;
}

, div.deprecated p is missing in your code.

You also need:

div.deprecated {
    background-color: #ffe4e4;
    border: 1px solid #f66;
    margin-bottom: 10px;
    margin-top: 10px;
    padding: 7px;
    border-radius: 4px;
    -moz-border-radius: 4px;
}

I think the last two properties here (border-radius: 4px; and -moz-border-radius: 4px;) are not necessary as we want the box to have sharp edges and be consistent with 'See also' box etc,.

So you are missing these:

    margin-bottom: 10px;
    margin-top: 10px;
    padding: 7px;

This is how it should look:

screen shot 2018-03-21 at 1 15 47 am

@Imanflow
Copy link
Contributor Author

Done, thanks for your patience.

PD: The problem with not seeing the changes was that on terminal I was in a different branch than in Pycharm.

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!

@jorisvandenbossche jorisvandenbossche merged commit 53ad5c6 into pandas-dev:master Mar 23, 2018
@jorisvandenbossche
Copy link
Member

@Imanflow @arminv Thanks!

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.

Add CSS formating for deprecated parameters / methods
4 participants