Skip to content

Commit 13b73a6

Browse files
committed
Merge branch 'master' into feature/groupby-repr-ellipses-1135
2 parents b60329c + 7721f70 commit 13b73a6

File tree

436 files changed

+4887
-6301
lines changed

Some content is hidden

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

436 files changed

+4887
-6301
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ dist
6161
.coverage
6262
coverage.xml
6363
coverage_html_report
64+
.mypy_cache
6465
*.pytest_cache
6566
# hypothesis test database
6667
.hypothesis/

.travis.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
sudo: false
22
language: python
3-
# Default Python version is usually 2.7
43
python: 3.5
54

65
# To turn off cached cython files and compiler cache
@@ -36,21 +35,13 @@ matrix:
3635
env:
3736
- JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" PATTERN="(not slow and not network)"
3837

39-
- dist: trusty
40-
env:
41-
- JOB="2.7" ENV_FILE="ci/deps/travis-27.yaml" PATTERN="(not slow or (single and db))"
42-
addons:
43-
apt:
44-
packages:
45-
- python-gtk2
46-
4738
- dist: trusty
4839
env:
4940
- 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"
5041

5142
- dist: trusty
5243
env:
53-
- JOB="3.6, coverage" ENV_FILE="ci/deps/travis-36.yaml" PATTERN="((not slow and not network) or (single and db))" PANDAS_TESTING_MODE="deprecate" COVERAGE=true
44+
- 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
5445

