Skip to content

Commit 0e60770

Browse files
committed
merge with master again
2 parents 0752e59 + b7294dd commit 0e60770

File tree

639 files changed

+31935
-24134
lines changed

Some content is hidden

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

639 files changed

+31935
-24134
lines changed

.circleci/config.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
version: 2
22
jobs:
3-
4-
# --------------------------------------------------------------------------
5-
# 1. py36_locale
6-
# --------------------------------------------------------------------------
7-
py36_locale:
3+
build:
84
docker:
95
- image: continuumio/miniconda:latest
106
# databases configuration
@@ -21,7 +17,7 @@ jobs:
2117

2218
environment:
2319
JOB: "3.6_LOCALE"
24-
ENV_FILE: "ci/circle-36-locale.yaml"
20+
ENV_FILE: "ci/deps/circle-36-locale.yaml"
2521
LOCALE_OVERRIDE: "zh_CN.UTF-8"
2622
MINICONDA_DIR: /home/ubuntu/miniconda3
2723
steps:
@@ -30,13 +26,13 @@ jobs:
3026
name: build
3127
command: |
3228
./ci/circle/install_circle.sh
33-
./ci/circle/show_circle.sh
29+
export PATH="$MINICONDA_DIR/bin:$PATH"
30+
source activate pandas-dev
31+
python -c "import pandas; pandas.show_versions();"
3432
- run:
3533
name: test
36-
command: ./ci/circle/run_circle.sh --skip-slow --skip-network
37-
38-
workflows:
39-
version: 2
40-
build_and_test:
41-
jobs:
42-
- py36_locale
34+
command: |
35+
export PATH="$MINICONDA_DIR/bin:$PATH"
36+
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

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,5 @@ doc/build/html/index.html
109109
# Windows specific leftover:
110110
doc/tmp.sv
111111
doc/source/styled.xlsx
112-
doc/source/templates/
113112
env/
114113
doc/source/savefig/

.pep8speaks.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ pycodestyle:
1313
- W503, # line break before binary operator
1414
- W504, # line break after binary operator
1515
- E402, # module level import not at top of file
16-
- E722, # do not use bare except
1716
- E731, # do not assign a lambda expression, use a def
1817
- C406, # Unnecessary list literal - rewrite as a dict literal.
1918
- C408, # Unnecessary dict call - rewrite as a literal.

.travis.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env:
2323

2424
git:
2525
# for cloning
26-
depth: 1000
26+
depth: 1500
2727

2828
matrix:
2929
fast_finish: true
@@ -34,28 +34,28 @@ matrix:
3434
include:
3535
- dist: trusty
3636
env:
37-
- JOB="3.7" ENV_FILE="ci/travis-37.yaml" TEST_ARGS="--skip-slow --skip-network"
37+
- JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" TEST_ARGS="--skip-slow --skip-network"
3838

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

6969
# In allow_failures
7070
- dist: trusty
7171
env:
72-
- JOB="3.6, doc" ENV_FILE="ci/travis-36-doc.yaml" DOC=true
72+
- JOB="3.6, doc" ENV_FILE="ci/deps/travis-36-doc.yaml" DOC=true
7373
allow_failures:
7474
- dist: trusty
7575
env:
76-
- JOB="3.6, slow" ENV_FILE="ci/travis-36-slow.yaml" SLOW=true
76+
- JOB="3.6, slow" ENV_FILE="ci/deps/travis-36-slow.yaml" SLOW=true
7777
- dist: trusty
7878
env:
79-
- JOB="3.6, doc" ENV_FILE="ci/travis-36-doc.yaml" DOC=true
79+
- JOB="3.6, doc" ENV_FILE="ci/deps/travis-36-doc.yaml" DOC=true
8080

8181
before_install:
8282
- echo "before_install"
@@ -105,6 +105,7 @@ before_script:
105105

106106
script:
107107
- echo "script start"
108+
- source activate pandas-dev
108109
- ci/run_build_docs.sh
109110
- ci/script_single.sh
110111
- ci/script_multi.sh
@@ -115,7 +116,7 @@ after_success:
115116

116117
after_script:
117118
- echo "after_script start"
118-
- source activate pandas && pushd /tmp && python -c "import pandas; pandas.show_versions();" && popd
119+
- source activate pandas-dev && pushd /tmp && python -c "import pandas; pandas.show_versions();" && popd
119120
- if [ -e test-data-single.xml ]; then
120121
ci/print_skipped.py test-data-single.xml;
121122
fi

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ build: clean_pyc
1313
python setup.py build_ext --inplace
1414

