diff --git a/.travis.yml b/.travis.yml index e08bd3b0413c9..0c2f1b0d0fe2d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,15 +19,16 @@ git: matrix: fast_finish: true include: - - python: 2.7 + - language: objective-c + os: osx + compiler: clang + osx_image: xcode6.4 env: - - JOB_NAME: "27_nslow_nnet_COMPAT" - - NOSE_ARGS="not slow and not network and not disabled" - - CLIPBOARD=xclip - - LOCALE_OVERRIDE="it_IT.UTF-8" - - BUILD_TYPE=conda - - INSTALL_TEST=true - - JOB_TAG=_COMPAT + - JOB_NAME: "35_osx" + - NOSE_ARGS="not slow and not network and not disabled" + - BUILD_TYPE=conda + - JOB_TAG=_OSX + - TRAVIS_PYTHON_VERSION=3.5 - python: 2.7 env: - JOB_NAME: "27_slow_nnet_LOCALE" @@ -75,18 +76,20 @@ matrix: - NOSE_ARGS="not slow and not disabled" - FULL_DEPS=true - BUILD_TEST=true - - python: 2.7 - env: - - JOB_NAME: "27_numpy_dev" - - JOB_TAG=_NUMPY_DEV - - NOSE_ARGS="not slow and not network and not disabled" - - PANDAS_TESTING_MODE="deprecate" - python: 3.5 env: - JOB_NAME: "35_numpy_dev" - JOB_TAG=_NUMPY_DEV - NOSE_ARGS="not slow and not network and not disabled" - PANDAS_TESTING_MODE="deprecate" + - python: 2.7 + env: + - JOB_NAME: "27_nslow_nnet_COMPAT" + - NOSE_ARGS="not slow and not network and not disabled" + - LOCALE_OVERRIDE="it_IT.UTF-8" + - BUILD_TYPE=conda + - INSTALL_TEST=true + - JOB_TAG=_COMPAT - python: 2.7 env: - JOB_NAME: "doc_build" @@ -108,12 +111,6 @@ matrix: - NOSE_ARGS="slow and not network and not disabled" - FULL_DEPS=true - CLIPBOARD=xsel - - python: 2.7 - env: - - JOB_NAME: "27_numpy_dev" - - JOB_TAG=_NUMPY_DEV - - NOSE_ARGS="not slow and not network and not disabled" - - PANDAS_TESTING_MODE="deprecate" - python: 2.7 env: - JOB_NAME: "27_build_test_conda" @@ -127,6 +124,14 @@ matrix: - JOB_TAG=_NUMPY_DEV - NOSE_ARGS="not slow and not network and not disabled" - PANDAS_TESTING_MODE="deprecate" + - python: 2.7 + env: + - JOB_NAME: "27_nslow_nnet_COMPAT" + - NOSE_ARGS="not slow and not network and not disabled" + - LOCALE_OVERRIDE="it_IT.UTF-8" + - BUILD_TYPE=conda + - INSTALL_TEST=true + - JOB_TAG=_COMPAT - python: 2.7 env: - JOB_NAME: "doc_build" @@ -139,16 +144,13 @@ before_install: - echo "before_install" - echo $VIRTUAL_ENV - export PATH="$HOME/miniconda/bin:$PATH" - - sudo apt-get install ccache - df -h - date - pwd - uname -a - python -V - ci/before_install_travis.sh - # Xvfb stuff for clipboard functionality; see the travis-ci documentation - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start install: - echo "install" @@ -157,8 +159,7 @@ install: - ci/submit_ccache.sh before_script: - - mysql -e 'create database pandas_nosetest;' - - psql -c 'create database pandas_nosetest;' -U postgres + - ci/install_db.sh script: - echo "script" diff --git a/ci/before_install_travis.sh b/ci/before_install_travis.sh index e4376e1bf21c2..76775ecbc78f0 100755 --- a/ci/before_install_travis.sh +++ b/ci/before_install_travis.sh @@ -8,6 +8,10 @@ echo "inside $0" # overview -sudo apt-get update $APT_ARGS # run apt-get update for all versions +if [ "${TRAVIS_OS_NAME}" == "linux" ]; then + sudo apt-get update $APT_ARGS # run apt-get update for all versions + + sh -e /etc/init.d/xvfb start +fi true # never fail because bad things happened here diff --git a/ci/build_docs.sh b/ci/build_docs.sh index 942c2f7c64f4f..12fb8cae4dfc7 100755 --- a/ci/build_docs.sh +++ b/ci/build_docs.sh @@ -1,5 +1,10 @@ #!/bin/bash +if [ "${TRAVIS_OS_NAME}" != "linux" ]; then + echo "not doing build_docs on non-linux" + exit 0 +fi + cd "$TRAVIS_BUILD_DIR" echo "inside $0" diff --git a/ci/install_db.sh b/ci/install_db.sh new file mode 100755 index 0000000000000..e4e6d7a5a9b85 --- /dev/null +++ b/ci/install_db.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +if [ "${TRAVIS_OS_NAME}" != "linux" ]; then + echo "not using dbs on non-linux" + exit 0 +fi + +echo "installing dbs" +mysql -e 'create database pandas_nosetest;' +psql -c 'create database pandas_nosetest;' -U postgres + +echo "done" +exit 0 diff --git a/ci/install_travis.sh b/ci/install_travis.sh index 335286d7d1676..1b1eae7b44e45 100755 --- a/ci/install_travis.sh +++ b/ci/install_travis.sh @@ -38,16 +38,16 @@ if [ -n "$LOCALE_OVERRIDE" ]; then # make sure the locale is available # probably useless, since you would need to relogin time sudo locale-gen "$LOCALE_OVERRIDE" -fi -# Need to enable for locale testing. The location of the locale file(s) is -# distro specific. For example, on Arch Linux all of the locales are in a -# commented file--/etc/locale.gen--that must be commented in to be used -# whereas Ubuntu looks in /var/lib/locales/supported.d/* and generates locales -# based on what's in the files in that folder -time echo 'it_CH.UTF-8 UTF-8' | sudo tee -a /var/lib/locales/supported.d/it -time sudo locale-gen + # Need to enable for locale testing. The location of the locale file(s) is + # distro specific. For example, on Arch Linux all of the locales are in a + # commented file--/etc/locale.gen--that must be commented in to be used + # whereas Ubuntu looks in /var/lib/locales/supported.d/* and generates locales + # based on what's in the files in that folder + time echo 'it_CH.UTF-8 UTF-8' | sudo tee -a /var/lib/locales/supported.d/it + time sudo locale-gen +fi # install gui for clipboard testing if [ -n "$CLIPBOARD_GUI" ]; then @@ -67,7 +67,12 @@ fi python_major_version="${TRAVIS_PYTHON_VERSION:0:1}" [ "$python_major_version" == "2" ] && python_major_version="" -wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh || exit 1 +# install miniconda +if [ "${TRAVIS_OS_NAME}" == "osx" ]; then + wget http://repo.continuum.io/miniconda/Miniconda-latest-MacOSX-x86_64.sh -O miniconda.sh || exit 1 +else + wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh || exit 1 +fi bash miniconda.sh -b -p $HOME/miniconda || exit 1 conda config --set always_yes yes --set changeps1 no || exit 1 @@ -94,7 +99,7 @@ time conda install -n pandas --file=${REQ} || exit 1 source activate pandas # set the compiler cache to work -if [ "$IRON_TOKEN" ]; then +if [[ "$IRON_TOKEN" && "${TRAVIS_OS_NAME}" == "linux" ]]; then export PATH=/usr/lib/ccache:/usr/lib64/ccache:$PATH gcc=$(which gcc) echo "gcc: $gcc" @@ -113,24 +118,31 @@ if [ "$BUILD_TEST" ]; then else # build but don't install + echo "build em" time python setup.py build_ext --inplace || exit 1 # we may have run installations + echo "conda installs" REQ="ci/requirements-${TRAVIS_PYTHON_VERSION}${JOB_TAG}.run" time conda install -n pandas --file=${REQ} || exit 1 # we may have additional pip installs + echo "pip installs" REQ="ci/requirements-${TRAVIS_PYTHON_VERSION}${JOB_TAG}.pip" if [ -e ${REQ} ]; then pip install -r $REQ fi # remove any installed pandas package - conda remove pandas + # w/o removing anything else + echo "removing installed pandas" + conda remove pandas --force # install our pandas + echo "running setup.py develop" python setup.py develop || exit 1 fi -true +echo "done" +exit 0 diff --git a/ci/prep_ccache.sh b/ci/prep_ccache.sh index 34e1f2520c422..7e586cc4d3085 100755 --- a/ci/prep_ccache.sh +++ b/ci/prep_ccache.sh @@ -1,5 +1,10 @@ #!/bin/bash +if [ "${TRAVIS_OS_NAME}" != "linux" ]; then + echo "not using ccache on non-linux" + exit 0 +fi + if [ "$IRON_TOKEN" ]; then home_dir=$(pwd) diff --git a/ci/requirements-2.7-64.run b/ci/requirements-2.7-64.run index c152c7160c9fc..42b5a789ae31a 100644 --- a/ci/requirements-2.7-64.run +++ b/ci/requirements-2.7-64.run @@ -13,10 +13,6 @@ scipy xlsxwriter boto bottleneck -patsy html5lib beautiful-soup jinja2=2.8 - -#pymysql=0.6.3 -#psycopg2=2.5.2 diff --git a/ci/requirements-3.4-64.run b/ci/requirements-3.4-64.run index e90722360d428..106cc5b7168ba 100644 --- a/ci/requirements-3.4-64.run +++ b/ci/requirements-3.4-64.run @@ -5,13 +5,8 @@ openpyxl xlsxwriter xlrd xlwt -html5lib -patsy -beautiful-soup scipy numexpr pytables -lxml -sqlalchemy bottleneck jinja2=2.8 diff --git a/ci/requirements-3.5-64.run b/ci/requirements-3.5-64.run index 81565f2467b69..96de21e3daa5e 100644 --- a/ci/requirements-3.5-64.run +++ b/ci/requirements-3.5-64.run @@ -5,21 +5,8 @@ openpyxl xlsxwriter xlrd xlwt -patsy scipy numexpr pytables -html5lib -lxml matplotlib -jinja2 blosc - -# currently causing some warnings -#sqlalchemy -#pymysql -#psycopg2 - -# not available from conda -#beautiful-soup -#bottleneck diff --git a/ci/requirements-3.5.run b/ci/requirements-3.5.run index fdc5f3f7dc992..333641caf26c4 100644 --- a/ci/requirements-3.5.run +++ b/ci/requirements-3.5.run @@ -5,7 +5,6 @@ openpyxl xlsxwriter xlrd xlwt -patsy scipy numexpr pytables diff --git a/ci/requirements-3.5_OSX.build b/ci/requirements-3.5_OSX.build new file mode 100644 index 0000000000000..9558cf00ddf5c --- /dev/null +++ b/ci/requirements-3.5_OSX.build @@ -0,0 +1,4 @@ +python-dateutil +pytz +numpy +cython diff --git a/ci/requirements-3.5_OSX.run b/ci/requirements-3.5_OSX.run new file mode 100644 index 0000000000000..80e12ac3fed34 --- /dev/null +++ b/ci/requirements-3.5_OSX.run @@ -0,0 +1,20 @@ +python-dateutil +pytz +numpy +openpyxl +xlsxwriter +xlrd +xlwt +scipy +numexpr +pytables +html5lib +lxml +matplotlib +jinja2 +bottleneck +xarray +boto + +# incompat with conda ATM +# beautiful-soup diff --git a/ci/submit_ccache.sh b/ci/submit_ccache.sh index da421489230dd..7630bb7cc2760 100755 --- a/ci/submit_ccache.sh +++ b/ci/submit_ccache.sh @@ -1,18 +1,23 @@ #!/bin/bash -home_dir=$(pwd) -ccache -s - -MISSES=$(ccache -s | grep "cache miss" | grep -Po "\d+") -echo "MISSES: $MISSES" - -if [ x"$MISSES" == x"0" ]; then - echo "No cache misses detected, skipping upload" - exit 0 +if [ "${TRAVIS_OS_NAME}" != "linux" ]; then + echo "not using ccache on non-linux" + exit 0 fi if [ "$IRON_TOKEN" ]; then + home_dir=$(pwd) + ccache -s + + MISSES=$(ccache -s | grep "cache miss" | grep -Po "\d+") + echo "MISSES: $MISSES" + + if [ x"$MISSES" == x"0" ]; then + echo "No cache misses detected, skipping upload" + exit 0 + fi + # install the compiler cache sudo apt-get $APT_ARGS install ccache p7zip-full # iron_cache, pending py3 fixes upstream @@ -29,6 +34,6 @@ if [ "$IRON_TOKEN" ]; then split -b 500000 -d $HOME/ccache.7z $HOME/ccache. python ci/ironcache/put.py -fi; +fi exit 0 diff --git a/doc/source/enhancingperf.rst b/doc/source/enhancingperf.rst index 7451beed7025c..b4b79a87f898a 100644 --- a/doc/source/enhancingperf.rst +++ b/doc/source/enhancingperf.rst @@ -100,7 +100,7 @@ cython versions >=0.21 you can use ``%load_ext Cython``): .. ipython:: python :okwarning: - %load_ext cythonmagic + %load_ext Cython Now, let's simply copy our functions over to cython as is (the suffix diff --git a/doc/source/release.rst b/doc/source/release.rst index 04d74270ec938..60d6b15a21a7b 100644 --- a/doc/source/release.rst +++ b/doc/source/release.rst @@ -40,7 +40,7 @@ analysis / manipulation tool available in any language. pandas 0.18.0 ------------- -**Release date:** (January ??, 2016) +**Release date:** (March 13, 2016) This is a major release from 0.17.1 and includes a small number of API changes, several new features, enhancements, and performance improvements along with a large number of bug fixes. We recommend that all diff --git a/doc/source/whatsnew/v0.18.0.txt b/doc/source/whatsnew/v0.18.0.txt index e4b9b3486adf1..90ded17286c9f 100644 --- a/doc/source/whatsnew/v0.18.0.txt +++ b/doc/source/whatsnew/v0.18.0.txt @@ -1,7 +1,7 @@ .. _whatsnew_0180: -v0.18.0 (February ??, 2016) ---------------------------- +v0.18.0 (March 13, 2016) +------------------------ This is a major release from 0.17.1 and includes a small number of API changes, several new features, enhancements, and performance improvements along with a large number of bug fixes. We recommend that all @@ -607,9 +607,9 @@ Subtraction by ``Timedelta`` in a ``Series`` by a ``Timestamp`` works (:issue:`1 Changes to msgpack ^^^^^^^^^^^^^^^^^^ -Forward incompatible changes in ``msgpack`` writing format were made over 0.17.0 and 0.18.0; older versions of pandas cannot read files packed by newer versions (:issue:`12129`, `10527`) +Forward incompatible changes in ``msgpack`` writing format were made over 0.17.0 and 0.18.0; older versions of pandas cannot read files packed by newer versions (:issue:`12129`, :issue:`10527`) -Bug in ``to_msgpack`` and ``read_msgpack`` introduced in 0.17.0 and fixed in 0.18.0, caused files packed in Python 2 unreadable by Python 3 (:issue:`12142`). The following table describes the backward and forward compat of msgpacks. +Bugs in ``to_msgpack`` and ``read_msgpack`` introduced in 0.17.0 and fixed in 0.18.0, caused files packed in Python 2 unreadable by Python 3 (:issue:`12142`). The following table describes the backward and forward compat of msgpacks. .. warning:: @@ -745,58 +745,6 @@ You could also specify a ``how`` directly 2010-01-01 09:00:06 1.249976 1.219477 1.266330 1.224904 2010-01-01 09:00:08 1.020940 1.068634 1.146402 1.613897 -.. warning:: - - This new API for resample includes some internal changes for the prior-to-0.18.0 API, to work with a deprecation warning in most cases, as the resample operation returns a deferred object. We can intercept operations and just do what the (pre 0.18.0) API did (with a warning). Here is a typical use case: - - .. code-block:: python - - In [4]: r = df.resample('2s') - - In [6]: r*10 - pandas/tseries/resample.py:80: FutureWarning: .resample() is now a deferred operation - use .resample(...).mean() instead of .resample(...) - - Out[6]: - A B C D - 2010-01-01 09:00:00 4.857476 4.473507 3.570960 7.936154 - 2010-01-01 09:00:02 8.208011 7.943173 3.640340 5.310957 - 2010-01-01 09:00:04 4.339846 3.145823 4.241039 6.257326 - 2010-01-01 09:00:06 6.249881 6.097384 6.331650 6.124518 - 2010-01-01 09:00:08 5.104699 5.343172 5.732009 8.069486 - - However, getting and assignment operations directly on a ``Resampler`` will raise a ``ValueError``: - - .. code-block:: python - - In [7]: r.iloc[0] = 5 - ValueError: .resample() is now a deferred operation - use .resample(...).mean() instead of .resample(...) - assignment will have no effect as you are working on a copy - - There is a situation where the new API can not perform all the operations when using original code. - This code is intending to resample every 2s, take the ``mean`` AND then take the ``min` of those results. - - .. code-block:: python - - In [4]: df.resample('2s').min() - Out[4]: - A 0.433985 - B 0.314582 - C 0.357096 - D 0.531096 - dtype: float64 - - The new API will: - - .. ipython: python - - df.resample('2s').min() - - Good news is the return dimensions will differ (between the new API and the old API), so this should loudly raise - an exception. - - **New API**: Now, you can write ``.resample`` as a 2-stage operation like groupby, which @@ -886,6 +834,60 @@ New API In the new API, you can either downsample OR upsample. The prior implementation would allow you to pass an aggregator function (like ``mean``) even though you were upsampling, providing a bit of confusion. +Previous API will work but deprecations +''''''''''''''''''''''''''''''''''''''' + +.. warning:: + + This new API for resample includes some internal changes for the prior-to-0.18.0 API, to work with a deprecation warning in most cases, as the resample operation returns a deferred object. We can intercept operations and just do what the (pre 0.18.0) API did (with a warning). Here is a typical use case: + + .. code-block:: python + + In [4]: r = df.resample('2s') + + In [6]: r*10 + pandas/tseries/resample.py:80: FutureWarning: .resample() is now a deferred operation + use .resample(...).mean() instead of .resample(...) + + Out[6]: + A B C D + 2010-01-01 09:00:00 4.857476 4.473507 3.570960 7.936154 + 2010-01-01 09:00:02 8.208011 7.943173 3.640340 5.310957 + 2010-01-01 09:00:04 4.339846 3.145823 4.241039 6.257326 + 2010-01-01 09:00:06 6.249881 6.097384 6.331650 6.124518 + 2010-01-01 09:00:08 5.104699 5.343172 5.732009 8.069486 + + However, getting and assignment operations directly on a ``Resampler`` will raise a ``ValueError``: + + .. code-block:: python + + In [7]: r.iloc[0] = 5 + ValueError: .resample() is now a deferred operation + use .resample(...).mean() instead of .resample(...) + assignment will have no effect as you are working on a copy + + There is a situation where the new API can not perform all the operations when using original code. + This code is intending to resample every 2s, take the ``mean`` AND then take the ``min` of those results. + + .. code-block:: python + + In [4]: df.resample('2s').min() + Out[4]: + A 0.433985 + B 0.314582 + C 0.357096 + D 0.531096 + dtype: float64 + + The new API will: + + .. ipython:: python + + df.resample('2s').min() + + The good news is the return dimensions will differ between the new API and the old API, so this should loudly raise + an exception. + Changes to eval ^^^^^^^^^^^^^^^