Skip to content

Commit 54c52da

Browse files
committed
Merge remote-tracking branch 'upstream/master' into styler_tooltips_feature
# Conflicts: # doc/source/whatsnew/v1.3.0.rst
2 parents 5a377b8 + a3b5c49 commit 54c52da

File tree

296 files changed

+10718
-6832
lines changed

Some content is hidden

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

296 files changed

+10718
-6832
lines changed

.github/workflows/ci.yml

+53-28
Original file line numberDiff line numberDiff line change
@@ -2,74 +2,81 @@ name: CI
22

33
on:
44
push:
5-
branches: master
5+
branches: [master]
66
pull_request:
77
branches:
88
- master
99
- 1.2.x
1010

1111
env:
1212
ENV_FILE: environment.yml
13+
PANDAS_CI: 1
1314

1415
jobs:
1516
checks:
1617
name: Checks
1718
runs-on: ubuntu-latest
18-
steps:
19-
20-
- name: Setting conda path
21-
run: echo "${HOME}/miniconda3/bin" >> $GITHUB_PATH
19+
defaults:
20+
run:
21+
shell: bash -l {0}
2222

23+
steps:
2324
- name: Checkout
2425
uses: actions/checkout@v1
2526

2627
- name: Looking for unwanted patterns
2728
run: ci/code_checks.sh patterns
2829
if: always()
2930

30-
- name: Setup environment and build pandas
31-
run: ci/setup_env.sh
32-
if: always()
31+
- name: Cache conda
32+
uses: actions/cache@v2
33+
with:
34+
path: ~/conda_pkgs_dir
35+
key: ${{ runner.os }}-conda-${{ hashFiles('${{ env.ENV_FILE }}') }}
3336

34-
- name: Linting
37+
- uses: conda-incubator/setup-miniconda@v2
38+
with:
39+
activate-environment: pandas-dev
40+
channel-priority: strict
41+
environment-file: ${{ env.ENV_FILE }}
42+
use-only-tar-bz2: true
43+
44+
- name: Environment Detail
3545
run: |
36-
source activate pandas-dev
37-
ci/code_checks.sh lint
46+
conda info
47+
conda list
48+
49+
- name: Build Pandas
50+
run: |
51+
python setup.py build_ext -j 2
52+
python -m pip install -e . --no-build-isolation --no-use-pep517
53+
54+
- name: Linting
55+
run: ci/code_checks.sh lint
3856
if: always()
3957

4058
- name: Checks on imported code
41-
run: |
42-
source activate pandas-dev
43-
ci/code_checks.sh code
59+
run: ci/code_checks.sh code
4460
if: always()
4561

4662
- name: Running doctests
47-
run: |
48-
source activate pandas-dev
49-
ci/code_checks.sh doctests
63+
run: ci/code_checks.sh doctests
5064
if: always()
5165

5266
- name: Docstring validation
53-
run: |
54-
source activate pandas-dev
55-
ci/code_checks.sh docstrings
67+
run: ci/code_checks.sh docstrings
5668
if: always()
5769

5870
- name: Typing validation
59-
run: |
60-
source activate pandas-dev
61-
ci/code_checks.sh typing
71+
run: ci/code_checks.sh typing
6272
if: always()
6373

6474
- name: Testing docstring validation script
65-
run: |
66-
source activate pandas-dev
67-
pytest --capture=no --strict-markers scripts
75+
run: pytest --capture=no --strict-markers scripts
6876
if: always()
6977

7078
- name: Running benchmarks
7179
run: |
72-
source activate pandas-dev
7380
cd asv_bench
7481
asv check -E existing
7582
git remote add upstream https://github.com/pandas-dev/pandas.git
@@ -106,7 +113,6 @@ jobs:
106113
run: |
107114
source activate pandas-dev
108115
python web/pandas_web.py web/pandas --target-path=web/build
109-
110116
- name: Build documentation
111117
run: |
112118
source activate pandas-dev
@@ -132,3 +138,22 @@ jobs:
132138
- name: Upload dev docs
133139
run: rsync -az --delete doc/build/html/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas/pandas-docs/dev
134140
if: github.event_name == 'push'
141+
142+
data_manager:
143+
name: Test experimental data manager
144+
runs-on: ubuntu-latest
145+
steps:
146+
147+
- name: Setting conda path
148+
run: echo "${HOME}/miniconda3/bin" >> $GITHUB_PATH
149+
150+
- name: Checkout
151+
uses: actions/checkout@v1
152+
153+
- name: Setup environment and build pandas
154+
run: ci/setup_env.sh
155+
156+
- name: Run tests
157+
run: |
158+
source activate pandas-dev
159+
pytest pandas/tests/frame/methods --array-manager

.pre-commit-config.yaml

