Skip to content

Commit 6c88a0b

Browse files
committed
Merge remote-tracking branch 'upstream/master' into conda-4.7.1
2 parents 418351d + a60888c commit 6c88a0b

File tree

197 files changed

+8754
-7299
lines changed

Some content is hidden

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

197 files changed

+8754
-7299
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
custom: https://pandas.pydata.org/donate.html

.travis.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,5 @@ script:
103103
after_script:
104104
- echo "after_script start"
105105
- source activate pandas-dev && pushd /tmp && python -c "import pandas; pandas.show_versions();" && popd
106-
- if [ -e test-data-single.xml ]; then
107-
ci/print_skipped.py test-data-single.xml;
108-
fi
109-
- if [ -e test-data-multiple.xml ]; then
110-
ci/print_skipped.py test-data-multiple.xml;
111-
fi
106+
- ci/print_skipped.py
112107
- echo "after_script done"

asv_bench/asv.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
// `asv` will cache wheels of the recent builds in each
108108
// environment, making them faster to install next time. This is
109109
// number of builds to keep, per environment.
110-
"wheel_cache_size": 8,
110+
"build_cache_size": 8,
111111

112112
// The commits after which the regression search in `asv publish`
113113
// should start looking for regressions. Dictionary whose keys are

asv_bench/benchmarks/index_object.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ def time_is_dates_only(self):
5252

5353
class Ops:
5454

55-
sample_time = 0.2
5655
params = ['float', 'int']
5756
param_names = ['dtype']
5857

@@ -95,6 +94,12 @@ def time_min(self):
9594
def time_min_trivial(self):
9695
self.idx_inc.min()
9796

97+
def time_get_loc_inc(self):
98+
self.idx_inc.get_loc(900000)
99+
100+
def time_get_loc_dec(self):
101+
self.idx_dec.get_loc(100000)
102+
98103

99104
class IndexAppend:
100105

@@ -183,19 +188,34 @@ def time_get_loc(self):
183188

184189
class IntervalIndexMethod:
185190
# GH 24813
186-
params = [10**3, 10**5, 10**7]
191+
params = [10**3, 10**5]
187192

188193
def setup(self, N):
189194
left = np.append(np.arange(N), np.array(0))
190195
right = np.append(np.arange(1, N + 1), np.array(1))
191196
self.intv = IntervalIndex.from_arrays(left, right)
192197
self.intv._engine
193198

199+
self.intv2 = IntervalIndex.from_arrays(left + 1, right + 1)
200+
self.intv2._engine
201+
202+
self.left = IntervalIndex.from_breaks(np.arange(N))
203+
self.right = IntervalIndex.from_breaks(np.arange(N - 3, 2 * N - 3))
204+
194205
def time_monotonic_inc(self, N):
195206
self.intv.is_monotonic_increasing
196207

197208
def time_is_unique(self, N):
198209
self.intv.is_unique
199210

211+
def time_intersection(self, N):
212+
self.left.intersection(self.right)
213+
214+
def time_intersection_one_duplicate(self, N):
215+
self.intv.intersection(self.right)
216+
217+
def time_intersection_both_duplicate(self, N):
218+
self.intv.intersection(self.intv2)
219+
200220

201221
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/multiindex_object.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import numpy as np
44
import pandas.util.testing as tm
5-
from pandas import date_range, MultiIndex
5+
from pandas import date_range, MultiIndex, DataFrame
66

77

88
class GetLoc:
@@ -126,4 +126,18 @@ def time_datetime_level_values_sliced(self, mi):
126126
mi[:10].values
127127

128128

129+
class CategoricalLevel:
130+
131+
def setup(self):
132+
133+
self.df = DataFrame({
134+
'a': np.arange(1_000_000, dtype=np.int32),
135+
'b': np.arange(1_000_000, dtype=np.int64),
136+
'c': np.arange(1_000_000, dtype=float),
137+
}).astype({'a': 'category', 'b': 'category'})
138+
139+
def time_categorical_level(self):
140+
self.df.set_index(['a', 'b'])
141+
142+
129143
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/rolling.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
class Methods:
66

