Skip to content

Commit

Permalink
Merge branch 'releases' into debian-experimental
Browse files Browse the repository at this point in the history
* releases: (970 commits)
  REF _fit_newton use np.asarray(hess)
  REF: _fit_newton, add ridge_factor option, default 1e-10
  REF: _fit_newton add Ridge correction to Hessian, see also statsmodels#953
  Bug comment: commented out code, weigths don't sum to 1 see statsmodels#1845
  CLN: TST cleanup comment, unused code.
  REF: "is" None (not ==)
  BUG: fix if alpha is scalar, TST: try standardized
  REF: NegativeBinomial fit_regularized, try regularized Poisson for start_params
  DOC: add comment in notes about not penalizing NegBin shape parameter [skip ci]
  TST: TestNegativeBinomialL1Compatability use desired as start_params
  TST: adjust test, precision and start_params (failure on TravisCI)
  BUG: NegativeBinomial fix aic, bic for 'geometric', adjust tests
  REF add k_extra to NegativeBinomial, don't count it in df_model, df_resid
  TST explicitely define k_extra in test class
  CLN: a few cosmetic changes
  TST fix negbin geometric test for fit_regularized
  CLN L1NegativeBinomialResults rename closes statsmodels#1615,     remove redundant `__init__`
  BUG NegativeBinomial add fit_regularized closes statsmodels#1453 closes  statsmodels#1454     adjust test to handle extra parameter
  REF: has_constant remove special code in linear_model, is moved to data
  Fix const_idx with multiple const, more tests
  ...
  • Loading branch information
yarikoptic committed Jul 29, 2014
2 parents dc6d844 + 18a1faa commit 8f2ab7a
Show file tree
Hide file tree
Showing 757 changed files with 66,487 additions and 12,146 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -48,3 +48,5 @@ help

# Project specific
statsmodels/version.py
cythonize.dat
statsmodels.egg-info/
57 changes: 57 additions & 0 deletions .travis.orig.yml
@@ -0,0 +1,57 @@
# Adapted from M. Brett's .yaml file for nipy:
# https://github.com/nipy/nipy/blob/master/.travis.yml
#
# We pretend to be erlang because we can't use the python support in
# travis-ci; it uses virtualenvs, they do not have numpy, scipy, matplotlib,
# and it is impractical to build them
language: erlang
notifications:
email:
- statsmodels-commits@googlegroups.com
env:
# Enable python 2 and python 3 builds. Python3.2 available in Ubuntu 12.04.
- PYTHON=python PYSUF=''
- PYTHON=python3 PYSUF=3
install:
- sudo apt-get update
- sudo apt-get install $PYTHON-dev
- sudo apt-get install $PYTHON-numpy
- sudo apt-get install $PYTHON-scipy
- sudo apt-get install $PYTHON-setuptools
- sudo apt-get install $PYTHON-nose
# Cython needs manual install under Python 3
- if [ "${PYSUF}" == "3" ]; then
wget http://cython.org/release/Cython-0.17.1.tar.gz ;
tar xfvz Cython-0.17.1.tar.gz ;
cd Cython-0.17.1 ;
sudo python3 setup.py install ;
cd .. ;
else
sudo apt-get install cython ;
fi
- echo ${DISTRIB_CODENAME}
- wget -O- http://neuro.debian.net/lists/precise.us-nh.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
- sudo apt-key adv --recv-keys --keyserver pgp.mit.edu 2649A5A9
- sudo apt-get update -qq
- sudo apt-get install $PYTHON-dateutil
- sudo apt-get --no-install-recommends install $PYTHON-pandas
- sudo apt-get --no-install-recommends install $PYTHON-pandas-lib
- sudo easy_install$PYSUF -U patsy
- if [ "${PYSUF}" != "3" ]; then sudo pip install coverage; fi
- if [ "${PYSUF}" != "3" ]; then sudo pip install coveralls; fi
script:
- SRCDIR=$PWD
- sudo $PYTHON setup.py install
# Ubuntu 12.04 installs statsmodels under the wrong path for Python 3
- if [ "${PYSUF}" == "3" ]; then
sudo mv /usr/local/lib/python3.2/dist-packages/statsmodels-*/statsmodels /usr/local/lib/python3.2/dist-packages/statsmodels ;
sudo rm -rf /usr/lib/python3.2/dist-packages/statsmodels-* ;
fi
# statsmodels was installed "system-wide" thus cd under dedicated
# travis-test/ directory to not try using local version without built extensions
- mkdir -p "${SRCDIR}/travis-test"; cd "${SRCDIR}/travis-test"
# Compose a script to run testing with coverage
- echo 'import statsmodels as sm; a=sm.test(); import sys; sys.exit((len(a.failures)+len(a.errors))>0)' > test.py
- if [ "${PYSUF}" != "3" ]; then coverage run --rcfile=${SRCDIR}/.travis_coveragerc test.py; else $PYTHON test.py; fi
after_success:
- if [ "${PYSUF}" != "3" ]; then coveralls; fi
139 changes: 93 additions & 46 deletions .travis.yml
@@ -1,50 +1,97 @@
# Adapted from M. Brett's .yaml file for nipy:
# https://github.com/nipy/nipy/blob/master/.travis.yml
#
# We pretend to be erlang because we can't use the python support in
# travis-ci; it uses virtualenvs, they do not have numpy, scipy, matplotlib,
# and it is impractical to build them
language: erlang
notifications:
email:
- statsmodels-commits@googlegroups.com
# Travis script that uses miniconda in place of the system installed python
# versions. Allows substantial flexability for choosing versions of
# required packages and is simpler to use to test up-to-date scientific Python
# stack
language: python

