Skip to content

Commit 97db816

Browse files
committed
Merge remote-tracking branch 'upstream/master' into io_csv_docstring_fixed
* upstream/master: DOC: Delete trailing blank lines in docstrings. (pandas-dev#23651) DOC: Change release and whatsnew (pandas-dev#21599) DOC: Fix format of the See Also descriptions (pandas-dev#23654) DOC: update pandas.core.groupby.DataFrameGroupBy.resample docstring. (pandas-dev#20374) ENH: Allow export of mixed columns to Stata strl (pandas-dev#23692) CLN: Remove unnecessary code (pandas-dev#23696) Pin flake8-rst version (pandas-dev#23699) Implement _most_ of the EA interface for DTA/TDA (pandas-dev#23643) CI: raise clone depth limit on CI BUG: Fix Series/DataFrame.rank(pct=True) with more than 2**24 rows (pandas-dev#23688) REF: Move Excel names parameter handling to CSV (pandas-dev#23690) DOC: Accessing files from a S3 bucket. (pandas-dev#23639) Fix errorbar visualization (pandas-dev#23674) DOC: Surface / doc mangle_dupe_cols in read_excel (pandas-dev#23678) DOC: Update is_sparse docstring (pandas-dev#19983) BUG: Fix read_excel w/parse_cols & empty dataset (pandas-dev#23661) Add to_flat_index method to MultiIndex (pandas-dev#22866) CLN: Move to_excel to generic.py (pandas-dev#23656) TST: IntervalTree.get_loc_interval should return platform int (pandas-dev#23660)
2 parents 84b8db9 + b4b945a commit 97db816

File tree

118 files changed

+2119
-736
lines changed

Some content is hidden

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

118 files changed

+2119
-736
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,5 @@ doc/build/html/index.html
109109
# Windows specific leftover:
110110
doc/tmp.sv
111111
doc/source/styled.xlsx
112-
doc/source/templates/
113112
env/
114113
doc/source/savefig/

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env:
2323

2424
git:
2525
# for cloning
26-
depth: 1000
26+
depth: 1500
2727

2828
matrix:
2929
fast_finish: true

ci/build_docs.sh

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if [ "${TRAVIS_OS_NAME}" != "linux" ]; then
55
exit 0
66
fi
77

8-
cd "$TRAVIS_BUILD_DIR"
8+
cd "$TRAVIS_BUILD_DIR"/doc
99
echo "inside $0"
1010

1111
if [ "$DOC" ]; then
@@ -14,10 +14,6 @@ if [ "$DOC" ]; then
1414

1515
source activate pandas
1616

17-
mv "$TRAVIS_BUILD_DIR"/doc /tmp
18-
mv "$TRAVIS_BUILD_DIR/LICENSE" /tmp # included in the docs.
19-
cd /tmp/doc
20-
2117
echo ###############################
2218
echo # Log file for the doc build #
2319
echo ###############################
@@ -29,7 +25,7 @@ if [ "$DOC" ]; then
2925
echo # Create and send docs #
3026
echo ########################
3127

32-
cd /tmp/doc/build/html
28+
cd build/html
3329
git config --global user.email "[email protected]"
3430
git config --global user.name "pandas-docs-bot"
3531

ci/deps/travis-36-doc.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ dependencies:
88
- bottleneck
99
- cython>=0.28.2
1010
- fastparquet
11+
- gitpython
1112
- html5lib
1213
- hypothesis>=3.58.0
1314
- ipykernel

ci/deps/travis-36.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies:
99
- fastparquet
1010
- flake8>=3.5
1111
- flake8-comprehensions
12-
- flake8-rst
12+
- flake8-rst=0.4.2
1313
- gcsfs
1414
- geopandas
1515
- html5lib

doc/make.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,12 @@ def _process_single_doc(self, single_doc):
126126
self.single_doc = 'api'
127127
elif os.path.exists(os.path.join(SOURCE_PATH, single_doc)):
128128
self.single_doc_type = 'rst'
129-
self.single_doc = os.path.splitext(os.path.basename(single_doc))[0]
129+
130+
if 'whatsnew' in single_doc:
131+
basename = single_doc
132+
else:
133+
basename = os.path.basename(single_doc)
134+
self.single_doc = os.path.splitext(basename)[0]
130135
elif os.path.exists(
131136
os.path.join(SOURCE_PATH, '{}.rst'.format(single_doc))):
132137
self.single_doc_type = 'rst'

doc/source/api.rst

+1
Original file line numberDiff line numberDiff line change
@@ -1724,6 +1724,7 @@ MultiIndex Components
17241724
MultiIndex.set_levels
17251725
MultiIndex.set_labels
17261726
MultiIndex.to_hierarchical
1727+
MultiIndex.to_flat_index
17271728
MultiIndex.to_frame
17281729
MultiIndex.is_lexsorted
17291730
MultiIndex.sortlevel

doc/source/conf.py

+39-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
# documentation root, use os.path.abspath to make it absolute, like shown here.
4141
# sys.path.append(os.path.abspath('.'))
4242
sys.path.insert(0, os.path.abspath('../sphinxext'))
43-
4443
sys.path.extend([
4544

4645
# numpy standard doc extensions
@@ -75,6 +74,7 @@
7574
'sphinx.ext.ifconfig',
7675
'sphinx.ext.linkcode',
7776
'nbsphinx',
77+
'contributors', # custom pandas extension
7878
]
7979

8080
try:
@@ -120,7 +120,9 @@
120120
templates_path = ['../_templates']
121121

122122
# The suffix of source filenames.
123-
source_suffix = '.rst'
123+
source_suffix = [
124+
'.rst',
125+
]
124126

125127
# The encoding of source files.
126128
source_encoding = 'utf-8'
@@ -298,8 +300,26 @@
298300
for page in moved_api_pages
299301
}
300302

303+
304+
common_imports = """\
305+
.. currentmodule:: pandas
306+
307+
.. ipython:: python
308+
:suppress:
309+
310+
import numpy as np
311+
from pandas import *
312+
import pandas as pd
313+
randn = np.random.randn
314+
np.set_printoptions(precision=4, suppress=True)
315+
options.display.max_rows = 15
316+
from pandas.compat import StringIO
317+
"""
318+
319+
301320
html_context = {
302-
'redirects': {old: new for old, new in moved_api_pages}
321+
'redirects': {old: new for old, new in moved_api_pages},
322+
'common_imports': common_imports,
303323
}
304324

305325
# If false, no module index is generated.
@@ -654,7 +674,23 @@ def process_class_docstrings(app, what, name, obj, options, lines):
654674
]
655675

