Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into ea-repr
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAugspurger committed Nov 14, 2018
2 parents 62b1e2f + e413c49 commit a926dca
Show file tree
Hide file tree
Showing 142 changed files with 2,421 additions and 939 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,5 @@ doc/build/html/index.html
# Windows specific leftover:
doc/tmp.sv
doc/source/styled.xlsx
doc/source/templates/
env/
doc/source/savefig/
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ env:

git:
# for cloning
depth: 1000
depth: 1500

matrix:
fast_finish: true
Expand Down
8 changes: 2 additions & 6 deletions ci/build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if [ "${TRAVIS_OS_NAME}" != "linux" ]; then
exit 0
fi

cd "$TRAVIS_BUILD_DIR"
cd "$TRAVIS_BUILD_DIR"/doc
echo "inside $0"

if [ "$DOC" ]; then
Expand All @@ -14,10 +14,6 @@ if [ "$DOC" ]; then

source activate pandas

mv "$TRAVIS_BUILD_DIR"/doc /tmp
mv "$TRAVIS_BUILD_DIR/LICENSE" /tmp # included in the docs.
cd /tmp/doc

echo ###############################
echo # Log file for the doc build #
echo ###############################
Expand All @@ -29,7 +25,7 @@ if [ "$DOC" ]; then
echo # Create and send docs #
echo ########################

cd /tmp/doc/build/html
cd build/html
git config --global user.email "[email protected]"
git config --global user.name "pandas-docs-bot"

Expand Down
3 changes: 2 additions & 1 deletion ci/deps/travis-36-doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ dependencies:
- bottleneck
- cython>=0.28.2
- fastparquet
- gitpython
- html5lib
- hypothesis>=3.58.0
- ipykernel
- ipython==6.5.0
- ipython
- ipywidgets
- lxml
- matplotlib
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/travis-36.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies:
- fastparquet
- flake8>=3.5
- flake8-comprehensions
- flake8-rst
- flake8-rst=0.4.2
- gcsfs
- geopandas
- html5lib
Expand Down
7 changes: 6 additions & 1 deletion doc/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ def _process_single_doc(self, single_doc):
self.single_doc = 'api'
elif os.path.exists(os.path.join(SOURCE_PATH, single_doc)):
self.single_doc_type = 'rst'
self.single_doc = os.path.splitext(os.path.basename(single_doc))[0]

if 'whatsnew' in single_doc:
basename = single_doc
else:
basename = os.path.basename(single_doc)
self.single_doc = os.path.splitext(basename)[0]
elif os.path.exists(
os.path.join(SOURCE_PATH, '{}.rst'.format(single_doc))):
self.single_doc_type = 'rst'
Expand Down
2 changes: 1 addition & 1 deletion doc/source/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ Index Types

We have discussed ``MultiIndex`` in the previous sections pretty extensively.
Documentation about ``DatetimeIndex`` and ``PeriodIndex`` are shown :ref:`here <timeseries.overview>`,
and documentation about ``TimedeltaIndex`` is found :ref:`here <timedeltas.timedeltaindex>`.
and documentation about ``TimedeltaIndex`` is found :ref:`here <timedeltas.index>`.

In the following sub-sections we will highlight some other index types.

Expand Down
1 change: 1 addition & 0 deletions doc/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1724,6 +1724,7 @@ MultiIndex Components
MultiIndex.set_levels
MultiIndex.set_labels
MultiIndex.to_hierarchical
MultiIndex.to_flat_index
MultiIndex.to_frame
MultiIndex.is_lexsorted
MultiIndex.sortlevel
Expand Down
43 changes: 40 additions & 3 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.append(os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('../sphinxext'))

sys.path.extend([

# numpy standard doc extensions
Expand Down Expand Up @@ -75,6 +74,7 @@
'sphinx.ext.ifconfig',
'sphinx.ext.linkcode',
'nbsphinx',
'contributors', # custom pandas extension
]

try:
Expand Down Expand Up @@ -120,7 +120,9 @@
templates_path = ['../_templates']

# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = [
'.rst',
]

# The encoding of source files.
source_encoding = 'utf-8'
Expand Down Expand Up @@ -298,8 +300,26 @@
for page in moved_api_pages
}


common_imports = """\
.. currentmodule:: pandas
.. ipython:: python
:suppress:
import numpy as np
from pandas import *
import pandas as pd
randn = np.random.randn
np.set_printoptions(precision=4, suppress=True)
options.display.max_rows = 15
from pandas.compat import StringIO
"""


html_context = {
'redirects': {old: new for old, new in moved_api_pages}
'redirects': {old: new for old, new in moved_api_pages},
'common_imports': common_imports,
}

# If false, no module index is generated.
Expand Down Expand Up @@ -388,6 +408,7 @@
category=FutureWarning)


ipython_warning_is_error = False
ipython_exec_lines = [
'import numpy as np',
'import pandas as pd',
Expand Down Expand Up @@ -653,7 +674,23 @@ def process_class_docstrings(app, what, name, obj, options, lines):
]


def rstjinja(app, docname, source):
"""
Render our pages as a jinja template for fancy templating goodness.
"""
# http://ericholscher.com/blog/2016/jul/25/integrating-jinja-rst-sphinx/
# Make sure we're outputting HTML
if app.builder.format != 'html':
return
src = source[0]
rendered = app.builder.templates.render_string(
src, app.config.html_context
)
source[0] = rendered


def setup(app):
app.connect("source-read", rstjinja)
app.connect("autodoc-process-docstring", remove_flags_docstring)
app.connect("autodoc-process-docstring", process_class_docstrings)
app.add_autodocumenter(AccessorDocumenter)
Expand Down
2 changes: 1 addition & 1 deletion doc/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ Information on how to write a benchmark and how to use asv can be found in the
Documenting your code
---------------------

Changes should be reflected in the release notes located in ``doc/source/whatsnew/vx.y.z.txt``.
Changes should be reflected in the release notes located in ``doc/source/whatsnew/vx.y.z.rst``.
This file contains an ongoing change log for each release. Add an entry to this file to
document your fix, enhancement or (unavoidable) breaking change. Make sure to include the
GitHub issue number when adding your entry (using ``:issue:`1234``` where ``1234`` is the
Expand Down
2 changes: 1 addition & 1 deletion doc/source/ecosystem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ which are utilized by Jupyter Notebook for displaying
(Note: HTML tables may or may not be
compatible with non-HTML Jupyter output formats.)

See :ref:`Options and Settings <options>` and :ref:`options.available <available>`
See :ref:`Options and Settings <options>` and :ref:`options.available`
for pandas ``display.`` settings.

`quantopian/qgrid <https://github.com/quantopian/qgrid>`__
Expand Down
4 changes: 2 additions & 2 deletions doc/source/index.rst.template
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ See the package overview for more detail about what's in the library.
{{ single_doc }}
{% endif -%}
{% if not single_doc -%}
whatsnew
What's New <whatsnew/v0.24.0>
install
contributing
overview
Expand Down Expand Up @@ -159,5 +159,5 @@ See the package overview for more detail about what's in the library.
developer
internals
extending
release
releases
{% endif -%}
9 changes: 8 additions & 1 deletion doc/source/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1580,12 +1580,19 @@ You can pass in a URL to a CSV file:
df = pd.read_csv('https://download.bls.gov/pub/time.series/cu/cu.item',
sep='\t')
S3 URLs are handled as well:
S3 URLs are handled as well but require installing the `S3Fs
<https://pypi.org/project/s3fs/>`_ library:

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



Writing out Data
''''''''''''''''
Expand Down
Loading

0 comments on commit a926dca

Please sign in to comment.