Skip to content

Commit c79ba0b

Browse files
committed
Merge remote-tracking branch 'upstream/master' into ea-repr
2 parents e7cc2ac + b45eb26 commit c79ba0b

File tree

148 files changed

+5473
-4306
lines changed

Some content is hidden

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

148 files changed

+5473
-4306
lines changed

.circleci/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ jobs:
3434
command: |
3535
export PATH="$MINICONDA_DIR/bin:$PATH"
3636
source activate pandas-dev
37-
echo "pytest --strict --durations=10 --color=no --junitxml=$CIRCLE_TEST_REPORTS/reports/junit.xml --skip-slow --skip-network pandas"
38-
pytest --strict --durations=10 --color=no --junitxml=$CIRCLE_TEST_REPORTS/reports/junit.xml --skip-slow --skip-network pandas
37+
echo "pytest -m "not slow and not network" --strict --durations=10 --color=no --junitxml=$CIRCLE_TEST_REPORTS/reports/junit.xml pandas"
38+
pytest -m "not slow and not network" --strict --durations=10 --color=no --junitxml=$CIRCLE_TEST_REPORTS/reports/junit.xml pandas

.travis.yml

+10-14
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,28 @@ matrix:
3434
include:
3535
- dist: trusty
3636
env:
37-
- JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" TEST_ARGS="--skip-slow --skip-network"
37+
- JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" PATTERN="not slow and not network"
3838

3939
- dist: trusty
4040
env:
41-
- JOB="2.7, locale, slow, old NumPy" ENV_FILE="ci/deps/travis-27-locale.yaml" LOCALE_OVERRIDE="zh_CN.UTF-8" SLOW=true
41+
- JOB="2.7, locale, slow, old NumPy" ENV_FILE="ci/deps/travis-27-locale.yaml" LOCALE_OVERRIDE="zh_CN.UTF-8" PATTERN="slow"
4242
addons:
4343
apt:
4444
packages:
4545
- language-pack-zh-hans
4646
- dist: trusty
4747
env:
48-
- JOB="2.7" ENV_FILE="ci/deps/travis-27.yaml" TEST_ARGS="--skip-slow"
48+
- JOB="2.7" ENV_FILE="ci/deps/travis-27.yaml" PATTERN="not slow"
4949
addons:
5050
apt:
5151
packages:
5252
- python-gtk2
5353
- dist: trusty
5454
env:
55-
- JOB="3.6, lint, coverage" ENV_FILE="ci/deps/travis-36.yaml" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate" COVERAGE=true LINT=true
55+
- JOB="3.6, lint, coverage" ENV_FILE="ci/deps/travis-36.yaml" PATTERN="not slow and not network" PANDAS_TESTING_MODE="deprecate" COVERAGE=true LINT=true
5656
- dist: trusty
5757
env:
58-
- JOB="3.7, NumPy dev" ENV_FILE="ci/deps/travis-37-numpydev.yaml" TEST_ARGS="--skip-slow --skip-network -W error" PANDAS_TESTING_MODE="deprecate"
58+
- JOB="3.7, NumPy dev" ENV_FILE="ci/deps/travis-37-numpydev.yaml" PATTERN="not slow and not network" TEST_ARGS="-W error" PANDAS_TESTING_MODE="deprecate"
5959
addons:
6060
apt:
6161
packages:
@@ -64,7 +64,7 @@ matrix:
6464
# In allow_failures
6565
- dist: trusty
6666
env:
67-
- JOB="3.6, slow" ENV_FILE="ci/deps/travis-36-slow.yaml" SLOW=true
67+
- JOB="3.6, slow" ENV_FILE="ci/deps/travis-36-slow.yaml" PATTERN="slow"
6868

6969
# In allow_failures
7070
- dist: trusty
@@ -73,7 +73,7 @@ matrix:
7373
allow_failures:
7474
- dist: trusty
7575
env:
76-
- JOB="3.6, slow" ENV_FILE="ci/deps/travis-36-slow.yaml" SLOW=true
76+
- JOB="3.6, slow" ENV_FILE="ci/deps/travis-36-slow.yaml" PATTERN="slow"
7777
- dist: trusty
7878
env:
7979
- JOB="3.6, doc" ENV_FILE="ci/deps/travis-36-doc.yaml" DOC=true
@@ -107,20 +107,16 @@ script:
107107
- echo "script start"
108108
- source activate pandas-dev
109109
- ci/run_build_docs.sh
110-
- ci/script_single.sh
111-
- ci/script_multi.sh
110+
- ci/run_tests.sh
112111
- ci/code_checks.sh
113112