5546
# In allow_failures
5647
- dist: trusty

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ pip install pandas
164164
```
165165

166166
## Dependencies
167-
- [NumPy](https://www.numpy.org): 1.12.0 or higher
167+
- [NumPy](https://www.numpy.org): 1.13.3 or higher
168168
- [python-dateutil](https://labix.org/python-dateutil): 2.5.0 or higher
169-
- [pytz](https://pythonhosted.org/pytz): 2011k or higher
169+
- [pytz](https://pythonhosted.org/pytz): 2015.4 or higher
170170

171171
See the [full installation instructions](https://pandas.pydata.org/pandas-docs/stable/install.html#dependencies)
172172
for recommended and optional dependencies.

asv_bench/benchmarks/io/stata.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ class Stata(BaseIO):
1212

1313
def setup(self, convert_dates):
1414
self.fname = '__test__.dta'
15-
N = 100000
16-
C = 5
15+
N = self.N = 100000
16+
C = self.C = 5
1717
self.df = DataFrame(np.random.randn(N, C),
1818
columns=['float{}'.format(i) for i in range(C)],
1919
index=date_range('20000101', periods=N, freq='H'))
20-
self.df['object'] = tm.makeStringIndex(N)
20+
self.df['object'] = tm.makeStringIndex(self.N)
2121
self.df['int8_'] = np.random.randint(np.iinfo(np.int8).min,
2222
np.iinfo(np.int8).max - 27, N)
2323
self.df['int16_'] = np.random.randint(np.iinfo(np.int16).min,
@@ -36,4 +36,14 @@ def time_write_stata(self, convert_dates):
3636
self.df.to_stata(self.fname, self.convert_dates)
3737

3838

39+
class StataMissing(Stata):
40+
def setup(self, convert_dates):
41+
super(StataMissing, self).setup(convert_dates)
42+
for i in range(10):
43+
missing_data = np.random.randn(self.N)
44+
missing_data[missing_data < 0] = np.nan
45+
self.df['missing_{0}'.format(i)] = missing_data
46+
self.df.to_stata(self.fname, self.convert_dates)
47+
48+
3949
from ..pandas_vb_common import setup # noqa: F401

azure-pipelines.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ jobs:
1010
name: Linux
1111
vmImage: ubuntu-16.04
1212

13-
# Windows Python 2.7 needs VC 9.0 installed, handled in the template
1413
- template: ci/azure/windows.yml
1514
parameters:
1615
name: Windows
@@ -89,6 +88,13 @@ jobs:
8988
displayName: 'Docstring validation'
9089
condition: true
9190
91+
- script: |
92+
export PATH=$HOME/miniconda3/bin:$PATH
93+
source activate pandas-dev
94+
ci/code_checks.sh typing
95+
displayName: 'Typing validation'
96+
condition: true
97+
9298
- script: |
9399
export PATH=$HOME/miniconda3/bin:$PATH
94100
source activate pandas-dev

ci/azure/posix.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ jobs:
99
strategy:
1010
matrix:
1111
${{ if eq(parameters.name, 'macOS') }}:
12-
py35_np_120:
12+
py35_macos:
1313
ENV_FILE: ci/deps/azure-macos-35.yaml
1414
CONDA_PY: "35"
1515
PATTERN: "not slow and not network"
1616

1717
${{ if eq(parameters.name, 'Linux') }}:
18-
py27_np_120:
19-
ENV_FILE: ci/deps/azure-27-compat.yaml
20-
CONDA_PY: "27"
18+
py35_compat:
19+
ENV_FILE: ci/deps/azure-35-compat.yaml
20+
CONDA_PY: "35"
2121
PATTERN: "not slow and not network"
2222

23-
py27_locale_slow_old_np:
24-
ENV_FILE: ci/deps/azure-27-locale.yaml
25-
CONDA_PY: "27"
23+
py36_locale_slow_old_np:
24+
ENV_FILE: ci/deps/azure-36-locale.yaml
25+
CONDA_PY: "36"
2626
PATTERN: "slow"
2727
LOCALE_OVERRIDE: "zh_CN.UTF-8"
2828
EXTRA_APT: "language-pack-zh-hans"

ci/azure/windows.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,20 @@ jobs:
88
vmImage: ${{ parameters.vmImage }}
99
strategy:
1010
matrix:
11-
py36_np14:
11+
py36_np15:
1212
ENV_FILE: ci/deps/azure-windows-36.yaml
1313
CONDA_PY: "36"
1414

15-
py27_np121:
16-
ENV_FILE: ci/deps/azure-windows-27.yaml
17-
CONDA_PY: "27"
15+
py37_np141:
16+
ENV_FILE: ci/deps/azure-windows-37.yaml
17+
CONDA_PY: "37"
1818

1919
steps:
2020
- task: CondaEnvironment@1
2121
inputs:
2222
updateConda: no
2323
packageSpecs: ''
2424

25-
- powershell: |
26-
$wc = New-Object net.webclient
27-
$wc.Downloadfile("https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi", "VCForPython27.msi")
28-
Start-Process "VCForPython27.msi" /qn -Wait
29-
displayName: 'Install VC 9.0 only for Python 2.7'
30-
condition: eq(variables.CONDA_PY, '27')
31-
3225
- script: |
3326
ci\\incremental\\setup_conda_environment.cmd
3427
displayName: 'Before Install'

ci/code_checks.sh

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
# $ ./ci/code_checks.sh doctests # run doctests
1717
# $ ./ci/code_checks.sh docstrings # validate docstring errors
1818
# $ ./ci/code_checks.sh dependencies # check that dependencies are consistent
19+
# $ ./ci/code_checks.sh typing # run static type analysis
1920

20-
[[ -z "$1" || "$1" == "lint" || "$1" == "patterns" || "$1" == "code" || "$1" == "doctests" || "$1" == "docstrings" || "$1" == "dependencies" ]] || \
21-
{ echo "Unknown command $1. Usage: $0 [lint|patterns|code|doctests|docstrings|dependencies]"; exit 9999; }
21+
[[ -z "$1" || "$1" == "lint" || "$1" == "patterns" || "$1" == "code" || "$1" == "doctests" || "$1" == "docstrings" || "$1" == "dependencies" || "$1" == "typing" ]] || \
22+
{ echo "Unknown command $1. Usage: $0 [lint|patterns|code|doctests|docstrings|dependencies|typing]"; exit 9999; }
2223

2324
BASE_DIR="$(dirname $0)/.."
2425
RET=0
@@ -119,6 +120,10 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
119120
invgrep -r -E --include '*.py' 'pytest\.warns' pandas/tests/
120121
RET=$(($RET + $?)) ; echo $MSG "DONE"
121122

123+
MSG='Check for pytest raises without context' ; echo $MSG
124+
invgrep -r -E --include '*.py' "[[:space:]] pytest.raises" pandas/tests/
125+
RET=$(($RET + $?)) ; echo $MSG "DONE"
126+
122127
# Check for the following code in testing: `np.testing` and `np.array_equal`
123128
MSG='Check for invalid testing' ; echo $MSG
124129
invgrep -r -E --include '*.py' --exclude testing.py '(numpy|np)(\.testing|\.array_equal)' pandas/tests/
@@ -175,9 +180,9 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
175180
set -o pipefail
176181
if [[ "$AZURE" == "true" ]]; then
177182
# we exclude all c/cpp files as the c/cpp files of pandas code base are tested when Linting .c and .h files
178-
! grep -n '--exclude=*.'{svg,c,cpp,html} -RI "\s$" * | awk -F ":" '{print "##vso[task.logissue type=error;sourcepath=" $1 ";linenumber=" $2 ";] Tailing whitespaces found: " $3}'
183+
! grep -n '--exclude=*.'{svg,c,cpp,html} --exclude-dir=env -RI "\s$" * | awk -F ":" '{print "##vso[task.logissue type=error;sourcepath=" $1 ";linenumber=" $2 ";] Tailing whitespaces found: " $3}'
179184
else
180-
! grep -n '--exclude=*.'{svg,c,cpp,html} -RI "\s$" * | awk -F ":" '{print $1 ":" $2 ":Tailing whitespaces found: " $3}'
185+
! grep -n '--exclude=*.'{svg,c,cpp,html} --exclude-dir=env -RI "\s$" * | awk -F ":" '{print $1 ":" $2 ":Tailing whitespaces found: " $3}'
181186
fi
182187
RET=$(($RET + $?)) ; echo $MSG "DONE"
183188
fi
@@ -256,4 +261,16 @@ if [[ -z "$CHECK" || "$CHECK" == "dependencies" ]]; then
256261

257262
fi
258263

264+
### TYPING ###
265+
if [[ -z "$CHECK" || "$CHECK" == "typing" ]]; then
266+
267+
echo "mypy --version"
268+
mypy --version
269+
270+
MSG='Performing static analysis using mypy' ; echo $MSG
271+
mypy pandas
272+
RET=$(($RET + $?)) ; echo $MSG "DONE"
273+
fi
274+
275+
259276
exit $RET

ci/deps/azure-27-compat.yaml

Lines changed: 0 additions & 28 deletions
This file was deleted.

ci/deps/azure-35-compat.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: pandas-dev
2+
channels:
3+
- defaults
4+
- conda-forge
5+
dependencies:
6+
- beautifulsoup4=4.4.1
7+
- bottleneck=1.2.1
8+
- jinja2=2.8
9+
- numexpr=2.6.2
10+
- numpy=1.13.3
11+
- openpyxl=2.4.0
12+
- pytables=3.4.2
13+
- python-dateutil=2.5.0
14+
- python=3.5.*
15+
- pytz=2015.4
16+
- scipy=0.19.0
17+
- xlrd=1.0.0
18+
- xlsxwriter=0.7.7
19+
- xlwt=1.0.0
20+
# universal
21+
- cython=0.28.2
22+
- hypothesis>=3.58.0
23+
- pytest-xdist
24+
- pytest-mock
25+
- isort
26+
- pip:
27+
# for python 3.5, pytest>=4.0.2 is not available in conda
28+
- pytest>=4.0.2
29+
- html5lib==1.0b2

ci/deps/azure-27-locale.yaml renamed to ci/deps/azure-36-locale.yaml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ channels:
33
- defaults
44
- conda-forge
55
dependencies:
6-
- bottleneck=1.2.0
6+
- beautifulsoup4==4.5.1
7+
- bottleneck=1.2.*
78
- cython=0.28.2
89
- lxml
9-
- matplotlib=2.0.0
10-
- numpy=1.12.0
10+
- matplotlib=2.2.2
11+
- numpy=1.14.*
1112
- openpyxl=2.4.0
1213
- python-dateutil
1314
- python-blosc
14-
- python=2.7
15-
- pytz
16-
- pytz=2013b
15+
- python=3.6.*
16+
- pytz=2016.10
1717
- scipy
18-
- sqlalchemy=0.8.1
18+
- sqlalchemy=1.1.4
1919
- xlrd=1.0.0
20-
- xlsxwriter=0.5.2
21-
- xlwt=0.7.5
20+
- xlsxwriter=0.9.4
21+
- xlwt=1.2.0
2222
# universal
2323
- pytest>=4.0.2
2424
- pytest-xdist
@@ -27,4 +27,3 @@ dependencies:
2727
- isort
2828
- pip:
2929
- html5lib==1.0b2
30-
- beautifulsoup4==4.2.1

ci/deps/azure-36-locale_slow.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ dependencies:
1010
- ipython
1111
- jinja2
1212
- lxml
13-
- matplotlib
13+
- matplotlib=3.0.*
1414
- nomkl
1515
- numexpr
16-
- numpy
16+
- numpy=1.15.*
1717
- openpyxl
1818
- pytables
1919
- python-dateutil
20-
- python=3.6*
20+
- python=3.6.*
2121
- pytz
2222
- s3fs
2323
- scipy

ci/deps/azure-37-locale.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dependencies:
1616
- openpyxl
1717
- pytables
1818
- python-dateutil
19-
- python=3.7*
19+
- python=3.7.*
2020
- pytz
2121
- s3fs
2222
- scipy

ci/deps/azure-37-numpydev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: pandas-dev
22
channels:
33
- defaults
44
dependencies:
5-
- python=3.7*
5+
- python=3.7.*
66
- pytz
77
- Cython>=0.28.2
88
# universal

ci/deps/azure-macos-35.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ dependencies:
88
- html5lib
99
- jinja2
1010
- lxml
11-
- matplotlib=2.2.0
11+
- matplotlib=2.2.3
1212
- nomkl
1313
- numexpr
14-
- numpy=1.12.0
15-
- openpyxl=2.5.5
14+
- numpy=1.13.3
15+
- openpyxl
1616
- pyarrow
1717
- pytables
18-
- python=3.5*
18+
- python=3.5.*
1919
- pytz
2020
- xarray
2121
- xlrd

ci/deps/azure-windows-36.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ dependencies:
77
- bottleneck
88
- boost-cpp<1.67
99
- fastparquet>=0.2.1
10-
- matplotlib
10+
- matplotlib=3.0.2
1111
- numexpr
12-
- numpy=1.14*
12+
- numpy=1.15.*
1313
- openpyxl
1414
- parquet-cpp
1515
- pyarrow
1616
- pytables
1717
- python-dateutil
18-
- python=3.6.6
18+
- python=3.6.*
1919
- pytz
2020
- scipy
2121
- xlrd

0 commit comments

Comments
 (0)