656676

677+
def rstjinja(app, docname, source):
678+
"""
679+
Render our pages as a jinja template for fancy templating goodness.
680+
"""
681+
# http://ericholscher.com/blog/2016/jul/25/integrating-jinja-rst-sphinx/
682+
# Make sure we're outputting HTML
683+
if app.builder.format != 'html':
684+
return
685+
src = source[0]
686+
rendered = app.builder.templates.render_string(
687+
src, app.config.html_context
688+
)
689+
source[0] = rendered
690+
691+
657692
def setup(app):
693+
app.connect("source-read", rstjinja)
658694
app.connect("autodoc-process-docstring", remove_flags_docstring)
659695
app.connect("autodoc-process-docstring", process_class_docstrings)
660696
app.add_autodocumenter(AccessorDocumenter)

doc/source/contributing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ Information on how to write a benchmark and how to use asv can be found in the
11031103
Documenting your code
11041104
---------------------
11051105

1106-
Changes should be reflected in the release notes located in ``doc/source/whatsnew/vx.y.z.txt``.
1106+
Changes should be reflected in the release notes located in ``doc/source/whatsnew/vx.y.z.rst``.
11071107
This file contains an ongoing change log for each release. Add an entry to this file to
11081108
document your fix, enhancement or (unavoidable) breaking change. Make sure to include the
11091109
GitHub issue number when adding your entry (using ``:issue:`1234``` where ``1234`` is the

doc/source/index.rst.template

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ See the package overview for more detail about what's in the library.
118118
{{ single_doc }}
119119
{% endif -%}
120120
{% if not single_doc -%}
121-
whatsnew
121+
What's New <whatsnew/v0.24.0>
122122
install
123123
contributing
124124
overview
@@ -159,5 +159,5 @@ See the package overview for more detail about what's in the library.
159159
developer
160160
internals
161161
extending
162-
release
162+
releases
163163
{% endif -%}

doc/source/io.rst

+8-1
Original file line numberDiff line numberDiff line change
@@ -1580,12 +1580,19 @@ You can pass in a URL to a CSV file:
15801580
df = pd.read_csv('https://download.bls.gov/pub/time.series/cu/cu.item',
15811581
sep='\t')
15821582
1583-
S3 URLs are handled as well:
1583+
S3 URLs are handled as well but require installing the `S3Fs
1584+
<https://pypi.org/project/s3fs/>`_ library:
15841585

15851586
.. code-block:: python
15861587
15871588
df = pd.read_csv('s3://pandas-test/tips.csv')
15881589
1590+
If your S3 bucket requires cedentials you will need to set them as environment
1591+
variables or in the ``~/.aws/credentials`` config file, refer to the `S3Fs
1592+
documentation on credentials
1593+
<https://s3fs.readthedocs.io/en/latest/#credentials>`_.
1594+
1595+
15891596

15901597
Writing out Data
15911598
''''''''''''''''

0 commit comments

Comments
 (0)