114-
after_success:
115-
- ci/upload_coverage.sh
116-
117113
after_script:
118114
- echo "after_script start"
119115
- source activate pandas-dev && pushd /tmp && python -c "import pandas; pandas.show_versions();" && popd
120116
- if [ -e test-data-single.xml ]; then
121-
ci/print_skipped.py test-data-single.xml;
117+
ci/print_skipped.py test-data-single.xml;
122118
fi
123119
- if [ -e test-data-multiple.xml ]; then
124-
ci/print_skipped.py test-data-multiple.xml;
120+
ci/print_skipped.py test-data-multiple.xml;
125121
fi
126122
- echo "after_script done"

asv_bench/benchmarks/categoricals.py

+8
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ def setup(self):
4646
self.values_some_nan = list(np.tile(self.categories + [np.nan], N))
4747
self.values_all_nan = [np.nan] * len(self.values)
4848
self.values_all_int8 = np.ones(N, 'int8')
49+
self.categorical = pd.Categorical(self.values, self.categories)
50+
self.series = pd.Series(self.categorical)
4951

5052
def time_regular(self):
5153
pd.Categorical(self.values, self.categories)
@@ -68,6 +70,12 @@ def time_all_nan(self):
6870
def time_from_codes_all_int8(self):
6971
pd.Categorical.from_codes(self.values_all_int8, self.categories)
7072

73+
def time_existing_categorical(self):
74+
pd.Categorical(self.categorical)
75+
76+
def time_existing_series(self):
77+
pd.Categorical(self.series)
78+
7179

7280
class ValueCounts(object):
7381

ci/README.txt

-17
This file was deleted.

ci/azure/linux.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ jobs:
1212
py27_np_120:
1313
ENV_FILE: ci/deps/azure-27-compat.yaml
1414
CONDA_PY: "27"
15-
TEST_ARGS: "--skip-slow --skip-network"
15+
PATTERN: "not slow and not network"
1616

1717
py37_locale:
1818
ENV_FILE: ci/deps/azure-37-locale.yaml
1919
CONDA_PY: "37"
20-
TEST_ARGS: "--skip-slow --skip-network"
20+
PATTERN: "not slow and not network"
2121
LOCALE_OVERRIDE: "zh_CN.UTF-8"
2222

2323
py36_locale_slow:
2424
ENV_FILE: ci/deps/azure-36-locale_slow.yaml
2525
CONDA_PY: "36"
26-
TEST_ARGS: "--only-slow --skip-network"
26+
PATTERN: "not slow and not network"
2727
LOCALE_OVERRIDE: "it_IT.UTF-8"
2828

2929
steps:
@@ -43,9 +43,7 @@ jobs:
4343
- script: |
4444
export PATH=$HOME/miniconda3/bin:$PATH
4545
source activate pandas-dev
46-
ci/script_single.sh
47-
ci/script_multi.sh
48-
echo "[Test done]"
46+
ci/run_tests.sh
4947
displayName: 'Test'
5048
- script: |
5149
export PATH=$HOME/miniconda3/bin:$PATH

ci/azure/macos.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
py35_np_120:
1313
ENV_FILE: ci/deps/azure-macos-35.yaml
1414
CONDA_PY: "35"
15-
TEST_ARGS: "--skip-slow --skip-network"
15+
PATTERN: "not slow and not network"
1616

1717
steps:
1818
- script: |
@@ -31,9 +31,7 @@ jobs:
3131
- script: |
3232
export PATH=$HOME/miniconda3/bin:$PATH
3333
source activate pandas-dev
34-
ci/script_single.sh
35-
ci/script_multi.sh
36-
echo "[Test done]"
34+
ci/run_tests.sh
3735
displayName: 'Test'
3836
- script: |
3937
export PATH=$HOME/miniconda3/bin:$PATH

