Skip to content

DOC: Fix PEP-8 issues in indexing-, missing_data-, options- and release.rst #24089

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 8 commits into from
Dec 12, 2018

Conversation

FHaase
Copy link
Contributor

@FHaase FHaase commented Dec 4, 2018

No description provided.

@FHaase FHaase changed the title Fix PEP-8 issues in indexing-, missing_data-, options- and release.rst DOC: Fix PEP-8 issues in indexing-, missing_data-, options- and release.rst Dec 4, 2018
@jreback jreback added the Docs label Dec 4, 2018
@codecov
Copy link

codecov bot commented Dec 5, 2018

Codecov Report

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

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #24089       +/-   ##
===========================================
- Coverage   92.21%   42.52%   -49.69%     
===========================================
  Files         161      161               
  Lines       51684    51697       +13     
===========================================
- Hits        47658    21982    -25676     
- Misses       4026    29715    +25689
Flag Coverage Δ
#multiple ?
#single 42.52% <ø> (-0.49%) ⬇️
Impacted Files Coverage Δ
pandas/io/formats/latex.py 0% <0%> (-100%) ⬇️
pandas/core/categorical.py 0% <0%> (-100%) ⬇️
pandas/io/sas/sas_constants.py 0% <0%> (-100%) ⬇️
pandas/tseries/plotting.py 0% <0%> (-100%) ⬇️
pandas/tseries/converter.py 0% <0%> (-100%) ⬇️
pandas/io/formats/html.py 0% <0%> (-98.62%) ⬇️
pandas/core/groupby/categorical.py 0% <0%> (-95.46%) ⬇️
pandas/io/sas/sas7bdat.py 0% <0%> (-91.17%) ⬇️
pandas/io/sas/sas_xport.py 0% <0%> (-90.15%) ⬇️
pandas/core/sparse/scipy_sparse.py 10.29% <0%> (-89.71%) ⬇️
... and 118 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 4b5f4d1...d3f1a80. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 5, 2018

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24089   +/-   ##
=======================================
  Coverage   92.21%   92.21%           
=======================================
  Files         162      162           
  Lines       51763    51763           
=======================================
  Hits        47733    47733           
  Misses       4030     4030
Flag Coverage Δ
#multiple 90.61% <ø> (ø) ⬆️
#single 43% <ø> (ø) ⬆️

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 f6c7f6b...acf3bc1. Read the comment docs.

@datapythonista datapythonista self-assigned this Dec 7, 2018
Copy link
Member

@datapythonista datapythonista 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, added few comments.

The fixes to the header will conflict with #24086, which is likely to be merged first.

old_index = index
del index
old_index = index # noqa: F821
del index # noqa: F821
Copy link
Member

Choose a reason for hiding this comment

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

if this has :suppress: and it's not visible, and it's broken to need the F821, I guess we can simply get rid of it. Makes sense?

@@ -1307,7 +1312,7 @@ The ``in`` and ``not in`` operators

try:
old_d = d
del d
del d # noqa: F821
Copy link
Member

Choose a reason for hiding this comment

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

same as before, and I'm not sure it makes sense that d is not defined here to need the noqa, but it is in the previous line.

@@ -1509,7 +1516,7 @@ default value.

.. ipython:: python

s = pd.Series([1,2,3], index=['a','b','c'])
s = pd.Series([1, 2, 3], index=['a', 'b', 'c'])
s.get('a') # equivalent to s['a']
Copy link
Member

Choose a reason for hiding this comment

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

do you mind leaving just two spaces before the comment, as in most places

@@ -1829,7 +1838,7 @@ that you've done this:
def do_something(df):
foo = df[['bar', 'baz']] # Is foo a view? A copy? Nobody knows!
# ... many lines here ...
foo['quux'] = value # We don't know whether this will modify df or not!
foo['quux'] = value # We don't know whether this will modify df or not! # noqa: E501, F821
Copy link
Member

Choose a reason for hiding this comment

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

I'd move the comment to the previous line, and avoid E501

@datapythonista
Copy link
Member

@FHaase can you address the review comments and fix the conflicts please?

# Conflicts:
#	doc/source/indexing.rst
#	doc/source/missing_data.rst
#	doc/source/options.rst
#	doc/source/release.rst
#	setup.cfg
Signed-off-by: Fabian Haase <[email protected]>
Copy link
Member

@datapythonista datapythonista 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, couple of comments


.. ipython:: python
:suppress:
:okwarning:

pd.reset_option('^display\.')
pd.reset_option(r'^display.')
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we want to delete the backslash, I guess this this string is used in a regular expression

@@ -1785,17 +1771,17 @@ interpreter executes this code:

.. code-block:: python

dfmi.loc[:, ('one', 'second')] = value
dfmi.loc[:, ('one', 'second')] = value # noqa: F821
Copy link
Member

Choose a reason for hiding this comment

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

what do you think of adding value = 'z' before this, so we don't need to have all the F821? Can be in a :suppress: block, or directly here, whatever you think it's better.

:suppress:

old_index = index
del index
Copy link
Member

Choose a reason for hiding this comment

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

do you mind rendering the page and making sure the result is not changed by removing these? can't really understand why these blocks are needed, but may be I'm missing something

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the :suppress: which resulted in

In [211]: old_index = index
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-211-27ea1dd9dc9d> in <module>
----> 1 old_index = index

NameError: name 'index' is not defined

In [212]: del index
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-212-b747d883ab88> in <module>
----> 1 del index

NameError: name 'index' is not defined

Same for the other (If the try block is removed as well). I doubt it makes any difference.

I noticed a df.index in the block above so I tried to replace it with that, but del is not defined.

Signed-off-by: Fabian Haase <[email protected]>
Signed-off-by: Fabian Haase <[email protected]>
…ssues

# Conflicts:
#	doc/source/indexing.rst
Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @FHaase

@jreback
Copy link
Contributor

jreback commented Dec 11, 2018

can you merge master

@jreback jreback added this to the 0.24.0 milestone Dec 11, 2018
@jreback jreback merged commit 9bc42f9 into pandas-dev:master Dec 12, 2018
@jreback
Copy link
Contributor

jreback commented Dec 12, 2018

thanks @FHaase pls check the rendered docs to make sure all is ok in indexing.rst when they r built.

thoo added a commit to thoo/pandas that referenced this pull request Dec 12, 2018
* upstream/master:
  DOC: Fix PEP-8 issues in indexing-, missing_data-, options- and release.rst (pandas-dev#24089)
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.

3 participants