+7-4
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@ repos:
2020
types: [text]
2121
args: [--append-config=flake8/cython-template.cfg]
2222
- repo: https://github.com/PyCQA/isort
23-
rev: 5.6.4
23+
rev: 5.7.0
2424
hooks:
2525
- id: isort
26-
types: [text] # overwrite upstream `types: [python]`
27-
types_or: [python, cython]
2826
- repo: https://github.com/asottile/pyupgrade
2927
rev: v2.7.4
3028
hooks:
@@ -128,7 +126,7 @@ repos:
128126
entry: python scripts/validate_unwanted_patterns.py --validation-type="bare_pytest_raises"
129127
types: [python]
130128
files: ^pandas/tests/
131-
exclude: ^pandas/tests/(computation|extension|io)/
129+
exclude: ^pandas/tests/extension/
132130
- id: inconsistent-namespace-usage
133131
name: 'Check for inconsistent use of pandas namespace in tests'
134132
entry: python scripts/check_for_inconsistent_pandas_namespace.py
@@ -154,6 +152,11 @@ repos:
154152
\#\ type:\s?ignore(?!\[)
155153
language: pygrep
156154
types: [python]
155+
- id: np-bool
156+
name: Check for use of np.bool instead of np.bool_
157+
entry: np\.bool[^_8]
158+
language: pygrep
159+
types_or: [python, cython, rst]
157160
- id: no-os-remove
158161
name: Check code for instances of os.remove
159162
entry: os\.remove

asv_bench/benchmarks/groupby.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ class TransformBools:
627627
def setup(self):
628628
N = 120000
629629
transition_points = np.sort(np.random.choice(np.arange(N), 1400))
630-
transitions = np.zeros(N, dtype=np.bool)
630+
transitions = np.zeros(N, dtype=np.bool_)
631631
transitions[transition_points] = True
632632
self.g = transitions.cumsum()
633633
self.df = DataFrame({"signal": np.random.rand(N)})

asv_bench/benchmarks/io/excel.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class ReadExcel:
4343
params = ["xlrd", "openpyxl", "odf"]
4444
param_names = ["engine"]
4545
fname_excel = "spreadsheet.xlsx"
46+
fname_excel_xls = "spreadsheet.xls"
4647
fname_odf = "spreadsheet.ods"
4748

4849
def _create_odf(self):
@@ -63,10 +64,16 @@ def setup_cache(self):
6364
self.df = _generate_dataframe()
6465

6566
self.df.to_excel(self.fname_excel, sheet_name="Sheet1")
67+
self.df.to_excel(self.fname_excel_xls, sheet_name="Sheet1")
6668
self._create_odf()
6769

6870
def time_read_excel(self, engine):
69-
fname = self.fname_odf if engine == "odf" else self.fname_excel
71+
if engine == "xlrd":
72+
fname = self.fname_excel_xls
73+
elif engine == "odf":
74+
fname = self.fname_odf
75+
else:
76+
fname = self.fname_excel
7077
read_excel(fname, engine=engine)
7178

7279

ci/deps/actions-37-locale.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dependencies:
3030
- openpyxl
3131
- pandas-gbq
3232
- google-cloud-bigquery>=1.27.2 # GH 36436
33-
- pyarrow>=0.17
33+
- pyarrow=0.17 # GH 38803
3434
- pytables>=3.5.1
3535
- scipy
3636
- xarray=0.12.3

ci/deps/azure-37-slow.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ dependencies:
3636
- xlwt
3737
- moto
3838
- flask
39+
- numba

ci/deps/azure-38-slow.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ dependencies:
3434
- xlwt
3535
- moto
3636
- flask
37+
- numba

doc/make.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def __init__(
4646
warnings_are_errors=False,
4747
):
4848
self.num_jobs = num_jobs
49+
self.include_api = include_api
4950
self.verbosity = verbosity
5051
self.warnings_are_errors = warnings_are_errors
5152

@@ -188,7 +189,14 @@ def _add_redirects(self):
188189
if not row or row[0].strip().startswith("#"):
189190
continue
190191

191-
path = os.path.join(BUILD_PATH, "html", *row[0].split("/")) + ".html"
192+
html_path = os.path.join(BUILD_PATH, "html")
193+
path = os.path.join(html_path, *row[0].split("/")) + ".html"
194+
195+
if not self.include_api and (
196+
os.path.join(html_path, "reference") in path
197+
or os.path.join(html_path, "generated") in path
198+
):
199+
continue
192200

193201
try:
194202
title = self._get_page_title(row[1])
@@ -198,11 +206,6 @@ def _add_redirects(self):
198206
# sphinx specific stuff
199207
title = "this page"
200208