ci/azure/windows-py27.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
displayName: 'Build'
3838
- script: |
3939
call activate pandas-dev
40-
pytest --junitxml=test-data.xml --skip-slow --skip-network pandas -n 2 -r sxX --strict --durations=10 %*
40+
pytest -m "not slow and not network" --junitxml=test-data.xml pandas -n 2 -r sxX --strict --durations=10 %*
4141
displayName: 'Test'
4242
- task: PublishTestResults@2
4343
inputs:

ci/azure/windows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
displayName: 'Build'
2929
- script: |
3030
call activate pandas-dev
31-
pytest --junitxml=test-data.xml --skip-slow --skip-network pandas -n 2 -r sxX --strict --durations=10 %*
31+
pytest -m "not slow and not network" --junitxml=test-data.xml pandas -n 2 -r sxX --strict --durations=10 %*
3232
displayName: 'Test'
3333
- task: PublishTestResults@2
3434
inputs:

ci/code_checks.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ if [[ -z "$CHECK" || "$CHECK" == "doctests" ]]; then
147147

148148
MSG='Doctests frame.py' ; echo $MSG
149149
pytest -q --doctest-modules pandas/core/frame.py \
150-
-k"-axes -combine -itertuples -join -pivot_table -quantile -query -reindex -reindex_axis -replace -round -set_index -stack"
150+
-k"-axes -combine -itertuples -join -pivot_table -quantile -query -reindex -reindex_axis -round"
151151
RET=$(($RET + $?)) ; echo $MSG "DONE"
152152

153153
MSG='Doctests series.py' ; echo $MSG

ci/print_versions.py

-29
This file was deleted.

ci/run_tests.sh

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
3+
if [ "$DOC" ]; then
4+
echo "We are not running pytest as this is a doc-build"
5+
exit 0
6+
fi
7+
8+
# Workaround for pytest-xdist flaky collection order
9+
# https://github.com/pytest-dev/pytest/issues/920
10+
# https://github.com/pytest-dev/pytest/issues/1075
11+
export PYTHONHASHSEED=$(python -c 'import random; print(random.randint(1, 4294967295))')
12+
13+
if [ -n "$LOCALE_OVERRIDE" ]; then
14+
export LC_ALL="$LOCALE_OVERRIDE"
15+
export LANG="$LOCALE_OVERRIDE"
16+
PANDAS_LOCALE=`python -c 'import pandas; pandas.get_option("display.encoding")'`
17+
if [[ "$LOCALE_OVERIDE" != "$PANDAS_LOCALE" ]]; then
18+
echo "pandas could not detect the locale. System locale: $LOCALE_OVERRIDE, pandas detected: $PANDAS_LOCALE"
19+
# TODO Not really aborting the tests until https://github.com/pandas-dev/pandas/issues/23923 is fixed
20+
# exit 1
21+
fi
22+
fi
23+
if [[ "not network" == *"$PATTERN"* ]]; then
24+
export http_proxy=http://1.2.3.4 https_proxy=http://1.2.3.4;
25+
fi
26+
27+
28+
if [ -n "$PATTERN" ]; then
29+
PATTERN=" and $PATTERN"
30+
fi
31+
32+
for TYPE in single multiple
33+
do
34+
if [ "$COVERAGE" ]; then
35+
COVERAGE_FNAME="/tmp/coc-$TYPE.xml"
36+
COVERAGE="-s --cov=pandas --cov-report=xml:$COVERAGE_FNAME"
37+
fi
38+
39+
TYPE_PATTERN=$TYPE
40+
NUM_JOBS=1
41+
if [[ "$TYPE_PATTERN" == "multiple" ]]; then
42+
TYPE_PATTERN="not single"
43+
NUM_JOBS=2
44+
fi
45+
46+
pytest -m "$TYPE_PATTERN$PATTERN" -n $NUM_JOBS -s --strict --durations=10 --junitxml=test-data-$TYPE.xml $TEST_ARGS $COVERAGE pandas
47+
48+
if [[ "$COVERAGE" && $? == 0 ]]; then
49+
echo "uploading coverage for $TYPE tests"
50+
bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME
51+
fi
52+
done

ci/script_multi.sh

-49
This file was deleted.

ci/script_single.sh

-39
This file was deleted.

ci/upload_coverage.sh

-11
This file was deleted.

0 commit comments

Comments
 (0)