env:
# Enable python 2 and python 3 builds. Python3.2 available in Ubuntu 12.04.
- PYTHON=python PYSUF=''
- PYTHON=python3 PYSUF=3
# Default values for common packages, override as needed
global:
- CYTHON=0.20
- PATSY=0.2
- PANDAS=0.12
- MATPLOTLIB=1.3
- OPTIONAL=
- COVERAGE=false

matrix:
fast_finish: true
include:
- python: 2.7
env:
- PYTHON=2.6
- NUMPY="1.6.2=py26_4"
- SCIPY="0.11.0=np16py26_3"
- MATPLOTLIB=1.2
- python: 2.7
env:
- PYTHON=2.7
- NUMPY=1.7
- SCIPY=0.12
- OPTIONAL=cvxopt
- COVERAGE=true
- python: 2.7
env:
- PYTHON=3.3
- NUMPY=1.8
- SCIPY=0.13
- PANDAS=0.13
- python: 2.7
env:
- PYTHON=2.7
- NUMPY=
- SCIPY=
- MATPLOTLIB=
- PANDAS=

notifications:
email:
on_success: always

# Setup anaconda
before_install:
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
- export PATH=/home/travis/miniconda/bin:$PATH
- conda update --yes --quiet conda
# Fix for headless TravisCI
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
# Avoid noise from matplotlib
- mkdir $HOME/.config
- mkdir $HOME/.config/matplotlib
- SRCDIR=$PWD
- cp $SRCDIR/tools/matplotlibrc $HOME/.config/matplotlib/matplotlibrc
# Location for older version of matplotlib
- if [ ${MATPLOTLIB} = "1.2" ]; then mkdir $HOME/.matplotlib; fi
- if [ ${MATPLOTLIB} = "1.2" ]; then cp ${SRCDIR}/tools/matplotlibrc $HOME/.matplotlib/matplotlibrc; fi
# Build package list to avoid empty package=versions; only needed for versioned pacakges
- PKGS="python=${PYTHON}"
- PKGS="${PKGS} numpy"; if [ ${NUMPY} ]; then PKGS="${PKGS}=${NUMPY}"; fi
- PKGS="${PKGS} scipy"; if [ ${SCIPY} ]; then PKGS="${PKGS}=${SCIPY}"; fi
- PKGS="${PKGS} patsy"; if [ ${PATSY} ]; then PKGS="${PKGS}=${PATSY}"; fi
- PKGS="${PKGS} pandas"; if [ ${PANDAS} ]; then PKGS="${PKGS}=${PANDAS}"; fi
- PKGS="${PKGS} Cython"; if [ ${CYTHON} ]; then PKGS="${PKGS}=${CYTHON}"; fi
- PKGS="${PKGS} matplotlib"; if [ ${MATPLOTLIB} ]; then PKGS="${PKGS}=${MATPLOTLIB}"; fi