201-
if os.path.exists(path):
202-
raise RuntimeError(
203-
f"Redirection would overwrite an existing file: {path}"
204-
)
205-
206209
with open(path, "w") as moved_page_fd:
207210
html = f"""\
208211
<html>
Loading
238 KB
Loading
67.5 KB
Loading
243 KB
Loading
68.5 KB
Loading

doc/source/conf.py

+12-9
Original file line numberDiff line numberDiff line change
@@ -77,29 +77,32 @@
7777
try:
7878
import nbconvert
7979
except ImportError:
80-
logger.warn("nbconvert not installed. Skipping notebooks.")
80+
logger.warning("nbconvert not installed. Skipping notebooks.")
8181
exclude_patterns.append("**/*.ipynb")
8282
else:
8383
try:
8484
nbconvert.utils.pandoc.get_pandoc_version()
8585
except nbconvert.utils.pandoc.PandocMissing:
86-
logger.warn("Pandoc not installed. Skipping notebooks.")
86+
logger.warning("Pandoc not installed. Skipping notebooks.")
8787
exclude_patterns.append("**/*.ipynb")
8888

8989
# sphinx_pattern can be '-api' to exclude the API pages,
9090
# the path to a file, or a Python object
9191
# (e.g. '10min.rst' or 'pandas.DataFrame.head')
9292
source_path = os.path.dirname(os.path.abspath(__file__))
9393
pattern = os.environ.get("SPHINX_PATTERN")
94+
single_doc = pattern is not None and pattern != "-api"
95+
include_api = pattern != "-api"
9496
if pattern:
9597
for dirname, dirs, fnames in os.walk(source_path):
98+
reldir = os.path.relpath(dirname, source_path)
9699
for fname in fnames:
97100
if os.path.splitext(fname)[-1] in (".rst", ".ipynb"):
98101
fname = os.path.relpath(os.path.join(dirname, fname), source_path)
99102

100103
if fname == "index.rst" and os.path.abspath(dirname) == source_path:
101104
continue
102-
elif pattern == "-api" and dirname == "reference":
105+
elif pattern == "-api" and reldir.startswith("reference"):
103106
exclude_patterns.append(fname)
104107
elif pattern != "-api" and fname != pattern:
105108
exclude_patterns.append(fname)
@@ -109,11 +112,11 @@
109112
with open(os.path.join(source_path, "index.rst"), "w") as f:
110113
f.write(
111114
t.render(
112-
include_api=pattern is None,
113-
single_doc=(pattern if pattern is not None and pattern != "-api" else None),
115+
include_api=include_api,
116+
single_doc=(pattern if single_doc else None),
114117
)
115118
)
116-
autosummary_generate = True if pattern is None else ["index"]
119+
autosummary_generate = True if include_api else ["index"]
117120
autodoc_typehints = "none"
118121

119122
# numpydoc
@@ -315,7 +318,7 @@
315318
# ... and each of its public methods
316319
moved_api_pages.append((f"{old}.{method}", f"{new}.{method}"))
317320

318-
if pattern is None:
321+
if include_api:
319322
html_additional_pages = {
320323
"generated/" + page[0]: "api_redirect.html" for page in moved_api_pages
321324
}
@@ -411,7 +414,7 @@
411414
# latex_use_modindex = True
412415

413416

414-
if pattern is None:
417+
if include_api:
415418
intersphinx_mapping = {
416419
"dateutil": ("https://dateutil.readthedocs.io/en/latest/", None),
417420
"matplotlib": ("https://matplotlib.org/", None),
@@ -432,7 +435,7 @@
432435

433436

434437
ipython_warning_is_error = False
435-
ipython_exec_lines = [
438+
ipython_execlines = [
436439
"import numpy as np",
437440
"import pandas as pd",
438441
# This ensures correct rendering on system with console encoding != utf8

doc/source/development/contributing.rst

+6
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,12 @@ to run its checks with::
698698

699699
without needing to have done ``pre-commit install`` beforehand.
700700

701+
If you want to run checks on all recently commited files on upstream/master you can use::
702+
703+
pre-commit run --from-ref=upstream/master --to-ref=HEAD --all-files
704+
705+
without needing to have done ``pre-commit install`` beforehand.
706+
701707
.. note::
702708

703709
If you have conflicting installations of ``virtualenv``, then you may get an

doc/source/ecosystem.rst

+8
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ Featuretools is a Python library for automated feature engineering built on top
8585

8686
Compose is a machine learning tool for labeling data and prediction engineering. It allows you to structure the labeling process by parameterizing prediction problems and transforming time-driven relational data into target values with cutoff times that can be used for supervised learning.
8787

88+
`STUMPY <https://github.com/TDAmeritrade/stumpy>`__
89+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
90+
91+
STUMPY is a powerful and scalable Python library for modern time series analysis.
92+
At its core, STUMPY efficiently computes something called a
93+
`matrix profile <https://stumpy.readthedocs.io/en/latest/Tutorial_The_Matrix_Profile.html>`__,
94+
which can be used for a wide variety of time series data mining tasks.
95+
8896
.. _ecosystem.visualization:
8997

9098
Visualization

doc/source/getting_started/comparison/comparison_with_sas.rst

+6
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ see the :ref:`indexing documentation<indexing>` for much more on how to use an
6262
``Index`` effectively.
6363

6464

65+
Copies vs. in place operations
66+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
67+
68+
.. include:: includes/copies.rst
69+
70+
6571
Data input / output
6672
-------------------
6773

0 commit comments

Comments
 (0)