-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fixed PEP8 errors in doc/source/whatsnew/v0.15.* #24328
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #24328 +/- ##
=======================================
Coverage 92.28% 92.28%
=======================================
Files 162 162
Lines 51831 51831
=======================================
Hits 47830 47830
Misses 4001 4001
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #24328 +/- ##
==========================================
- Coverage 92.38% 92.37% -0.01%
==========================================
Files 166 166
Lines 52490 52471 -19
==========================================
- Hits 48493 48471 -22
- Misses 3997 4000 +3
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for the PR. Some comments in the code. Besides those:
- Remove the
test.parquet
file you committed - Edit
setup.cfg
and remove the files you fixed from the list of exclude files of flake8-rst, so they start being validated - Edit the PR description and replace the
#xxxxx
by the issue you're closing
doc/source/whatsnew/v0.15.0.rst
Outdated
@@ -7,10 +7,11 @@ v0.15.0 (October 18, 2014) | |||
|
|||
.. ipython:: python | |||
:suppress: | |||
|
|||
from pandas import * # noqa F401, F403 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we want to delete this whole block, that's one of the main points of the issue (see the description)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be sure, you want me to remove the whole ipython block, am i right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, you can see a similar case here: https://github.com/pandas-dev/pandas/pull/24236/files
doc/source/whatsnew/v0.15.0.rst
Outdated
from pandas import * # noqa F401, F403 | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this blank line is unnecessary, and it should break the validation
Okay,will fix all the problems. |
pls merge master as well |
@joybhallaa can you update in the description the issue you're closing |
And when you fixed the conflict, looks like the Don't worry much, all these things usually happen to every first contributor. But we need everything in place to be able to merge this. :) |
doc/source/whatsnew/v0.15.0.rst
Outdated
@@ -77,7 +71,7 @@ For full docs, see the :ref:`categorical introduction <categorical>` and the | |||
.. ipython:: python | |||
:okwarning: | |||
|
|||
df = DataFrame({"id":[1,2,3,4,5,6], "raw_grade":['a', 'b', 'b', 'a', 'a', 'e']}) | |||
df = DataFrame({"id": [1, 2, 3, 4, 5, 6], "raw_grade": ['a', 'b', 'b', 'a', 'a', 'e']}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the line too long you mention in the description? You can fix it by simply:
df = DataFrame({"id": [1, 2, 3, 4, 5, 6],
"raw_grade": ['a', 'b', 'b', 'a', 'a', 'e']})
Or something similar, if you need to do it somewhere else too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this,but it led to more pep8 errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the block is a code-block, you may need to add ...
to the beginning of the continuation file. If you can't get it fixed yourself, leave it the way you think it's correct in the PR, so we can review it, and also see the errors in the CI.
@datapythonista , no need to comment, i know there are some errors left, but my machine is giving me some problems and I'll try to push the changes ASAP and will keep pushing them till all tests are passed. |
@datapythonista , can't get rid of the remaining errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the comments, can you restore the style.ipynb
you deleted please
doc/source/whatsnew/v0.15.0.rst
Outdated
@@ -836,7 +833,7 @@ Other notable API changes: | |||
|
|||
.. code-block:: python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This indentation is wrong, should be at the top level. And this should be a .. code-block:: ipython
(ipython instead of python.
See similar examples for the exact format.
@@ -28,7 +22,7 @@ API changes | |||
|
|||
.. ipython:: python | |||
|
|||
s = Series(date_range('20130101',periods=5,freq='D')) | |||
s = pd.Series(pd.date_range('20130101', periods=5, freq='D')) | |||
s.iloc[2] = np.nan | |||
s | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you try to redefine df
and ts
before line 64 (can't comment there, as it's not edited in the PR)
I think they should be accessible from the previous block. You can also use # noqa F821
in the failing line, to stop the error from being raised.
You've got whitespaces in Also, if you can merge master. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple of comments, besides the problem with the whitespaces already mentioned
@joybhallaa do you have time to finish this?
doc/source/whatsnew/v0.15.0.rst
Outdated
|
||
Previously, assigning to ``None`` in numeric containers changed the | ||
dtype to object (or errored, depending on the call). It now uses | ||
``NaN``: | ||
|
||
.. ipython:: python | ||
.. ipython:: python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there should be only space between the ..
and ipython
. Here, and in all the cases that follow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, i will work on it ASAP.
doc/source/whatsnew/v0.15.0.rst
Outdated
@@ -86,7 +81,8 @@ For full docs, see the :ref:`categorical introduction <categorical>` and the | |||
df["grade"].cat.categories = ["very good", "good", "very bad"] | |||
|
|||
# Reorder the categories and simultaneously add the missing categories | |||
df["grade"] = df["grade"].cat.set_categories(["very bad", "bad", "medium", "good", "very good"]) | |||
df["grade"] = df["grade"].cat.set_categories( | |||
["very bad", "bad", "medium", "good", "very good"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better something like:
df["grade"] = df["grade"].cat.set_categories(["very bad",
"bad",
...
can you merge master and update |
you have an error:https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=6317 |
@datapythonista in v0.15.0,all pd,df are giving invalid syntax error,how can this be removed ? |
Note there are still a bunch of failures in the doc build related to the clean-up (see eg https://travis-ci.org/pandas-dev/pandas/jobs/474277960) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forget about the syntax errors, and any previous comment. Just fix the comments in this review, we'll merged the changes, and anything remaining will be addressed in a separate PR.
ts | ||
ts.tz_localize(None) | ||
|
||
didx = DatetimeIndex(start='2014-08-01 09:00', freq='H', periods=10, tz='US/Eastern') | ||
didx = pd.DatetimeIndex( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better:
didx = pd.DatetimeIndex(start='2014-08-01 09:00',
...
doc/source/whatsnew/v0.15.0.rst
Outdated
df["grade"] = df["grade"].cat.set_categories(["very bad", "bad", "medium", "good", "very good"]) | ||
df["grade"] = df["grade"].cat.set_categories(["very bad", | ||
"bad", "medium", | ||
"good", "very good"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this indentation needs to be at the same level as the previos. The )
in the next line should be at the end of this.
doc/source/whatsnew/v0.15.0.rst
Outdated
data = dict([ (t, np.random.randint(100, size=n).astype(t)) | ||
for t in dtypes]) | ||
df = DataFrame(data) | ||
data = [(t, np.random.randint(100, size=n).astype(t)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data must be a dict, restore the previous
doc/source/whatsnew/v0.15.0.rst
Outdated
Out[7]: | ||
0 NaN | ||
1 1.0 | ||
2 5.2 | ||
dtype: float64 | ||
|
||
In [8]: pd.ewma(Series([1., None, 8.]), com=2., ignore_na=True) # pre-0.15.0 behavior | ||
In [8]: pd.ewma(pd.Series | ||
([1., None, 8.]), com=2., ignore_na=True) # pre-0.15.0 behavior |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restore the previous
doc/source/whatsnew/v0.15.0.rst
Outdated
Out[8]: | ||
0 1.0 | ||
1 1.0 | ||
2 5.2 | ||
dtype: float64 | ||
|
||
In [9]: pd.ewma(Series([1., None, 8.]), com=2., ignore_na=False) # new default | ||
In[9]: pd.ewma( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restore the previous
doc/source/whatsnew/v0.15.1.rst
Outdated
.. ipython:: python | ||
:supress: | ||
df = pd.DataFrame() | ||
ts = pd.Timestamp() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this for now.
|
||
.. code-block:: ipython |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restore the original
doc/source/whatsnew/v0.15.1.rst
Outdated
@@ -233,7 +231,8 @@ Enhancements | |||
|
|||
.. ipython:: python | |||
|
|||
dfi = DataFrame(1,index=pd.MultiIndex.from_product([['a'],range(1000)]),columns=['A']) | |||
dfi = pd.DataFrame( | |||
1, index=pd.MultiIndex.from_product([['a'], range(1000)]), columns=['A']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restore the original, fix the missing spaces only
doc/source/whatsnew/v0.15.2.rst
Outdated
@@ -154,7 +148,7 @@ Other enhancements: | |||
.. code-block:: python | |||
|
|||
from sqlalchemy.types import String | |||
data.to_sql('data_dtype', engine, dtype={'Col_1': String}) | |||
data.to_sql('data_dtype', pd.engine, dtype={'Col_1': String}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restore the original
doc/source/whatsnew/v0.16.1.rst | ||
doc/source/whatsnew/v0.16.2.rst | ||
doc/source/whatsnew/v0.17.0.rst | ||
doc/source/whatsnew/v0.17.1.rst |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restore the original, don't leave any changes to this file
|
||
This will return a Series, indexed like the existing Series. See the :ref:`docs <basics.dt_accessors>` | ||
.. ipython:: python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you revert this change? (there needs to be a blank line between the last sentence and .. ipython::
)
Out[8]: | ||
0 1.0 | ||
1 1.0 | ||
2 5.2 | ||
dtype: float64 | ||
|
||
In [9]: pd.ewma(Series([1., None, 8.]), com=2., ignore_na=False) # new default | ||
In[9]: pd.ewma(pd.Series([1., None, 8.]), com=2., ignore_na=False) # new default | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you revert this change?
except KeyError as e: | ||
print("KeyError: " + str(e)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add back this print statement?
@@ -792,13 +791,13 @@ Other notable API changes: | |||
|
|||
This is now the correct behavior | |||
|
|||
.. ipython:: python | |||
.. ipython:: python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert the addition of the space here (sphinx is very sensitive to this kind of things ..)
@@ -814,13 +813,13 @@ Other notable API changes: | |||
In prior versions this would drop the timezone, now it retains the timezone, | |||
but gives a column of ``object`` dtype: | |||
|
|||
.. ipython:: python | |||
.. ipython:: python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, and in a couple of ones below
@@ -835,9 +834,9 @@ Other notable API changes: | |||
|
|||
- ``SettingWithCopy`` raise/warnings (according to the option ``mode.chained_assignment``) will now be issued when setting a value on a sliced mixed-dtype DataFrame using chained-assignment. (:issue:`7845`, :issue:`7950`) | |||
|
|||
.. code-block:: python | |||
.. code-block:: ipython |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove space
on an ``errors`` argument, as well as a list of hard-coded country codes and | ||
- World Bank data requests now will warn/raise based |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undo this switching of the lines
Closing this, it's been like 4 or 5 times that we request the same changes in the reviews. This is taking to much of our time to review. |
git diff upstream/master -u -- "*.py" | flake8 --diff
Fixed PEP8 errors in doc/source/whatsnew/v0.15.*, still can't get rid of line too long ( x >79) where x is the number of characters in line.