# Install packages
install:
- sudo apt-get update
- sudo apt-get install $PYTHON-dev
- sudo apt-get install $PYTHON-numpy
- sudo apt-get install $PYTHON-scipy
- sudo apt-get install $PYTHON-setuptools
- sudo apt-get install $PYTHON-nose
# Cython needs manual install under Python 3
- if [ "${PYSUF}" == "3" ]; then
wget http://cython.org/release/Cython-0.17.1.tar.gz ;
tar xfvz Cython-0.17.1.tar.gz ;
cd Cython-0.17.1 ;
sudo python3 setup.py install ;
cd .. ;
else
sudo apt-get install cython ;
fi
- echo ${DISTRIB_CODENAME}
- wget -O- http://neuro.debian.net/lists/precise.us-nh.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
- sudo apt-key adv --recv-keys --keyserver pgp.mit.edu 2649A5A9
- sudo apt-get update -qq
- sudo apt-get install $PYTHON-dateutil
- sudo apt-get --no-install-recommends install $PYTHON-pandas
- sudo apt-get --no-install-recommends install $PYTHON-pandas-lib
- sudo easy_install$PYSUF -U patsy
- conda create --yes --quiet -n statsmodels-test ${PKGS} ${OPTIONAL} dateutil nose pip pyyaml setuptools
- source activate statsmodels-test
- if [ ${COVERAGE} = true ]; then pip install coverage coveralls; fi
- python setup.py install

script:
- sudo $PYTHON setup.py install
# Ubuntu 12.04 installs statsmodels under the wrong path for Python 3
- if [ "${PYSUF}" == "3" ]; then
sudo mv /usr/local/lib/python3.2/dist-packages/statsmodels-*/statsmodels /usr/local/lib/python3.2/dist-packages/statsmodels ;
sudo rm -rf /usr/lib/python3.2/dist-packages/statsmodels-* ;
fi
# For some reason, Python 3 will try to work with the build directory. Get out of folder to avoid breakage
- cd ../
- sudo $PYTHON -c "import statsmodels as sm; a=sm.test(); import sys; sys.exit((len(a.failures)+len(a.errors))>0)"
- SRCDIR=$PWD
- python setup.py install
- mkdir -p "${SRCDIR}/travis-test"; cd "${SRCDIR}/travis-test"
# Show versions
- python -c 'import statsmodels.api as sm; sm.show_versions();'
# Compose a script to run testing with coverage
- echo 'import statsmodels as sm; a=sm.test(); import sys; sys.exit((len(a.failures)+len(a.errors))>0)' > test.py
- if [ ${COVERAGE} = true ]; then coverage run --rcfile=${SRCDIR}/.travis_coveragerc test.py; else python test.py; fi

after_success:
# Coverage only for 2.7
- if [ ${COVERAGE} = true ]; then coveralls --rcfile=${SRCDIR}/.travis_coveragerc; fi
5 changes: 5 additions & 0 deletions .travis_coveragerc
@@ -0,0 +1,5 @@