7-
sample_time = 0.2
87
params = (['DataFrame', 'Series'],
98
[10, 1000],
109
['int', 'float'],
@@ -23,7 +22,6 @@ def time_rolling(self, constructor, window, dtype, method):
2322

2423
class ExpandingMethods:
2524

26-
sample_time = 0.2
2725
params = (['DataFrame', 'Series'],
2826
['int', 'float'],
2927
['median', 'mean', 'max', 'min', 'std', 'count', 'skew', 'kurt',
@@ -41,7 +39,6 @@ def time_expanding(self, constructor, dtype, method):
4139

4240
class EWMMethods:
4341

44-
sample_time = 0.2
4542
params = (['DataFrame', 'Series'],
4643
[10, 1000],
4744
['int', 'float'],
@@ -58,7 +55,6 @@ def time_ewm(self, constructor, window, dtype, method):
5855

5956

6057
class VariableWindowMethods(Methods):
61-
sample_time = 0.2
6258
params = (['DataFrame', 'Series'],
6359
['50s', '1h', '1d'],
6460
['int', 'float'],
@@ -75,7 +71,6 @@ def setup(self, constructor, window, dtype, method):
7571

7672
class Pairwise:
7773

78-
sample_time = 0.2
7974
params = ([10, 1000, None],
8075
['corr', 'cov'],
8176
[True, False])
@@ -95,7 +90,6 @@ def time_pairwise(self, window, method, pairwise):
9590

9691

9792
class Quantile:
98-
sample_time = 0.2
9993
params = (['DataFrame', 'Series'],
10094
[10, 1000],
10195
['int', 'float'],

asv_bench/benchmarks/timeseries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from pandas import to_datetime, date_range, Series, DataFrame, period_range
66
from pandas.tseries.frequencies import infer_freq
77
try:
8-
from pandas.plotting._converter import DatetimeConverter
8+
from pandas.plotting._matplotlib.converter import DatetimeConverter
99
except ImportError:
1010
from pandas.tseries.converter import DatetimeConverter
1111

azure-pipelines.yml

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
name: Windows
1616
vmImage: vs2017-win2016
1717

18-
- job: 'Checks_and_doc'
18+
- job: 'Checks'
1919
pool:
2020
vmImage: ubuntu-16.04
2121
timeoutInMinutes: 90
@@ -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'))

ci/azure/posix.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,9 @@ jobs:
8989
# note that this will produce $LASTEXITCODE=1
9090
Write-Error "$($matches[1]) tests failed"
9191
}
92-
displayName: Check for test failures
92+
displayName: 'Check for test failures'
93+
- script: |
94+
export PATH=$HOME/miniconda3/bin:$PATH
95+
source activate pandas-dev
96+
python ci/print_skipped.py
97+
displayName: 'Print skipped tests'

ci/azure/windows.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ jobs:
1818

1919
steps:
2020
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
21-
displayName: Add conda to PATH
21+
displayName: 'Add conda to PATH'
2222
- script: conda install -c conda-canary conda
2323
displayName: Update conda
24-
- script: |
25-
call activate
26-
conda env create -q --file ci\\deps\\azure-windows-$(CONDA_PY).yaml
27-
displayName: Create anaconda environment
24+
- script: conda env create -q --file ci\\deps\\azure-windows-$(CONDA_PY).yaml
25+
displayName: 'Create anaconda environment'
2826
- script: |
2927
call activate pandas-dev
3028
call conda list
@@ -50,4 +48,9 @@ jobs:
5048
# note that this will produce $LASTEXITCODE=1
5149
Write-Error "$($matches[1]) tests failed"
5250
}
53-
displayName: Check for test failures
51+
displayName: 'Check for test failures'
52+
- script: |
53+
export PATH=$HOME/miniconda3/bin:$PATH
54+
source activate pandas-dev
55+
python ci/print_skipped.py
56+
displayName: 'Print skipped tests'

ci/deps/azure-35-compat.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,27 @@ channels:
44
- conda-forge
55
- free
66
dependencies:
7-
- beautifulsoup4=4.4.1
7+
- beautifulsoup4=4.6.0
88
- bottleneck=1.2.1
99
- jinja2=2.8
1010
- numexpr=2.6.2
1111
- numpy=1.13.3
12-
- openpyxl=2.4.0
12+
- openpyxl=2.4.8
1313
- pytables=3.4.2
14-
- python-dateutil=2.5.0
14+
- python-dateutil=2.6.1
1515
- python=3.5.*
16-
- pytz=2015.4
16+
- pytz=2017.2
1717
- scipy=0.19.0
18-
- xlrd=1.0.0
19-
- xlsxwriter=0.7.7
20-
- xlwt=1.0.0
18+
- xlrd=1.1.0
19+
- xlsxwriter=0.9.8
20+
- xlwt=1.2.0
2121
# universal
2222
- cython=0.28.2
2323
- hypothesis>=3.58.0
2424
- pytest-xdist
2525
- pytest-mock
26-
- isort
2726
- pip
2827
- pip:
2928
# for python 3.5, pytest>=4.0.2 is not available in conda
30-
- pytest>=4.0.2
29+
- pytest==4.5.0
3130
- html5lib==1.0b2

ci/deps/azure-36-locale.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,27 @@ channels:
33
- defaults
44
- conda-forge
55
dependencies:
6-
- beautifulsoup4==4.5.1
6+
- beautifulsoup4==4.6.0
77
- bottleneck=1.2.*
88
- cython=0.28.2
99
- lxml
1010
- matplotlib=2.2.2
1111
- numpy=1.14.*
12-
- openpyxl=2.4.0
12+
- openpyxl=2.4.8
1313
- python-dateutil
1414
- python-blosc
1515
- python=3.6.*
16-
- pytz=2016.10
16+
- pytz=2017.2
1717
- scipy
1818
- sqlalchemy=1.1.4
19-
- xlrd=1.0.0
20-
- xlsxwriter=0.9.4
19+
- xlrd=1.1.0
20+
- xlsxwriter=0.9.8
2121
- xlwt=1.2.0
2222
# universal
2323
- pytest>=4.0.2
2424
- pytest-xdist
2525
- pytest-mock
2626
- hypothesis>=3.58.0
27-
- isort
2827
- pip
2928
- pip:
3029
- html5lib==1.0b2

ci/deps/azure-36-locale_slow.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ dependencies:
3030
- pytest-xdist
3131
- pytest-mock
3232
- moto
33-
- isort
3433
- pip
3534
- pip:
3635
- hypothesis>=3.58.0

ci/deps/azure-37-locale.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ dependencies:
2828
- pytest>=4.0.2
2929
- pytest-xdist
3030
- pytest-mock
31-
- isort
3231
- pip
3332
- pip:
3433
- hypothesis>=3.58.0

ci/deps/azure-37-numpydev.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ dependencies:
1010
- pytest-xdist
1111
- pytest-mock
1212
- hypothesis>=3.58.0
13-
- isort
1413
- pip
1514
- pip:
1615
- "git+git://github.com/dateutil/dateutil.git"

0 commit comments

Comments
 (0)