Skip to content

Commit 2fc2f30

Browse files
authored
Merge branch 'master' into periodengine-get_loc
2 parents 4655655 + 9a68635 commit 2fc2f30

File tree

779 files changed

+18032
-12539
lines changed

Some content is hidden

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

779 files changed

+18032
-12539
lines changed

.github/workflows/ci.yml

+72-10
Original file line numberDiff line numberDiff line change
@@ -23,53 +23,53 @@ jobs:
2323

2424
- name: Looking for unwanted patterns
2525
run: ci/code_checks.sh patterns
26-
if: true
26+
if: always()
2727

2828
- name: Setup environment and build pandas
2929
run: ci/setup_env.sh
30-
if: true
30+
if: always()
3131

3232
- name: Linting
3333
run: |
3434
source activate pandas-dev
3535
ci/code_checks.sh lint
36-
if: true
36+
if: always()
3737

3838
- name: Dependencies consistency
3939
run: |
4040
source activate pandas-dev
4141
ci/code_checks.sh dependencies
42-
if: true
42+
if: always()
4343

4444
- name: Checks on imported code
4545
run: |
4646
source activate pandas-dev
4747
ci/code_checks.sh code
48-
if: true
48+
if: always()
4949

5050
- name: Running doctests
5151
run: |
5252
source activate pandas-dev
5353
ci/code_checks.sh doctests
54-
if: true
54+
if: always()
5555

5656
- name: Docstring validation
5757
run: |
5858
source activate pandas-dev
5959
ci/code_checks.sh docstrings
60-
if: true
60+
if: always()
6161

6262
- name: Typing validation
6363
run: |
6464
source activate pandas-dev
6565
ci/code_checks.sh typing
66-
if: true
66+
if: always()
6767

6868
- name: Testing docstring validation script
6969
run: |
7070
source activate pandas-dev
7171
pytest --capture=no --strict scripts
72-
if: true
72+
if: always()
7373

7474
- name: Running benchmarks
7575
run: |
@@ -87,11 +87,73 @@ jobs:
8787
else
8888
echo "Benchmarks did not run, no changes detected"
8989
fi
90-
if: true
90+
if: always()
9191

