Skip to content

Commit fd558b3

Browse files
committed
Merge remote-tracking branch 'upstream/master' into 26814-optional-fu
2 parents f0b1d97 + e8132a2 commit fd558b3

File tree

12 files changed

+89
-19
lines changed

12 files changed

+89
-19
lines changed

azure-pipelines.yml

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
# XXX next command should avoid redefining the path in every step, but
2525
# made the process crash as it couldn't find deactivate
2626
#echo '##vso[task.prependpath]$HOME/miniconda3/bin'
27-
echo '##vso[task.setvariable variable=CONDA_ENV]pandas-dev'
2827
echo '##vso[task.setvariable variable=ENV_FILE]environment.yml'
2928
echo '##vso[task.setvariable variable=AZURE]true'
3029
displayName: 'Setting environment variables'
@@ -116,3 +115,65 @@ jobs:
116115
fi
117116
displayName: 'Running benchmarks'
118117
condition: true
118+
119+
- job: 'Docs'
120+
pool:
121+
vmImage: ubuntu-16.04
122+
timeoutInMinutes: 90
123+
steps:
124+
- script: |
125+
echo '##vso[task.setvariable variable=ENV_FILE]ci/deps/travis-36-doc.yaml'
126+
displayName: 'Setting environment variables'
127+
128+
- script: |
129+
export PATH=$HOME/miniconda3/bin:$PATH
130+
sudo apt-get install -y libc6-dev-i386
131+
ci/setup_env.sh
132+
displayName: 'Setup environment and build pandas'
133+
134+
- script: |
135+
export PATH=$HOME/miniconda3/bin:$PATH
136+
source activate pandas-dev
137+
doc/make.py
138+
displayName: 'Build documentation'
139+
140+
- script: |
141+
cd doc/build/html
142+
git init
143+
touch .nojekyll
144+
echo "dev.pandas.io" > CNAME
145+
git add --all .
146+
git config user.email "[email protected]"
147+
git config user.name "pandas-docs-bot"
148+
git commit -m "pandas documentation in master"
149+
displayName: 'Create git repo for docs build'
150+
condition : |
151+
and(not(eq(variables['Build.Reason'], 'PullRequest')),
152+
eq(variables['Build.SourceBranch'], 'refs/heads/master'))
153+
154+
# For `InstallSSHKey@0` to work, next steps are required:
155+
# 1. Generate a pair of private/public keys (i.e. `ssh-keygen -t rsa -b 4096 -C "[email protected]"`)
156+
# 2. Go to "Library > Secure files" in the Azure Pipelines dashboard: https://dev.azure.com/pandas-dev/pandas/_library?itemType=SecureFiles
157+
# 3. Click on "+ Secure file"
158+
# 4. Upload the private key (the name of the file must match with the specified in "sshKeySecureFile" input below, "pandas_docs_key")
159+
# 5. Click on file name after it is created, tick the box "Authorize for use in all pipelines" and save
160+
# 6. The public key specified in "sshPublicKey" is the pair of the uploaded private key, and needs to be set as a deploy key of the repo where the docs will be pushed (with write access): https://github.com/pandas-dev/pandas-dev.github.io/settings/keys
161+
- task: InstallSSHKey@0
162+
inputs:
163+
hostName: 'github.com,192.30.252.128 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ=='
164+
sshPublicKey: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDHmz3l/EdqrgNxEUKkwDUuUcLv91unig03pYFGO/DMIgCmPdMG96zAgfnESd837Rm0wSSqylwSzkRJt5MV/TpFlcVifDLDQmUhqCeO8Z6dLl/oe35UKmyYICVwcvQTAaHNnYRpKC5IUlTh0JEtw9fGlnp1Ta7U1ENBLbKdpywczElhZu+hOQ892zqOj3CwA+U2329/d6cd7YnqIKoFN9DWT3kS5K6JE4IoBfQEVekIOs23bKjNLvPoOmi6CroAhu/K8j+NCWQjge5eJf2x/yTnIIP1PlEcXoHIr8io517posIx3TBup+CN8bNS1PpDW3jyD3ttl1uoBudjOQrobNnJeR6Rn67DRkG6IhSwr3BWj8alwUG5mTdZzwV5Pa9KZFdIiqX7NoDGg+itsR39QCn0thK8lGRNSR8KrWC1PSjecwelKBO7uQ7rnk/rkrZdBWR4oEA8YgNH8tirUw5WfOr5a0AIaJicKxGKNdMxZt+zmC+bS7F4YCOGIm9KHa43RrKhoGRhRf9fHHHKUPwFGqtWG4ykcUgoamDOURJyepesBAO3FiRE9rLU6ILbB3yEqqoekborHmAJD5vf7PWItW3Q/YQKuk3kkqRcKnexPyzyyq5lUgTi8CxxZdaASIOu294wjBhhdyHlXEkVTNJ9JKkj/obF+XiIIp0cBDsOXY9hDQ== [email protected]'
165+
sshKeySecureFile: 'pandas_docs_key'
166+
displayName: 'Install GitHub ssh deployment key'
167+
condition : |
168+
and(not(eq(variables['Build.Reason'], 'PullRequest')),
169+
eq(variables['Build.SourceBranch'], 'refs/heads/master'))
170+
171+
- script: |
172+
cd doc/build/html
173+
git remote add origin [email protected]:pandas-dev/pandas-dev.github.io.git
174+
git push -f origin master
175+
exit 0 # FIXME this will leave the build green even if the step fails. To be removed when we are confident with this.
176+
displayName: 'Publish docs to GitHub pages'
177+
condition : |
178+
and(not(eq(variables['Build.Reason'], 'PullRequest')),
179+
eq(variables['Build.SourceBranch'], 'refs/heads/master'))

