Skip to content

CI/ENH: test against an older version of statsmodels #4981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 25, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions ci/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,6 @@ if [ x"$FULL_DEPS" == x"true" ]; then
echo "Installing FULL_DEPS"
# for pytables gets the lib as well
time sudo apt-get $APT_ARGS install libhdf5-serial-dev

# fool statsmodels into thinking pandas was already installed
# so it won't refuse to install itself.

SITE_PKG_DIR=$VIRTUAL_ENV/lib/python$TRAVIS_PYTHON_VERSION/site-packages
echo "Using SITE_PKG_DIR: $SITE_PKG_DIR"

mkdir $SITE_PKG_DIR/pandas
touch $SITE_PKG_DIR/pandas/__init__.py
echo "version='0.10.0-phony'" > $SITE_PKG_DIR/pandas/version.py
time pip install $PIP_ARGS git+git://github.com/statsmodels/statsmodels@c9062e43b8a5f7385537ca95#egg=statsmodels

rm -Rf $SITE_PKG_DIR/pandas # scrub phoney pandas
fi

# build pandas
Expand Down
1 change: 1 addition & 0 deletions ci/requirements-2.7.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ scikits.timeseries==0.91.3
MySQL-python==1.2.4
scipy==0.10.0
beautifulsoup4==4.2.1
statsmodels==0.5.0
1 change: 1 addition & 0 deletions ci/requirements-2.7_LOCALE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ html5lib==1.0b2
lxml==3.2.1
scipy==0.10.0
beautifulsoup4==4.2.1
statsmodels==0.5.0
1 change: 1 addition & 0 deletions ci/requirements-3.2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ patsy==0.1.0
lxml==3.2.1
scipy==0.12.0
beautifulsoup4==4.2.1
statsmodels==0.4.3
1 change: 1 addition & 0 deletions ci/requirements-3.3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ patsy==0.1.0
lxml==3.2.1
scipy==0.12.0
beautifulsoup4==4.2.1
statsmodels==0.4.3
39 changes: 37 additions & 2 deletions ci/speedpack/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,42 @@ apt-get build-dep python-lxml -y
export PYTHONIOENCODING='utf-8'
export VIRTUALENV_DISTRIBUTE=0


function create_fake_pandas() {
local site_pkg_dir="$1"
rm -rf $site_pkg_dir/pandas
mkdir $site_pkg_dir/pandas
touch $site_pkg_dir/pandas/__init__.py
echo "version = '0.10.0-phony'" > $site_pkg_dir/pandas/version.py
}


function get_site_pkgs_dir() {
python$1 -c 'import distutils; print(distutils.sysconfig.get_python_lib())'
}


function create_wheel() {
local pip_args="$1"
local wheelhouse="$2"
local n="$3"
local pyver="$4"

local site_pkgs_dir="$(get_site_pkgs_dir $pyver)"


if [[ "$n" == *statsmodels* ]]; then
create_fake_pandas $site_pkgs_dir && \
pip wheel $pip_args --wheel-dir=$wheelhouse $n && \
pip install $pip_args --no-index $n && \
rm -Rf $site_pkgs_dir
else
pip wheel $pip_args --wheel-dir=$wheelhouse $n
pip install $pip_args --no-index $n
fi
}


function generate_wheels() {
# get the requirements file
local reqfile="$1"
Expand Down Expand Up @@ -62,8 +98,7 @@ function generate_wheels() {

# install and build the wheels
cat $reqfile | while read N; do
pip wheel $PIP_ARGS --wheel-dir=$WHEELHOUSE $N
pip install $PIP_ARGS --no-index $N
create_wheel "$PIP_ARGS" "$WHEELHOUSE" "$N" "$PY_VER"
done
}

Expand Down
2 changes: 2 additions & 0 deletions doc/source/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ Improvements to existing features
- ``read_stata`` now accepts Stata 13 format (:issue:`4291`)
- ``ExcelWriter`` and ``ExcelFile`` can be used as contextmanagers.
(:issue:`3441`, :issue:`4933`)
- ``pandas`` is now tested with two different versions of ``statsmodels``
(0.4.3 and 0.5.0) (:issue:`4981`).

API Changes
~~~~~~~~~~~
Expand Down
10 changes: 5 additions & 5 deletions pandas/stats/tests/test_ols.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from __future__ import division

from distutils.version import LooseVersion
from datetime import datetime
from pandas import compat
import unittest
Expand Down Expand Up @@ -98,11 +99,10 @@ def testOLSWithDatasets_scotland(self):

def testWLS(self):
# WLS centered SS changed (fixed) in 0.5.0
v = sm.version.version.split('.')
if int(v[0]) >= 0 and int(v[1]) <= 5:
if int(v[2]) < 1:
raise nose.SkipTest
print( "Make sure you're using statsmodels 0.5.0.dev-cec4f26 or later.")
sm_version = sm.version.version
if sm_version < LooseVersion('0.5.0'):
raise nose.SkipTest("WLS centered SS not fixed in statsmodels"
" version {0}".format(sm_version))

X = DataFrame(np.random.randn(30, 4), columns=['A', 'B', 'C', 'D'])
Y = Series(np.random.randn(30))
Expand Down