Skip to content

Commit ef26311

Browse files
author
Matt Roeschke
committed
Merge remote-tracking branch 'upstream/master' into round_ambiguous
2 parents 1c3d193 + 40dfadd commit ef26311

File tree

228 files changed

+6407
-4887
lines changed

Some content is hidden

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

228 files changed

+6407
-4887
lines changed

.coveragerc

-30
This file was deleted.

.travis.yml

+3-7
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,8 @@ matrix:
3030
exclude:
3131
# Exclude the default Python 3.5 build
3232
- python: 3.5
33-
include:
34-
- os: osx
35-
language: generic
36-
env:
37-
- JOB="3.5, OSX" ENV_FILE="ci/travis-35-osx.yaml" TEST_ARGS="--skip-slow --skip-network"
3833

34+
include:
3935
- dist: trusty
4036
env:
4137
- JOB="3.7" ENV_FILE="ci/travis-37.yaml" TEST_ARGS="--skip-slow --skip-network"
@@ -64,7 +60,7 @@ matrix:
6460
# In allow_failures
6561
- dist: trusty
6662
env:
67-
- JOB="3.6, NumPy dev" ENV_FILE="ci/travis-36-numpydev.yaml" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate"
63+
- JOB="3.7, NumPy dev" ENV_FILE="ci/travis-37-numpydev.yaml" TEST_ARGS="--skip-slow --skip-network -W error" PANDAS_TESTING_MODE="deprecate"
6864
addons:
6965
apt:
7066
packages:
@@ -79,7 +75,7 @@ matrix:
7975
- JOB="3.6, slow" ENV_FILE="ci/travis-36-slow.yaml" SLOW=true
8076
- dist: trusty
8177
env:
82-
- JOB="3.6, NumPy dev" ENV_FILE="ci/travis-36-numpydev.yaml" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate"
78+
- JOB="3.7, NumPy dev" ENV_FILE="ci/travis-37-numpydev.yaml" TEST_ARGS="--skip-slow --skip-network -W error" PANDAS_TESTING_MODE="deprecate"
8379
addons:
8480
apt:
8581
packages:

appveyor.yml

-91
This file was deleted.

asv_bench/benchmarks/strings.py

+27-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import warnings
22

33
import numpy as np
4-
from pandas import Series
4+
from pandas import Series, DataFrame
55
import pandas.util.testing as tm
66

77

@@ -12,9 +12,6 @@ class Methods(object):
1212
def setup(self):
1313
self.s = Series(tm.makeStringIndex(10**5))
1414

15-
def time_cat(self):
16-
self.s.str.cat(sep=',')
17-
1815
def time_center(self):
1916
self.s.str.center(100)
2017

@@ -87,6 +84,32 @@ def time_repeat(self, repeats):
8784
self.s.str.repeat(self.repeat)
8885

8986

87+
class Cat(object):
88+
89+
goal_time = 0.2
90+
params = ([0, 3], [None, ','], [None, '-'], [0.0, 0.001, 0.15])
91+
param_names = ['other_cols', 'sep', 'na_rep', 'na_frac']
92+
93+
def setup(self, other_cols, sep, na_rep, na_frac):
94+
N = 10 ** 5
95+
mask_gen = lambda: np.random.choice([True, False], N,
96+
p=[1 - na_frac, na_frac])
97+
self.s = Series(tm.makeStringIndex(N)).where(mask_gen())
98+
if other_cols == 0:
99+
# str.cat self-concatenates only for others=None
100+
self.others = None
101+
else:
102+
self.others = DataFrame({i: tm.makeStringIndex(N).where(mask_gen())
103+
for i in range(other_cols)})
104+
105+
def time_cat(self, other_cols, sep, na_rep, na_frac):
106+
# before the concatenation (one caller + other_cols columns), the total
107+
# expected fraction of rows containing any NaN is:
108+
# reduce(lambda t, _: t + (1 - t) * na_frac, range(other_cols + 1), 0)
109+
# for other_cols=3 and na_frac=0.15, this works out to ~48%
110+
self.s.str.cat(others=self.others, sep=sep, na_rep=na_rep)
111+
112+
90113
class Contains(object):
91114

92115
goal_time = 0.2

azure-pipelines.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Adapted from https://github.com/numba/numba/blob/master/azure-pipelines.yml
2+
jobs:
3+
# Mac and Linux could potentially use the same template
4+
# except it isn't clear how to use a different build matrix
5+
# for each, so for now they are separate
6+
- template: ci/azure/macos.yml
7+
parameters:
8+
name: macOS
9+
vmImage: xcode9-macos10.13
10+
# - template: ci/azure/linux.yml
11+
# parameters:
12+
# name: Linux
13+
# vmImage: ubuntu-16.04
14+
15+
# Windows Python 2.7 needs VC 9.0 installed, and not sure
16+
# how to make that a conditional task, so for now these are
17+
# separate templates as well
18+
- template: ci/azure/windows.yml
19+
parameters:
20+
name: Windows
21+
vmImage: vs2017-win2017
22+
- template: ci/azure/windows-py27.yml
23+
parameters:
24+
name: WindowsPy27
25+
vmImage: vs2017-win2017
File renamed without changes.
File renamed without changes.
File renamed without changes.