doc/source/reference/indexing.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ Numeric Index
190190
.. autosummary::
191191
:toctree: api/
192192

193+
RangeIndex.start
194+
RangeIndex.stop
195+
RangeIndex.step
193196
RangeIndex.from_range
194197

195198
.. _api.categoricalindex:

doc/source/reference/series.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ strings and apply several methods to it. These can be accessed like
473473
Series.cat
474474
Series.dt
475475
Series.sparse
476+
DataFrame.sparse
476477
Index.str
477478

478479
.. _api.series.cat:

doc/source/user_guide/sparse.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ A sparse array can be converted to a regular (dense) ndarray with :meth:`numpy.a
7777
np.asarray(sparr)
7878
7979
80+
.. _sparse.dtype:
81+
8082
SparseDtype
8183
-----------
8284

doc/source/whatsnew/v0.20.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@ Removal of prior version deprecations/changes
15641564

15651565
- The ``pandas.rpy`` module is removed. Similar functionality can be accessed
15661566
through the `rpy2 <https://rpy2.readthedocs.io/>`__ project.
1567-
See the :ref:`R interfacing docs <https://pandas.pydata.org/pandas-docs/version/0.20/r_interface.html>`__ for more details.
1567+
See the `R interfacing docs <https://pandas.pydata.org/pandas-docs/version/0.20/r_interface.html>`__ for more details.
15681568
- The ``pandas.io.ga`` module with a ``google-analytics`` interface is removed (:issue:`11308`).
15691569
Similar functionality can be found in the `Google2Pandas <https://github.com/panalysis/Google2Pandas>`__ package.
15701570
- ``pd.to_datetime`` and ``pd.to_timedelta`` have dropped the ``coerce`` parameter in favor of ``errors`` (:issue:`13602`)

pandas/compat/_optional.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import distutils.version
22
import importlib
33
import types
4-
from typing import Optional
54
import warnings
65