[run]
branch = True
include =
*/statsmodels/*
49 changes: 37 additions & 12 deletions CONTRIBUTING.rst
Expand Up @@ -7,23 +7,42 @@ by submitting patches, statistical tests, new models, or examples.
`statsmodels` is developed on `Github <https://github.com/statsmodels/statsmodels>`_
using the `Git <http://git-scm.com/>`_ version control system.

License
~~~~~~~
Submitting a Bug Report
~~~~~~~~~~~~~~~~~~~~~~~

Statsmodels is released under the
`Modified (3-clause) BSD license <http://www.opensource.org/licenses/BSD-3-Clause>`_.
- Include a short, self-contained code snippet that reproduces the problem
- Specify the statsmodels version used. You can do this with ``sm.version.full_version``
- If the issue looks to involve other dependencies, also include the output of ``sm.show_versions()``

Making Changes to the Code
~~~~~~~~~~~~~~~~~~~~~~~~~~

For a pull request to be accepted, you must meet the below requirements. This greatly helps in keeping the job of maintaining and releasing the software a shared effort.

- **One branch. One feature.** Branches are cheap and github makes it easy to merge and delete branches with a few clicks. Avoid the temptation to lump in a bunch of unrelated changes when working on a feature, if possible. This helps us keep track of what has changed when preparing a release.
- Commit messages should be clear and concise. This means a subject line of less than 80 characters, and, if necessary, a blank line followed by a commit message body. We have an `informal commit format standard <http://statsmodels.sourceforge.net/devel/dev/maintainer_notes.html#commit-comments>`_ that we try to adhere to. You can see what this looks like in practice by ``git log --oneline -n 10``. If your commit references or closes a specific issue, you can close it by mentioning it in the `commit message <https://help.github.com/articles/closing-issues-via-commit-messages>`_. (*For maintainers*: These suggestions go for Merge commit comments too. These are partially the record for release notes.)
- Code submissions must always include tests. See our `notes on testing <https://statsmodels.sourceforge.net/devel/dev/test_notes.html>`_.
- Each function, class, method, and attribute needs to be documented using docstrings. We conform to the `numpy docstring standard <https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt#docstring-standard>`_.
- If you are adding new functionality, you need to add it to the documentation by editing (or creating) the appropriate file in ``docs/source``.
- Make sure your documentation changes parse correctly. Change into the top-level ``docs/`` directory and type::
make clean
make html

Submitting a Patch
~~~~~~~~~~~~~~~~~~
Check that the build output does not have *any* warnings due to your changes.
- Finally, please add your changes to the release notes. Open the ``docs/source/release/versionX.X.rst`` file that has the version number of the next release and add your changes to the appropriate section.

So you want to submit a patch to `statsmodels`?. Great news! Here are the
steps you need to take.
How to Submit a Pull Request
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

So you want to submit a patch to `statsmodels` but aren't too familiar with github? Here are the steps you need to take.

1. `Fork <https://help.github.com/articles/fork-a-repo>`_ the `statsmodels repository <https://github.com/statsmodels/statsmodels>`_ on Github.
2. `Create a new feature branch <http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging>`_
+ Each branch must be self-contained, with a single new feature or bugfix.
+ Patches must always include tests. See our `notes on testing <test_notes.html>`_.
3. `Submit a pull request <https://help.github.com/articles/using-pull-requests>`_
2. `Create a new feature branch <http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging>`_. Each branch must be self-contained, with a single new feature or bugfix.
3. Make sure the test suite passes. This includes testing on Python 3. The easiest way to do this is to either enable `Travis-CI <https://travis-ci.org/>`_ on your fork, or to make a pull request and check there.
4. Document your changes by editing the appropriate file in ``docs/source/``. If it is a big, new feature add a note and an example to the latest ``docs/source/release/versionX.X.rst`` file. See older versions for examples. If it's a minor change, it will be included automatically in our relase notes.
5. Add an example. If it is a big, new feature please submit an example notebook by following `these instructions <http://statsmodels.sourceforge.net/devel/dev/examples.html>`_.
6. `Submit a pull request <https://help.github.com/articles/using-pull-requests>`_

Mailing List
~~~~~~~~~~~~
Expand All @@ -35,3 +54,9 @@ Learn More

The ``statsmodels`` documentation's `developer page <http://statsmodels.sourceforge.net/stable/dev/index.html>`_
offers much more detailed information about the process.

License
~~~~~~~

Statsmodels is released under the
`Modified (3-clause) BSD license <http://www.opensource.org/licenses/BSD-3-Clause>`_.
11 changes: 8 additions & 3 deletions INSTALL.txt
Expand Up @@ -9,7 +9,7 @@ numpy >= 1.5.1

www.numpy.org

scipy >= 0.7
scipy >= 0.9.0

www.scipy.org

Expand All @@ -22,13 +22,15 @@ patsy >= 0.1.0
patsy.readthedocs.org


cython >= 0.15.1
cython >= 0.20.1

http://cython.org/

Cython is required if you are building the source from github. However,
if you have are building from source distribution archive then the
generated C files are included and Cython is not necessary.
generated C files are included and Cython is not necessary. If you are
building for Python 3.4, then you must use Cython >= 0.20.1. Earlier
versions may be ok for Python < 3.4.

Optional Dependencies
---------------------
Expand All @@ -52,6 +54,9 @@ nose >= 1.0.0

Nose is needed to run the tests.

IPython >= 1.0

Needed to build the docs.

Easy Install
------------
Expand Down
25 changes: 6 additions & 19 deletions MANIFEST.in
@@ -1,13 +1,12 @@
global-include *.csv *.py *.txt
#scikits*.*
global-include *.csv *.py *.txt *.pyx *.pxd *.pxi *.c *.h
include MANIFEST.in

#exclude docs/build/htmlhelp*
recursive-exclude build *
recursive-exclude dist *
recursive-exclude tools *
include tools/examples_rst.py
include tools/hash_funcs.py
include tools/cythonize.py

graft statsmodels/datasets
graft statsmodels/tests
Expand All @@ -20,28 +19,16 @@ exclude docs/source/generated/*
recursive-include docs/sphinxext *
recursive-include docs/themes *
recursive-exclude docs/build *
#recursive-include docs/build/html *
recursive-exclude docs/build/htmlhelp *
include statsmodels/statsmodelsdoc.chm
include docs/make.bat
include docs/Makefile
#include docs mak*
#include docs GLM*

recursive-include examples *

#missed files: .npz, .npy
include statsmodels/tsa/vector_ar/tests/results/vars_results.npz
include statsmodels/iolib/tests/results/*
include statsmodels/stats/tests/results/influence_lsdiag_R.json
include statsmodels/sandbox/panel/test_data.txt
include statsmodels/stats/tests/results/influence_measures_R.csv
include statsmodels/stats/libqsturng/tests/results/*
include statsmodels/stats/libqsturng/tests/bootleg.dat
include statsmodels/stats/libqsturng/tests/bootleg.csv
include statsmodels/stats/libqsturng/CH.r
include statsmodels/stats/libqsturng/LICENSE.txt
include statsmodels/regression/tests/results/leverage_influence_ols_nostars.txt
# Cached Cython signatures
include cythonize.dat

prune */__pycache__

global-exclude *~ *.swp *.pyc *.bak *.pyx
global-exclude *~ *.swp *.pyc *.pyo *.bak
4 changes: 2 additions & 2 deletions README.txt
Expand Up @@ -86,11 +86,11 @@ This can be opened from the python interpreter ::
Discussion and Development
==========================

Discussions take place on our mailing list.
Discussions take place on our mailing list.

http://groups.google.com/group/pystatsmodels

We are very interested in feedback about usability and suggestions for improvements.
We are very interested in feedback about usability and suggestions for improvements.


Bug Reports
Expand Down
2 changes: 2 additions & 0 deletions build_bdists.bat
Expand Up @@ -4,4 +4,6 @@ call tools\build_win_bdist64-py27.bat
call tools\build_win_bdist32-py27.bat
call tools\build_win_bdist32-py32.bat
call tools\build_win_bdist64-py32.bat
call tools\build_win_bdist33-py34.bat
call tools\build_win_bdist64-py34.bat
call python setup.py sdist --formats=zip,gztar

0 comments on commit 8f2ab7a

Please sign in to comment.