Skip to content

Commit 0064a2f

Browse files
committed
Merge branch 'master' into v0.13
2 parents 4ac18c1 + 3675c29 commit 0064a2f

File tree

175 files changed

+5180
-9842
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+5180
-9842
lines changed

.github/CONTRIBUTING.md

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
Contributing to pandas
2-
======================
1+
# Contributing to pandas
32

43
Whether you are a novice or experienced software developer, all contributions and suggestions are welcome!
54

6-
Our main contribution docs can be found [here](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst), but if you do not want to read it in its entirety, we will summarize the main ways in which you can contribute and point to relevant places in the docs for further information.
5+
Our main contributing guide can be found [in this repo](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst) or [on the website](https://pandas-docs.github.io/pandas-docs-travis/contributing.html). If you do not want to read it in its entirety, we will summarize the main ways in which you can contribute and point to relevant sections of that document for further information.
6+
7+
## Getting Started
78

8-
Getting Started
9-
---------------
109
If you are looking to contribute to the *pandas* codebase, the best place to start is the [GitHub "issues" tab](https://github.com/pandas-dev/pandas/issues). This is also a great place for filing bug reports and making suggestions for ways in which we can improve the code and documentation.
1110

12-
If you have additional questions, feel free to ask them on the [mailing list](https://groups.google.com/forum/?fromgroups#!forum/pydata) or on [Gitter](https://gitter.im/pydata/pandas). Further information can also be found in our [Getting Started](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#where-to-start) section of our main contribution doc.
11+
If you have additional questions, feel free to ask them on the [mailing list](https://groups.google.com/forum/?fromgroups#!forum/pydata) or on [Gitter](https://gitter.im/pydata/pandas). Further information can also be found in the "[Where to start?](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#where-to-start)" section.
12+
13+
## Filing Issues
14+
15+
If you notice a bug in the code or documentation, or have suggestions for how we can improve either, feel free to create an issue on the [GitHub "issues" tab](https://github.com/pandas-dev/pandas/issues) using [GitHub's "issue" form](https://github.com/pandas-dev/pandas/issues/new). The form contains some questions that will help us best address your issue. For more information regarding how to file issues against *pandas*, please refer to the "[Bug reports and enhancement requests](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#bug-reports-and-enhancement-requests)" section.
1316

14-
Filing Issues
15-
-------------
16-
If you notice a bug in the code or in docs or have suggestions for how we can improve either, feel free to create an issue on the [GitHub "issues" tab](https://github.com/pandas-dev/pandas/issues) using [GitHub's "issue" form](https://github.com/pandas-dev/pandas/issues/new). The form contains some questions that will help us best address your issue. For more information regarding how to file issues against *pandas*, please refer to the [Bug reports and enhancement requests](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#bug-reports-and-enhancement-requests) section of our main contribution doc.
17+
## Contributing to the Codebase
1718

18-
Contributing to the Codebase
19-
----------------------------
20-
The code is hosted on [GitHub](https://www.github.com/pandas-dev/pandas), so you will need to use [Git](http://git-scm.com/) to clone the project and make changes to the codebase. Once you have obtained a copy of the code, you should create a development environment that is separate from your existing Python environment so that you can make and test changes without compromising your own work environment. For more information, please refer to our [Working with the code](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#working-with-the-code) section of our main contribution docs.
19+
The code is hosted on [GitHub](https://www.github.com/pandas-dev/pandas), so you will need to use [Git](http://git-scm.com/) to clone the project and make changes to the codebase. Once you have obtained a copy of the code, you should create a development environment that is separate from your existing Python environment so that you can make and test changes without compromising your own work environment. For more information, please refer to the "[Working with the code](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#working-with-the-code)" section.
2120

22-
Before submitting your changes for review, make sure to check that your changes do not break any tests. You can find more information about our test suites can be found [here](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#test-driven-development-code-writing). We also have guidelines regarding coding style that will be enforced during testing. Details about coding style can be found [here](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#code-standards).
21+
Before submitting your changes for review, make sure to check that your changes do not break any tests. You can find more information about our test suites in the "[Test-driven development/code writing](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#test-driven-development-code-writing)" section. We also have guidelines regarding coding style that will be enforced during testing, which can be found in the "[Code standards](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#code-standards)" section.
2322

24-
Once your changes are ready to be submitted, make sure to push your changes to GitHub before creating a pull request. Details about how to do that can be found in the [Contributing your changes to pandas](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#contributing-your-changes-to-pandas) section of our main contribution docs. We will review your changes, and you will most likely be asked to make additional changes before it is finally ready to merge. However, once it's ready, we will merge it, and you will have successfully contributed to the codebase!
23+
Once your changes are ready to be submitted, make sure to push your changes to GitHub before creating a pull request. Details about how to do that can be found in the "[Contributing your changes to pandas](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#contributing-your-changes-to-pandas)" section. We will review your changes, and you will most likely be asked to make additional changes before it is finally ready to merge. However, once it's ready, we will merge it, and you will have successfully contributed to the codebase!

.travis.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ before_install:
9090
- uname -a
9191
- git --version
9292
- git tag
93+
# Because travis runs on Google Cloud and has a /etc/boto.cfg,
94+
# it breaks moto import, see:
95+
# https://github.com/spulec/moto/issues/1771
96+
# https://github.com/boto/boto/issues/3741
97+
# This overrides travis and tells it to look nowhere.
98+
- export BOTO_CONFIG=/dev/null
9399

94100
install:
95101
- echo "install start"
@@ -106,7 +112,7 @@ before_script:
106112
script:
107113
- echo "script start"
108114
- source activate pandas-dev
109-
- ci/run_build_docs.sh
115+
- ci/build_docs.sh
110116
- ci/run_tests.sh
111117

112118
after_script:

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ Most development discussion is taking place on github in this repo. Further, the
231231

232232
All contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas are welcome.
233233

234-
A detailed overview on how to contribute can be found in the **[contributing guide.](https://pandas.pydata.org/pandas-docs/stable/contributing.html)**
234+
A detailed overview on how to contribute can be found in the **[contributing guide](https://pandas-docs.github.io/pandas-docs-travis/contributing.html)**. There is also an [overview](.github/CONTRIBUTING.md) on GitHub.
235235

236-
If you are simply looking to start working with the pandas codebase, navigate to the [GitHub issues tab](https://github.com/pandas-dev/pandas/issues) and start looking through interesting issues. There are a number of issues listed under [Docs](https://github.com/pandas-dev/pandas/issues?labels=Docs&sort=updated&state=open) and [good first issue](https://github.com/pandas-dev/pandas/issues?labels=good+first+issue&sort=updated&state=open) where you could start out.
236+
If you are simply looking to start working with the pandas codebase, navigate to the [GitHub "issues" tab](https://github.com/pandas-dev/pandas/issues) and start looking through interesting issues. There are a number of issues listed under [Docs](https://github.com/pandas-dev/pandas/issues?labels=Docs&sort=updated&state=open) and [good first issue](https://github.com/pandas-dev/pandas/issues?labels=good+first+issue&sort=updated&state=open) where you could start out.
237237

238238
You can also triage issues which may include reproducing bug reports, or asking for vital information such as version numbers or reproduction instructions. If you would like to start triaging issues, one easy way to get started is to [subscribe to pandas on CodeTriage](https://www.codetriage.com/pandas-dev/pandas).
239239

asv_bench/benchmarks/frame_ctor.py

+13
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,17 @@ def time_frame_from_ndarray(self):
9191
self.df = DataFrame(self.data)
9292

9393

94+
class FromLists(object):
95+
96+
goal_time = 0.2
97+
98+
def setup(self):
99+
N = 1000
100+
M = 100
101+
self.data = [[j for j in range(M)] for i in range(N)]
102+
103+
def time_frame_from_lists(self):
104+
self.df = DataFrame(self.data)
105+
106+
94107
from .pandas_vb_common import setup # noqa: F401

ci/build_docs.sh

+29-22
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
set -e
4+
35
if [ "${TRAVIS_OS_NAME}" != "linux" ]; then
46
echo "not doing build_docs on non-linux"
57
exit 0
@@ -23,28 +25,33 @@ if [ "$DOC" ]; then
2325
echo # Create and send docs #
2426
echo ########################
2527

26-
cd build/html
27-
git config --global user.email "[email protected]"
28-
git config --global user.name "pandas-docs-bot"
29-
30-
# create the repo
31-
git init
32-
33-
touch README
34-
git add README
35-
git commit -m "Initial commit" --allow-empty
36-
git branch gh-pages
37-
git checkout gh-pages
38-
touch .nojekyll
39-
git add --all .
40-
git commit -m "Version" --allow-empty
41-
42-
git remote remove origin
43-
git remote add origin "https://${PANDAS_GH_TOKEN}@github.com/pandas-dev/pandas-docs-travis.git"
44-
git fetch origin
45-
git remote -v
46-
47-
git push origin gh-pages -f
28+
echo "Only uploading docs when TRAVIS_PULL_REQUEST is 'false'"
29+
echo "TRAVIS_PULL_REQUEST: ${TRAVIS_PULL_REQUEST}"
30+
31+
if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
32+
cd build/html
33+
git config --global user.email "[email protected]"
34+
git config --global user.name "pandas-docs-bot"
35+
36+
# create the repo
37+
git init
38+
39+
touch README
40+
git add README
41+
git commit -m "Initial commit" --allow-empty
42+
git branch gh-pages
43+
git checkout gh-pages
44+
touch .nojekyll
45+
git add --all .
46+
git commit -m "Version" --allow-empty
47+
48+
git remote remove origin
49+
git remote add origin "https://${PANDAS_GH_TOKEN}@github.com/pandas-dev/pandas-docs-travis.git"
50+
git fetch origin
51+
git remote -v
52+
53+
git push origin gh-pages -f
54+
fi
4855
fi
4956

5057
exit 0

ci/code_checks.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
148148
invgrep -R --exclude=*.pyc --exclude=testing.py --exclude=test_testing.py assert_raises_regex pandas
149149
RET=$(($RET + $?)) ; echo $MSG "DONE"
150150

151+
MSG='Check that no file in the repo contains tailing whitespaces' ; echo $MSG
152+
invgrep --exclude="*.svg" -RI "\s$" *
153+
RET=$(($RET + $?)) ; echo $MSG "DONE"
151154
fi
152155

153156
### CODE ###
@@ -209,8 +212,8 @@ fi
209212
### DOCSTRINGS ###
210213
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
211214

212-
MSG='Validate docstrings (GL06, SS04, PR03, PR05, EX04)' ; echo $MSG
213-
$BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,SS04,PR03,PR05,EX04
215+
MSG='Validate docstrings (GL09, GL06, SS04, PR03, PR05, EX04)' ; echo $MSG
216+
$BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL09,GL06,SS04,PR03,PR05,EX04
214217
RET=$(($RET + $?)) ; echo $MSG "DONE"
215218

216219
fi

ci/deps/travis-36-doc.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ dependencies:
2121
- notebook
2222
- numexpr
2323
- numpy=1.13*
24+
- numpydoc
2425
- openpyxl
2526
- pandoc
2627
- pyarrow

ci/deps/travis-36.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ channels:
44
- conda-forge
55
dependencies:
66
- beautifulsoup4
7+
- botocore>=1.11
78
- cython>=0.28.2
89
- dask
910
- fastparquet
@@ -35,10 +36,10 @@ dependencies:
3536
- pytest
3637
- pytest-xdist
3738
- pytest-cov
38-
- moto
3939
- hypothesis>=3.58.0
4040
- pip:
4141
- brotlipy
4242
- coverage
43+
- moto
4344
- pandas-datareader
4445
- python-dateutil

ci/deps/travis-37.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ channels:
55
- c3i_test
66
dependencies:
77
- python=3.7
8+
- botocore>=1.11
89
- cython>=0.28.2
910
- numpy
1011
- python-dateutil
@@ -14,3 +15,6 @@ dependencies:
1415
- pytest
1516
- pytest-xdist
1617
- hypothesis>=3.58.0
18+
- s3fs
19+
- pip:
20+
- moto

ci/run_build_docs.sh

-10
This file was deleted.

doc/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
See `contributing.rst <https://pandas.pydata.org/pandas-docs/stable/contributing.html>`_ in this repo.
1+
See `contributing.rst <https://pandas-docs.github.io/pandas-docs-travis/contributing.html>`_ in this repo.

doc/make.py

+7-16
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,10 @@ def _run_os(*args):
214214
# TODO check_call should be more safe, but it fails with
215215
# exclude patterns, needs investigation
216216
# subprocess.check_call(args, stderr=subprocess.STDOUT)
217-
os.system(' '.join(args))
217+
exit_status = os.system(' '.join(args))
218+
if exit_status:
219+
msg = 'Command "{}" finished with exit code {}'
220+
raise RuntimeError(msg.format(' '.join(args), exit_status))
218221

219222
def _sphinx_build(self, kind):
220223
"""Call sphinx to build documentation.
@@ -229,9 +232,9 @@ def _sphinx_build(self, kind):
229232
--------
230233
>>> DocBuilder(num_jobs=4)._sphinx_build('html')
231234
"""
232-
if kind not in ('html', 'latex', 'spelling'):
233-
raise ValueError('kind must be html, latex or '
234-
'spelling, not {}'.format(kind))
235+
if kind not in ('html', 'latex'):
236+
raise ValueError('kind must be html or latex, '
237+
'not {}'.format(kind))
235238

236239
self._run_os('sphinx-build',
237240
'-j{}'.format(self.num_jobs),
@@ -310,18 +313,6 @@ def zip_html(self):
310313
'-q',
311314
*fnames)
312315

313-
def spellcheck(self):
314-
"""Spell check the documentation."""
315-
self._sphinx_build('spelling')
316-
output_location = os.path.join('build', 'spelling', 'output.txt')
317-
with open(output_location) as output:
318-
lines = output.readlines()
319-
if lines:
320-
raise SyntaxError(
321-
'Found misspelled words.'
322-
' Check pandas/doc/build/spelling/output.txt'
323-
' for more details.')
324-
325316

326317
def main():
327318
cmds = [method for method in dir(DocBuilder) if not method.startswith('_')]

0 commit comments

Comments
 (0)