76
# Update install.rst when updating versions!
@@ -53,7 +52,7 @@ def import_optional_dependency(
5352
extra: str = "",
5453
raise_on_missing: bool = True,
5554
on_version: str = "raise",
56-
) -> Optional[types.ModuleType]:
55+
):
5756
"""
5857
Import an optional dependency.
5958

pandas/core/frame.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6284,8 +6284,8 @@ def _gotitem(self,
62846284
index (default) or the column axis. This behavior is different from
62856285
`numpy` aggregation functions (`mean`, `median`, `prod`, `sum`, `std`,
62866286
`var`), where the default is to compute the aggregation of the flattened
6287-
array, e.g., ``numpy.mean(arr_2d)`` as opposed to ``numpy.mean(arr_2d,
6288-
axis=0)``.
6287+
array, e.g., ``numpy.mean(arr_2d)`` as opposed to
6288+
``numpy.mean(arr_2d, axis=0)``.
62896289
62906290
`agg` is an alias for `aggregate`. Use the alias.
62916291

pandas/core/strings.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2360,13 +2360,13 @@ def cat(self, others=None, sep=None, na_rep=None, join=None):
23602360
23612361
See Also
23622362
--------
2363-
Series.str.split : Split strings around given separator/delimiter.
2364-
Series.str.rsplit : Splits string around given separator/delimiter,
2365-
starting from the right.
2366-
Series.str.join : Join lists contained as elements in the Series/Index
2367-
with passed delimiter.
2368-
str.split : Standard library version for split.
2369-
str.rsplit : Standard library version for rsplit.
2363+
Series.str.split : Split strings around given separator/delimiter.
2364+
Series.str.rsplit : Splits string around given separator/delimiter,
2365+
starting from the right.
2366+
Series.str.join : Join lists contained as elements in the Series/Index
2367+
with passed delimiter.
2368+
str.split : Standard library version for split.
2369+
str.rsplit : Standard library version for rsplit.
23702370
23712371
Notes
23722372
-----
@@ -2383,7 +2383,12 @@ def cat(self, others=None, sep=None, na_rep=None, join=None):
23832383
Examples
23842384
--------
23852385
>>> s = pd.Series(["this is a regular sentence",
2386-
"https://docs.python.org/3/tutorial/index.html", np.nan])
2386+
... "https://docs.python.org/3/tutorial/index.html",
2387+
... np.nan])
2388+
0 this is a regular sentence
2389+
1 https://docs.python.org/3/tutorial/index.html
2390+
2 NaN
2391+
dtype: object
23872392
23882393
In the default setting, the string is split by whitespace.
23892394
@@ -2434,7 +2439,6 @@ def cat(self, others=None, sep=None, na_rep=None, join=None):
24342439
0 this is a regular
24352440
1 https://docs.python.org/3/tutorial/index.html None None None
24362441
2 NaN NaN NaN NaN \
2437-
24382442
4
24392443
0 sentence
24402444
1 None

pandas/core/tools/datetimes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
456456
- If False returns ndarray of values.
457457
458458
.. deprecated:: 0.25.0
459-
Use :meth:`.to_numpy` or :meth:`Timestamp.to_datetime64`
459+
Use :meth:`Series.to_numpy` or :meth:`Timestamp.to_datetime64`
460460
instead to get an ndarray of values or numpy.datetime64,
461461
respectively.
462462

pandas/core/tools/timedeltas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def to_timedelta(arg, unit='ns', box=True, errors='raise'):
4444
values of dtype timedelta64[ns].
4545
4646
.. deprecated:: 0.25.0
47-
Use :meth:`.to_numpy` or :meth:`Timedelta.to_timedelta64`
47+
Use :meth:`Series.to_numpy` or :meth:`Timedelta.to_timedelta64`
4848
instead to get an ndarray of values or numpy.timedelta64,
4949
respectively.
5050

pandas/io/gcs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ def get_filepath_or_buffer(filepath_or_buffer, encoding=None,
1515

1616
fs = gcsfs.GCSFileSystem()
1717
filepath_or_buffer = fs.open(
18-
filepath_or_buffer, mode) # type: gcsfs.GCSFile
18+
filepath_or_buffer, mode)
1919
return filepath_or_buffer, None, compression, True

pandas/io/s3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ def get_filepath_or_buffer(filepath_or_buffer, encoding=None,
3434
# for that bucket.
3535
fs = s3fs.S3FileSystem(anon=True)
3636
filepath_or_buffer = fs.open(
37-
_strip_schema(filepath_or_buffer), mode) # type: s3fs.S3File
37+
_strip_schema(filepath_or_buffer), mode)
3838
return filepath_or_buffer, None, compression, True

0 commit comments

Comments
 (0)