Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into io_csv_docstring_…
Browse files Browse the repository at this point in the history
…fixed

* upstream/master: (47 commits)
  CLN: remove values attribute from datetimelike EAs (pandas-dev#23603)
  DOC/CI: Add linting to rst files, and fix issues (pandas-dev#23381)
  PERF: Speeds up creation of Period, PeriodArray, with Offset freq (pandas-dev#23589)
  PERF: define is_all_dates to shortcut inadvertent copy when slicing an IntervalIndex (pandas-dev#23591)
  TST: Tests and Helpers for Datetime/Period Arrays (pandas-dev#23502)
  Update description of Index._values/values/ndarray_values (pandas-dev#23507)
  Fixes to make validate_docstrings.py not generate warnings or unwanted output (pandas-dev#23552)
  DOC: Added note about groupby excluding Decimal columns by default (pandas-dev#18953)
  ENH: Support writing timestamps with timezones with to_sql (pandas-dev#22654)
  CI: Auto-cancel redundant builds (pandas-dev#23523)
  Preserve EA dtype in DataFrame.stack (pandas-dev#23285)
  TST: Fix dtype mismatch on 32bit in IntervalTree get_indexer test (pandas-dev#23468)
  BUG: raise if invalid freq is passed (pandas-dev#23546)
  remove uses of (ts)?lib.(NaT|iNaT|Timestamp) (pandas-dev#23562)
  BUG: Fix error message for invalid HTML flavor (pandas-dev#23550)
  ENH: Support EAs in Series.unstack (pandas-dev#23284)
  DOC: Updating DataFrame.join docstring (pandas-dev#23471)
  TST: coverage for skipped tests in io/formats/test_to_html.py (pandas-dev#22888)
  BUG: Return KeyError for invalid string key (pandas-dev#23540)
  BUG: DatetimeIndex slicing with boolean Index raises TypeError (pandas-dev#22852)
  ...
  • Loading branch information
thoo committed Nov 10, 2018
2 parents c0b7210 + 9179e63 commit d84ffb2
Show file tree
Hide file tree
Showing 174 changed files with 2,650 additions and 1,290 deletions.
14 changes: 2 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
version: 2
jobs:

# --------------------------------------------------------------------------
# 1. py36_locale
# --------------------------------------------------------------------------
py36_locale:
build:
docker:
- image: continuumio/miniconda:latest
# databases configuration
Expand All @@ -21,7 +17,7 @@ jobs:

environment:
JOB: "3.6_LOCALE"
ENV_FILE: "ci/circle-36-locale.yaml"
ENV_FILE: "ci/deps/circle-36-locale.yaml"
LOCALE_OVERRIDE: "zh_CN.UTF-8"
MINICONDA_DIR: /home/ubuntu/miniconda3
steps:
Expand All @@ -34,9 +30,3 @@ jobs:
- run:
name: test
command: ./ci/circle/run_circle.sh --skip-slow --skip-network

workflows:
version: 2
build_and_test:
jobs:
- py36_locale
18 changes: 9 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,28 @@ matrix:
include:
- dist: trusty
env:
- JOB="3.7" ENV_FILE="ci/travis-37.yaml" TEST_ARGS="--skip-slow --skip-network"
- JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" TEST_ARGS="--skip-slow --skip-network"

- dist: trusty
env:
- JOB="2.7, locale, slow, old NumPy" ENV_FILE="ci/travis-27-locale.yaml" LOCALE_OVERRIDE="zh_CN.UTF-8" SLOW=true
- JOB="2.7, locale, slow, old NumPy" ENV_FILE="ci/deps/travis-27-locale.yaml" LOCALE_OVERRIDE="zh_CN.UTF-8" SLOW=true
addons:
apt:
packages:
- language-pack-zh-hans
- dist: trusty
env:
- JOB="2.7" ENV_FILE="ci/travis-27.yaml" TEST_ARGS="--skip-slow"
- JOB="2.7" ENV_FILE="ci/deps/travis-27.yaml" TEST_ARGS="--skip-slow"
addons:
apt:
packages:
- python-gtk2
- dist: trusty
env:
- 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
- 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
- dist: trusty
env:
- JOB="3.7, NumPy dev" ENV_FILE="ci/travis-37-numpydev.yaml" TEST_ARGS="--skip-slow --skip-network -W error" PANDAS_TESTING_MODE="deprecate"
- 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"
addons:
apt:
packages:
Expand All @@ -64,19 +64,19 @@ matrix:
# In allow_failures
- dist: trusty
env:
- JOB="3.6, slow" ENV_FILE="ci/travis-36-slow.yaml" SLOW=true
- JOB="3.6, slow" ENV_FILE="ci/deps/travis-36-slow.yaml" SLOW=true

# In allow_failures
- dist: trusty
env:
- JOB="3.6, doc" ENV_FILE="ci/travis-36-doc.yaml" DOC=true
- JOB="3.6, doc" ENV_FILE="ci/deps/travis-36-doc.yaml" DOC=true
allow_failures:
- dist: trusty
env:
- JOB="3.6, slow" ENV_FILE="ci/travis-36-slow.yaml" SLOW=true
- JOB="3.6, slow" ENV_FILE="ci/deps/travis-36-slow.yaml" SLOW=true
- dist: trusty
env:
- JOB="3.6, doc" ENV_FILE="ci/travis-36-doc.yaml" DOC=true
- JOB="3.6, doc" ENV_FILE="ci/deps/travis-36-doc.yaml" DOC=true

before_install:
- echo "before_install"
Expand Down
20 changes: 16 additions & 4 deletions asv_bench/benchmarks/reshape.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,33 @@ def time_unstack(self):

class Unstack(object):

def setup(self):
params = ['int', 'category']

def setup(self, dtype):
m = 100
n = 1000

levels = np.arange(m)
index = MultiIndex.from_product([levels] * 2)
columns = np.arange(n)
values = np.arange(m * m * n).reshape(m * m, n)
if dtype == 'int':
values = np.arange(m * m * n).reshape(m * m, n)
else:
# the category branch is ~20x slower than int. So we
# cut down the size a bit. Now it's only ~3x slower.
n = 50
columns = columns[:n]
indices = np.random.randint(0, 52, size=(m * m, n))
values = np.take(list(string.ascii_letters), indices)
values = [pd.Categorical(v) for v in values.T]

self.df = DataFrame(values, index, columns)
self.df2 = self.df.iloc[:-1]

def time_full_product(self):
def time_full_product(self, dtype):
self.df.unstack()

def time_without_last_row(self):
def time_without_last_row(self, dtype):
self.df2.unstack()


Expand Down
33 changes: 29 additions & 4 deletions ci/azure/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ jobs:
maxParallel: 11
matrix:
py27_np_19:
ENV_FILE: ci/azure-27-compat.yaml
ENV_FILE: ci/deps/azure-27-compat.yaml
CONDA_PY: "27"
CONDA_ENV: pandas
TEST_ARGS: "--skip-slow --skip-network"

py36_locale:
ENV_FILE: ci/azure-37-locale.yaml
ENV_FILE: ci/deps/azure-37-locale.yaml
CONDA_PY: "37"
CONDA_ENV: pandas
TEST_ARGS: "--skip-slow --skip-network"
LOCALE_OVERRIDE: "zh_CN.UTF-8"

py36_locale_slow:
ENV_FILE: ci/azure-36-locale_slow.yaml
ENV_FILE: ci/deps/azure-36-locale_slow.yaml
CONDA_PY: "36"
CONDA_ENV: pandas
TEST_ARGS: "--only-slow --skip-network"
Expand Down Expand Up @@ -53,4 +53,29 @@ jobs:
- task: PublishTestResults@2
inputs:
testResultsFiles: 'test-data-*.xml'
testRunTitle: 'Linux'
testRunTitle: 'Linux'
- powershell: |
$junitXml = "test-data-single.xml"
$(Get-Content $junitXml | Out-String) -match 'failures="(.*?)"'
if ($matches[1] -eq 0)
{
Write-Host "No test failures in test-data-single"
}
else
{
# note that this will produce $LASTEXITCODE=1
Write-Error "$($matches[1]) tests failed"
}
$junitXmlMulti = "test-data-multiple.xml"
$(Get-Content $junitXmlMulti | Out-String) -match 'failures="(.*?)"'
if ($matches[1] -eq 0)
{
Write-Host "No test failures in test-data-multi"
}
else
{
# note that this will produce $LASTEXITCODE=1
Write-Error "$($matches[1]) tests failed"
}
displayName: Check for test failures
27 changes: 26 additions & 1 deletion ci/azure/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
maxParallel: 11
matrix:
py35_np_120:
ENV_FILE: ci/azure-macos-35.yaml
ENV_FILE: ci/deps/azure-macos-35.yaml
CONDA_PY: "35"
CONDA_ENV: pandas
TEST_ARGS: "--skip-slow --skip-network"
Expand Down Expand Up @@ -41,3 +41,28 @@ jobs:
inputs:
testResultsFiles: 'test-data-*.xml'
testRunTitle: 'MacOS-35'
- powershell: |
$junitXml = "test-data-single.xml"
$(Get-Content $junitXml | Out-String) -match 'failures="(.*?)"'
if ($matches[1] -eq 0)
{
Write-Host "No test failures in test-data-single"
}
else
{
# note that this will produce $LASTEXITCODE=1
Write-Error "$($matches[1]) tests failed"
}
$junitXmlMulti = "test-data-multiple.xml"
$(Get-Content $junitXmlMulti | Out-String) -match 'failures="(.*?)"'
if ($matches[1] -eq 0)
{
Write-Host "No test failures in test-data-multi"
}
else
{
# note that this will produce $LASTEXITCODE=1
Write-Error "$($matches[1]) tests failed"
}
displayName: Check for test failures
15 changes: 14 additions & 1 deletion ci/azure/windows-py27.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
maxParallel: 11
matrix:
py36_np121:
ENV_FILE: ci/azure-windows-27.yaml
ENV_FILE: ci/deps/azure-windows-27.yaml
CONDA_PY: "27"
CONDA_ENV: pandas

Expand Down Expand Up @@ -43,3 +43,16 @@ jobs:
inputs:
testResultsFiles: 'test-data.xml'
testRunTitle: 'Windows 27'
- powershell: |
$junitXml = "test-data.xml"
$(Get-Content $junitXml | Out-String) -match 'failures="(.*?)"'
if ($matches[1] -eq 0)
{
Write-Host "No test failures in test-data"
}
else
{
# note that this will produce $LASTEXITCODE=1
Write-Error "$($matches[1]) tests failed"
}
displayName: Check for test failures
15 changes: 14 additions & 1 deletion ci/azure/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
maxParallel: 11
matrix:
py36_np14:
ENV_FILE: ci/azure-windows-36.yaml
ENV_FILE: ci/deps/azure-windows-36.yaml
CONDA_PY: "36"
CONDA_ENV: pandas

Expand All @@ -34,3 +34,16 @@ jobs:
inputs:
testResultsFiles: 'test-data.xml'
testRunTitle: 'Windows 36'
- powershell: |
$junitXml = "test-data.xml"
$(Get-Content $junitXml | Out-String) -match 'failures="(.*?)"'
if ($matches[1] -eq 0)
{
Write-Host "No test failures in test-data"
}
else
{
# note that this will produce $LASTEXITCODE=1
Write-Error "$($matches[1]) tests failed"
}
displayName: Check for test failures
12 changes: 11 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,19 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then
flake8 pandas/_libs --filename=*.pxi.in,*.pxd --select=E501,E302,E203,E111,E114,E221,E303,E231,E126,F403
RET=$(($RET + $?)) ; echo $MSG "DONE"

echo "flake8-rst --version"
flake8-rst --version

MSG='Linting code-blocks in .rst documentation' ; echo $MSG
flake8-rst doc/source --filename=*.rst
RET=$(($RET + $?)) ; echo $MSG "DONE"

# Check that cython casting is of the form `<type>obj` as opposed to `<type> obj`;
# it doesn't make a difference, but we want to be internally consistent.
# Note: this grep pattern is (intended to be) equivalent to the python
# regex r'(?<![ ->])> '
MSG='Linting .pyx code for spacing conventions in casting' ; echo $MSG
! grep -r -E --include '*.pyx' --include '*.pxi.in' '> ' pandas/_libs | grep -v '[ ->]> '
! grep -r -E --include '*.pyx' --include '*.pxi.in' '[a-zA-Z0-9*]> ' pandas/_libs
RET=$(($RET + $?)) ; echo $MSG "DONE"

# readability/casting: Warnings about C casting instead of C++ casting
Expand All @@ -64,6 +71,9 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then
cpplint --quiet --extensions=c,h --headers=h --recursive --filter=-readability/casting,-runtime/int,-build/include_subdir pandas/_libs/src/*.h pandas/_libs/src/parser pandas/_libs/ujson pandas/_libs/tslibs/src/datetime
RET=$(($RET + $?)) ; echo $MSG "DONE"

echo "isort --version-number"
isort --version-number

# Imports - Check formatting using isort see setup.cfg for settings
MSG='Check import format using isort ' ; echo $MSG
isort --recursive --check-only pandas
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion ci/azure-macos-35.yaml → ci/deps/azure-macos-35.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
- nomkl
- numexpr
- numpy=1.12.0
- openpyxl
- openpyxl=2.5.5
- pytables
- python=3.5*
- pytz
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion ci/travis-27.yaml → ci/deps/travis-27.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies:
- patsy
- psycopg2
- py
- pyarrow=0.4.1
- pyarrow=0.7.0
- PyCrypto
- pymysql=0.6.3
- pytables
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions ci/travis-36.yaml → ci/deps/travis-36.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies:
- fastparquet
- flake8>=3.5
- flake8-comprehensions
- flake8-rst
- gcsfs
- geopandas
- html5lib
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ dependencies:
- "git+git://github.com/dateutil/dateutil.git"
- "-f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com"
- "--pre"
- "numpy<=1.16.0.dev0+20181015190246"
- "numpy"
- "scipy"
File renamed without changes.
1 change: 1 addition & 0 deletions ci/environment-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies:
- NumPy
- flake8
- flake8-comprehensions
- flake8-rst
- hypothesis>=3.58.0
- isort
- moto
Expand Down
2 changes: 1 addition & 1 deletion ci/incremental/setup_conda_environment.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ conda list
@rem Clean up any left-over from a previous build
conda remove --all -q -y -n %CONDA_ENV%
@rem Scipy, CFFI, jinja2 and IPython are optional dependencies, but exercised in the test suite
conda env create -n %CONDA_ENV% --file=ci\azure-windows-%CONDA_PY%.yaml
conda env create -n %CONDA_ENV% --file=ci\deps\azure-windows-%CONDA_PY%.yaml

call activate %CONDA_ENV%
conda list
Expand Down
4 changes: 2 additions & 2 deletions ci/requirements-optional-conda.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
beautifulsoup4>=4.2.1
blosc
bottleneck>=1.2.0
fastparquet
fastparquet>=0.1.2
gcsfs
html5lib
ipython>=5.6.0
Expand All @@ -12,7 +12,7 @@ matplotlib>=2.0.0
nbsphinx
numexpr>=2.6.1
openpyxl
pyarrow>=0.4.1
pyarrow>=0.7.0
pymysql
pytables>=3.4.2
pytest-cov
Expand Down
Loading

0 comments on commit d84ffb2

Please sign in to comment.