1515
lint-diff:
16-
git diff master --name-only -- "*.py" | grep -E "pandas|scripts" | xargs flake8
16+
git diff upstream/master --name-only -- "*.py" | xargs flake8
1717

1818
develop: build
1919
-python setup.py develop

asv_bench/benchmarks/reshape.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,33 @@ def time_unstack(self):
4949

5050
class Unstack(object):
5151

52-
def setup(self):
52+
params = ['int', 'category']
53+
54+
def setup(self, dtype):
5355
m = 100
5456
n = 1000
5557

5658
levels = np.arange(m)
5759
index = MultiIndex.from_product([levels] * 2)
5860
columns = np.arange(n)
59-
values = np.arange(m * m * n).reshape(m * m, n)
61+
if dtype == 'int':
62+
values = np.arange(m * m * n).reshape(m * m, n)
63+
else:
64+
# the category branch is ~20x slower than int. So we
65+
# cut down the size a bit. Now it's only ~3x slower.
66+
n = 50
67+
columns = columns[:n]
68+
indices = np.random.randint(0, 52, size=(m * m, n))
69+
values = np.take(list(string.ascii_letters), indices)
70+
values = [pd.Categorical(v) for v in values.T]
71+
6072
self.df = DataFrame(values, index, columns)
6173
self.df2 = self.df.iloc[:-1]
6274

63-
def time_full_product(self):
75+
def time_full_product(self, dtype):
6476
self.df.unstack()
6577

66-
def time_without_last_row(self):
78+
def time_without_last_row(self, dtype):
6779
self.df2.unstack()
6880

6981

asv_bench/benchmarks/timeseries.py

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from datetime import timedelta
22

3+
import dateutil
34
import numpy as np
45
from pandas import to_datetime, date_range, Series, DataFrame, period_range
56
from pandas.tseries.frequencies import infer_freq
@@ -57,7 +58,10 @@ def time_to_pydatetime(self, index_type):
5758

5859
class TzLocalize(object):
5960

60-
def setup(self):
61+
params = [None, 'US/Eastern', 'UTC', dateutil.tz.tzutc()]
62+
param_names = 'tz'
63+
64+
def setup(self, tz):
6165
dst_rng = date_range(start='10/29/2000 1:00:00',
6266
end='10/29/2000 1:59:59', freq='S')
6367
self.index = date_range(start='10/29/2000',
@@ -68,8 +72,8 @@ def setup(self):
6872
end='10/29/2000 3:00:00',
6973
freq='S'))
7074

71-
def time_infer_dst(self):
72-
self.index.tz_localize('US/Eastern', ambiguous='infer')
75+
def time_infer_dst(self, tz):
76+
self.index.tz_localize(tz, ambiguous='infer')
7377

7478

7579
class ResetIndex(object):
@@ -377,15 +381,35 @@ def time_dup_string_tzoffset_dates(self, cache):
377381

378382
class DatetimeAccessor(object):
379383

380-
def setup(self):
384+
params = [None, 'US/Eastern', 'UTC', dateutil.tz.tzutc()]
385+
param_names = 'tz'
386+
387+
def setup(self, tz):
381388
N = 100000
382-
self.series = Series(date_range(start='1/1/2000', periods=N, freq='T'))
389+
self.series = Series(
390+
date_range(start='1/1/2000', periods=N, freq='T', tz=tz)
391+
)
383392

384-
def time_dt_accessor(self):
393+
def time_dt_accessor(self, tz):
385394
self.series.dt
386395

387-
def time_dt_accessor_normalize(self):
396+
def time_dt_accessor_normalize(self, tz):
388397
self.series.dt.normalize()
389398

399+
def time_dt_accessor_month_name(self, tz):
400+
self.series.dt.month_name()
401+
402+
def time_dt_accessor_day_name(self, tz):
403+
self.series.dt.day_name()
404+
405+
def time_dt_accessor_time(self, tz):
406+
self.series.dt.time
407+
408+
def time_dt_accessor_date(self, tz):
409+
self.series.dt.date
410+
411+
def time_dt_accessor_year(self, tz):
412+
self.series.dt.year
413+
390414

391415
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/timestamp.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from pandas import Timestamp
44
import pytz
5+
import dateutil
56

67

78
class TimestampConstruction(object):
@@ -29,7 +30,8 @@ def time_fromtimestamp(self):
2930

3031