ci/azure/macos.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
parameters:
2+
name: ''
3+
vmImage: ''
4+
5+
jobs:
6+
- job: ${{ parameters.name }}
7+
pool:
8+
vmImage: ${{ parameters.vmImage }}
9+
strategy:
10+
maxParallel: 11
11+
matrix:
12+
py35_np_110:
13+
ENV_FILE: ci/azure-macos-35.yml
14+
CONDA_PY: "35"
15+
CONDA_ENV: pandas
16+
TEST_ARGS: "--skip-slow --skip-network"
17+
18+
steps:
19+
- script: |
20+
if [ "$(uname)" == "Linux" ]; then sudo apt-get install -y libc6-dev-i386; fi
21+
echo "Installing Miniconda"
22+
ci/incremental/install_miniconda.sh
23+
export PATH=$HOME/miniconda3/bin:$PATH
24+
echo "Setting up Conda environment"
25+
ci/incremental/setup_conda_environment.sh
26+
displayName: 'Before Install'
27+
- script: |
28+
export PATH=$HOME/miniconda3/bin:$PATH
29+
ci/incremental/build.sh
30+
displayName: 'Build'
31+
- script: |
32+
export PATH=$HOME/miniconda3/bin:$PATH
33+
ci/script_single.sh
34+
ci/script_multi.sh
35+
echo "[Test done]"
36+
displayName: 'Test'
37+
- script: |
38+
export PATH=$HOME/miniconda3/bin:$PATH
39+
source activate pandas && pushd /tmp && python -c "import pandas; pandas.show_versions();" && popd

ci/azure/windows-py27.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
parameters:
2+
name: ''
3+
vmImage: ''
4+
5+
jobs:
6+
- job: ${{ parameters.name }}
7+
pool:
8+
vmImage: ${{ parameters.vmImage }}
9+
strategy:
10+
maxParallel: 11
11+
matrix:
12+
py36_np14:
13+
ENV_FILE: ci/azure-windows-27.yml
14+
CONDA_PY: "27"
15+
CONDA_ENV: pandas
16+
17+
steps:
18+
- task: CondaEnvironment@1
19+
inputs:
20+
updateConda: no
21+
packageSpecs: ''
22+
23+
# Need to install VC 9.0 only for Python 2.7
24+
# Once we understand how to do tasks conditional on build matrix variables
25+
# we could merge this into azure-windows.yml
26+
- powershell: |
27+
$wc = New-Object net.webclient
28+
$wc.Downloadfile("https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi", "VCForPython27.msi")
29+
Start-Process "VCForPython27.msi" /qn -Wait
30+
displayName: 'Install VC 9.0'
31+
32+
- script: |
33+
ci\\incremental\\setup_conda_environment.cmd
34+
displayName: 'Before Install'
35+
- script: |
36+
ci\\incremental\\build.cmd
37+
displayName: 'Build'
38+
- script: |
39+
call activate %CONDA_ENV%
40+
pytest --skip-slow --skip-network pandas -n 2 -r sxX --strict %*
41+
displayName: 'Test'

ci/azure/windows.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
parameters:
2+
name: ''
3+
vmImage: ''
4+
5+
jobs:
6+
- job: ${{ parameters.name }}
7+
pool:
8+
vmImage: ${{ parameters.vmImage }}
9+
strategy:
10+
maxParallel: 11
11+
matrix:
12+
py36_np14:
13+
ENV_FILE: ci/azure-windows-36.yml
14+
CONDA_PY: "36"
15+
CONDA_ENV: pandas
16+
17+
steps:
18+
- task: CondaEnvironment@1
19+
inputs:
20+
updateConda: no
21+
packageSpecs: ''
22+
23+
- script: |
24+
ci\\incremental\\setup_conda_environment.cmd
25+
displayName: 'Before Install'
26+
- script: |
27+
ci\\incremental\\build.cmd
28+
displayName: 'Build'
29+
- script: |
30+
call activate %CONDA_ENV%
31+
pytest --skip-slow --skip-network pandas -n 2 -r sxX --strict %*
32+
displayName: 'Test'

ci/doctests.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@ if [ "$DOCTEST" ]; then
2121

2222
# DataFrame / Series docstrings
2323
pytest --doctest-modules -v pandas/core/frame.py \
24-
-k"-assign -axes -combine -isin -itertuples -join -nlargest -nsmallest -nunique -pivot_table -quantile -query -reindex -reindex_axis -replace -round -set_index -stack -to_dict -to_stata -transform"
24+
-k"-assign -axes -combine -isin -itertuples -join -nlargest -nsmallest -nunique -pivot_table -quantile -query -reindex -reindex_axis -replace -round -set_index -stack -to_dict -to_stata"
2525

2626
if [ $? -ne "0" ]; then
2727
RET=1
2828
fi
2929

3030
pytest --doctest-modules -v pandas/core/series.py \
31-
-k"-nlargest -nonzero -nsmallest -reindex -searchsorted -to_dict"
31+
-k"-nonzero -reindex -searchsorted -to_dict"
3232

3333
if [ $? -ne "0" ]; then
3434
RET=1
3535
fi
3636

3737
pytest --doctest-modules -v pandas/core/generic.py \
38-
-k"-_set_axis_name -_xs -describe -droplevel -groupby -interpolate -pct_change -pipe -reindex -reindex_axis -resample -sample -to_json -to_xarray -transform -transpose -values -xs"
38+
-k"-_set_axis_name -_xs -describe -droplevel -groupby -interpolate -pct_change -pipe -reindex -reindex_axis -resample -sample -to_json -transpose -values -xs"
3939

4040
if [ $? -ne "0" ]; then
4141
RET=1

ci/incremental/build.cmd

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@rem https://github.com/numba/numba/blob/master/buildscripts/incremental/build.cmd
2+
call activate %CONDA_ENV%
3+
4+
@rem Build numba extensions without silencing compile errors
5+
python setup.py build_ext -q --inplace
6+
7+
@rem Install pandas locally
8+
python -m pip install -e .
9+
10+
if %errorlevel% neq 0 exit /b %errorlevel%

0 commit comments

Comments
 (0)