9292
- name: Publish benchmarks artifact
9393
uses: actions/upload-artifact@master
9494
with:
9595
name: Benchmarks log
9696
path: asv_bench/benchmarks.log
9797
if: failure()
98+
99+
web_and_docs:
100+
name: Web and docs
101+
runs-on: ubuntu-latest
102+
steps:
103+
104+
- name: Setting conda path
105+
run: echo "::set-env name=PATH::${HOME}/miniconda3/bin:${PATH}"
106+
107+
- name: Checkout
108+
uses: actions/checkout@v1
109+
110+
- name: Setup environment and build pandas
111+
run: ci/setup_env.sh
112+
113+
- name: Build website
114+
run: |
115+
source activate pandas-dev
116+
python web/pandas_web.py web/pandas --target-path=web/build
117+
118+
- name: Build documentation
119+
run: |
120+
source activate pandas-dev
121+
doc/make.py --warnings-are-errors | tee sphinx.log ; exit ${PIPESTATUS[0]}
122+
123+
# This can be removed when the ipython directive fails when there are errors,
124+
# including the `tee sphinx.log` in te previous step (https://github.com/ipython/ipython/issues/11547)
125+
- name: Check ipython directive errors
126+
run: "! grep -B1 \"^<<<-------------------------------------------------------------------------$\" sphinx.log"
127+
128+
- name: Merge website and docs
129+
run: |
130+
mkdir -p pandas_web/docs
131+
cp -r web/build/* pandas_web/
132+
cp -r doc/build/html/* pandas_web/docs/
133+
if: github.event_name == 'push'
134+
135+
- name: Install Rclone
136+
run: sudo apt install rclone -y
137+
if: github.event_name == 'push'
138+
139+
- name: Set up Rclone
140+
run: |
141+
RCLONE_CONFIG_PATH=$HOME/.config/rclone/rclone.conf
142+
mkdir -p `dirname $RCLONE_CONFIG_PATH`
143+
echo "[ovh_cloud_pandas_web]" > $RCLONE_CONFIG_PATH
144+
echo "type = swift" >> $RCLONE_CONFIG_PATH
145+
echo "env_auth = false" >> $RCLONE_CONFIG_PATH
146+
echo "auth_version = 3" >> $RCLONE_CONFIG_PATH
147+
echo "auth = https://auth.cloud.ovh.net/v3/" >> $RCLONE_CONFIG_PATH
148+
echo "endpoint_type = public" >> $RCLONE_CONFIG_PATH
149+
echo "tenant_domain = default" >> $RCLONE_CONFIG_PATH
150+
echo "tenant = 2977553886518025" >> $RCLONE_CONFIG_PATH
151+
echo "domain = default" >> $RCLONE_CONFIG_PATH
152+
echo "user = w4KGs3pmDxpd" >> $RCLONE_CONFIG_PATH
153+
echo "key = ${{ secrets.ovh_object_store_key }}" >> $RCLONE_CONFIG_PATH
154+
echo "region = BHS" >> $RCLONE_CONFIG_PATH
155+
if: github.event_name == 'push'
156+
157+
- name: Sync web
158+
run: rclone sync pandas_web ovh_cloud_pandas_web:dev
159+
if: github.event_name == 'push'

.pre-commit-config.yaml

+13-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,20 @@ repos:
1111
language: python_venv
1212
additional_dependencies: [flake8-comprehensions>=3.1.0]
1313
- repo: https://github.com/pre-commit/mirrors-isort
14-
rev: v4.3.20
14+
rev: v4.3.21
1515
hooks:
1616
- id: isort
1717
language: python_venv
1818
exclude: ^pandas/__init__\.py$|^pandas/core/api\.py$
19+
- repo: https://github.com/pre-commit/mirrors-mypy
20+
rev: v0.730
21+
hooks:
22+
- id: mypy
23+
args:
24+
# As long as a some files are excluded from check-untyped-defs
25+
# we have to exclude it from the pre-commit hook as the configuration
26+
# is based on modules but the hook runs on files.
27+
- --no-check-untyped-defs
28+
- --follow-imports
29+
- skip
30+
files: pandas/

.travis.yml

+5-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: python
2-
python: 3.5
2+
python: 3.7
33

44
# To turn off cached cython files and compiler cache
55
# set NOCACHE-true
@@ -25,40 +25,32 @@ git:
2525

2626
matrix:
2727
fast_finish: true
28-
exclude:
29-
# Exclude the default Python 3.5 build
30-
- python: 3.5
3128

3229
include:
3330
- env:
34-
- JOB="3.8" ENV_FILE="ci/deps/travis-38.yaml" PATTERN="(not slow and not network)"
31+
- JOB="3.8" ENV_FILE="ci/deps/travis-38.yaml" PATTERN="(not slow and not network and not clipboard)"
3532

3633
- env:
37-
- JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" PATTERN="(not slow and not network)"
34+
- JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" PATTERN="(not slow and not network and not clipboard)"
3835

3936
- env:
40-
- JOB="3.6, locale" ENV_FILE="ci/deps/travis-36-locale.yaml" PATTERN="((not slow and not network) or (single and db))" LOCALE_OVERRIDE="zh_CN.UTF-8" SQL="1"
37+
- JOB="3.6, locale" ENV_FILE="ci/deps/travis-36-locale.yaml" PATTERN="((not slow and not network and not clipboard) or (single and db))" LOCALE_OVERRIDE="zh_CN.UTF-8" SQL="1"
4138
services:
4239
- mysql
4340
- postgresql
4441

4542
- env:
46-
- JOB="3.6, coverage" ENV_FILE="ci/deps/travis-36-cov.yaml" PATTERN="((not slow and not network) or (single and db))" PANDAS_TESTING_MODE="deprecate" COVERAGE=true SQL="1"
43+
- JOB="3.6, coverage" ENV_FILE="ci/deps/travis-36-cov.yaml" PATTERN="((not slow and not network and not clipboard) or (single and db))" PANDAS_TESTING_MODE="deprecate" COVERAGE=true SQL="1"
4744
services:
4845
- mysql
4946
- postgresql
5047

51-
# In allow_failures
5248
- env:
5349
- JOB="3.6, slow" ENV_FILE="ci/deps/travis-36-slow.yaml" PATTERN="slow" SQL="1"
5450
services:
5551
- mysql
5652
- postgresql
5753

58-
allow_failures:
59-
- env:
60-
- JOB="3.6, slow" ENV_FILE="ci/deps/travis-36-slow.yaml" PATTERN="slow" SQL="1"
61-
6254
before_install:
6355
- echo "before_install"
6456
# set non-blocking IO on travis

RELEASE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ Release Notes
22
=============
33

44
The list of changes to Pandas between each release can be found
5-
[here](http://pandas.pydata.org/pandas-docs/stable/whatsnew.html). For full
5+
[here](https://pandas.pydata.org/pandas-docs/stable/whatsnew/index.html). For full
66
details, see the commit logs at http://github.com/pandas-dev/pandas.

asv_bench/asv.conf.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"project": "pandas",
88

99
// The project's homepage
10-
"project_url": "http://pandas.pydata.org/",
10+
"project_url": "https://pandas.pydata.org/",
1111

1212
// The URL of the source code repository for the project being
1313
// benchmarked
@@ -122,5 +122,8 @@
122122
".*": "0409521665"
123123
},
124124
"regression_thresholds": {
125-
}
125+
},
126+
"build_command":
127+
["python setup.py build -j4",
128+
"PIP_NO_BUILD_ISOLATION=false python -mpip wheel --no-deps --no-index -w {build_cache_dir} {build_dir}"],
126129
}

asv_bench/benchmarks/algorithms.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
from pandas._libs import lib
66

77
import pandas as pd
8-
from pandas.util import testing as tm
8+
9+
from .pandas_vb_common import tm
910

1011
for imp in ["pandas.util", "pandas.tools.hashing"]:
1112
try:

asv_bench/benchmarks/categoricals.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
import numpy as np
44

55
import pandas as pd
6-
import pandas.util.testing as tm
6+
7+
from .pandas_vb_common import tm
78

89
try:
910
from pandas.api.types import union_categoricals

asv_bench/benchmarks/ctors.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import numpy as np
22

33
from pandas import DatetimeIndex, Index, MultiIndex, Series, Timestamp
4-
import pandas.util.testing as tm
4+
5+
from .pandas_vb_common import tm
56

67

78
def no_change(arr):

asv_bench/benchmarks/frame_ctor.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import numpy as np
22

33
from pandas import DataFrame, MultiIndex, Series, Timestamp, date_range
4-
import pandas.util.testing as tm
4+
5+
from .pandas_vb_common import tm
56

67
try:
78
from pandas.tseries.offsets import Nano, Hour

asv_bench/benchmarks/frame_methods.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
import numpy as np
55

66
from pandas import DataFrame, MultiIndex, NaT, Series, date_range, isnull, period_range
7-
import pandas.util.testing as tm
7+
8+
from .pandas_vb_common import tm
89

910

1011
class GetNumericData:

asv_bench/benchmarks/gil.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
from pandas import DataFrame, Series, date_range, factorize, read_csv
44
from pandas.core.algorithms import take_1d
5-
import pandas.util.testing as tm
5+
6+
from .pandas_vb_common import tm
67

78
try:
89
from pandas import (
@@ -24,7 +25,7 @@
2425
except ImportError:
2526
from pandas import algos
2627
try:
27-
from pandas.util.testing import test_parallel
28+
from pandas._testing import test_parallel
2829

2930
have_real_test_parallel = True
3031
except ImportError:

asv_bench/benchmarks/groupby.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
date_range,
1414
period_range,
1515
)
16-
import pandas.util.testing as tm
16+
17+
from .pandas_vb_common import tm
1718

1819
method_blacklist = {
1920
"object": {

asv_bench/benchmarks/index_object.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
Series,
1313
date_range,
1414
)
15-
import pandas.util.testing as tm
15+
16+
from .pandas_vb_common import tm
1617

1718

1819
class SetOperations:

asv_bench/benchmarks/indexing.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
option_context,
1818
period_range,
1919
)
20-
import pandas.util.testing as tm
20+
21+
from .pandas_vb_common import tm
2122

2223

2324
class NumericSeriesIndexing:
@@ -131,6 +132,7 @@ def setup(self):
131132
self.col_scalar = columns[10]
132133
self.bool_indexer = self.df[self.col_scalar] > 0
133134
self.bool_obj_indexer = self.bool_indexer.astype(object)
135+
self.boolean_indexer = (self.df[self.col_scalar] > 0).astype("boolean")
134136

135137
def time_loc(self):
136138
self.df.loc[self.idx_scalar, self.col_scalar]
@@ -144,6 +146,9 @@ def time_boolean_rows(self):
144146
def time_boolean_rows_object(self):
145147
self.df[self.bool_obj_indexer]
146148

149+
def time_boolean_rows_boolean(self):
150+
self.df[self.boolean_indexer]
151+
147152

148153
class DataFrameNumericIndexing:
149154
def setup(self):

asv_bench/benchmarks/inference.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import numpy as np
22

33
from pandas import DataFrame, Series, to_numeric
4-
import pandas.util.testing as tm
54

6-
from .pandas_vb_common import lib, numeric_dtypes
5+
from .pandas_vb_common import lib, numeric_dtypes, tm
76

87

98
class NumericInferOps:

asv_bench/benchmarks/io/csv.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
import numpy as np
66

77
from pandas import Categorical, DataFrame, date_range, read_csv, to_datetime
8-
import pandas.util.testing as tm
98

10-
from ..pandas_vb_common import BaseIO
9+
from ..pandas_vb_common import BaseIO, tm
1110

1211

1312
class ToCSV(BaseIO):

asv_bench/benchmarks/io/excel.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
from odf.text import P
77

88
from pandas import DataFrame, ExcelWriter, date_range, read_excel
9-
import pandas.util.testing as tm
9+
10+
from ..pandas_vb_common import tm
1011

1112

1213
def _generate_dataframe():

asv_bench/benchmarks/io/hdf.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import numpy as np
22

33
from pandas import DataFrame, HDFStore, date_range, read_hdf
4-
import pandas.util.testing as tm
54

6-
from ..pandas_vb_common import BaseIO
5+
from ..pandas_vb_common import BaseIO, tm
76

87

98
class HDFStoreDataFrame(BaseIO):

0 commit comments

Comments
 (0)