3132
class TimestampProperties(object):
32-
_tzs = [None, pytz.timezone('Europe/Amsterdam')]
33+
_tzs = [None, pytz.timezone('Europe/Amsterdam'), pytz.UTC,
34+
dateutil.tz.tzutc()]
3335
_freqs = [None, 'B']
3436
params = [_tzs, _freqs]
3537
param_names = ['tz', 'freq']
@@ -87,7 +89,8 @@ def time_microsecond(self, tz, freq):
8789

8890

8991
class TimestampOps(object):
90-
params = [None, 'US/Eastern']
92+
params = [None, 'US/Eastern', pytz.UTC,
93+
dateutil.tz.tzutc()]
9194
param_names = ['tz']
9295

9396
def setup(self, tz):
@@ -102,6 +105,17 @@ def time_replace_None(self, tz):
102105
def time_to_pydatetime(self, tz):
103106
self.ts.to_pydatetime()
104107

108+
def time_normalize(self, tz):
109+
self.ts.normalize()
110+
111+
def time_tz_convert(self, tz):
112+
if self.ts.tz is not None:
113+
self.ts.tz_convert(tz)
114+
115+
def time_tz_localize(self, tz):
116+
if self.ts.tz is None:
117+
self.ts.tz_localize(tz)
118+
105119

106120
class TimestampAcrossDst(object):
107121
def setup(self):

ci/azure/linux.yml

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,21 @@ jobs:
1010
maxParallel: 11
1111
matrix:
1212
py27_np_19:
13-
ENV_FILE: ci/azure-27-compat.yaml
13+
ENV_FILE: ci/deps/azure-27-compat.yaml
1414
CONDA_PY: "27"
15-
CONDA_ENV: pandas
1615
TEST_ARGS: "--skip-slow --skip-network"
1716

18-
py36_locale:
19-
ENV_FILE: ci/azure-37-locale.yaml
17+
py37_locale:
18+
ENV_FILE: ci/deps/azure-37-locale.yaml
2019
CONDA_PY: "37"
21-
CONDA_ENV: pandas
2220
TEST_ARGS: "--skip-slow --skip-network"
2321
LOCALE_OVERRIDE: "zh_CN.UTF-8"
2422

2523
py36_locale_slow:
26-
ENV_FILE: ci/azure-36-locale_slow.yaml
24+
ENV_FILE: ci/deps/azure-36-locale_slow.yaml
2725
CONDA_PY: "36"
28-
CONDA_ENV: pandas
2926
TEST_ARGS: "--only-slow --skip-network"
27+
LOCALE_OVERRIDE: "it_IT.UTF-8"
3028

3129
steps:
3230
- script: |
@@ -39,18 +37,45 @@ jobs:
3937
displayName: 'Before Install'
4038
- script: |
4139
export PATH=$HOME/miniconda3/bin:$PATH
40+
source activate pandas-dev
4241
ci/incremental/build.sh
4342
displayName: 'Build'
4443
- script: |
4544
export PATH=$HOME/miniconda3/bin:$PATH
45+
source activate pandas-dev
4646
ci/script_single.sh
4747
ci/script_multi.sh
4848
echo "[Test done]"
4949
displayName: 'Test'
5050
- script: |
5151
export PATH=$HOME/miniconda3/bin:$PATH
52-
source activate pandas && pushd /tmp && python -c "import pandas; pandas.show_versions();" && popd
52+
source activate pandas-dev && pushd /tmp && python -c "import pandas; pandas.show_versions();" && popd
5353
- task: PublishTestResults@2
5454
inputs:
5555
testResultsFiles: 'test-data-*.xml'
56-
testRunTitle: 'Linux'
56+
testRunTitle: 'Linux'
57+
- powershell: |
58+
$junitXml = "test-data-single.xml"
59+
$(Get-Content $junitXml | Out-String) -match 'failures="(.*?)"'
60+
if ($matches[1] -eq 0)
61+
{
62+
Write-Host "No test failures in test-data-single"
63+
}
64+
else
65+
{
66+
# note that this will produce $LASTEXITCODE=1
67+
Write-Error "$($matches[1]) tests failed"
68+
}
69+
70+
$junitXmlMulti = "test-data-multiple.xml"
71+
$(Get-Content $junitXmlMulti | Out-String) -match 'failures="(.*?)"'
72+
if ($matches[1] -eq 0)
73+
{
74+
Write-Host "No test failures in test-data-multi"
75+
}
76+
else
77+
{
78+
# note that this will produce $LASTEXITCODE=1
79+
Write-Error "$($matches[1]) tests failed"
80+
}
81+
displayName: Check for test failures

0 commit comments

Comments
 (0)