Developer Page

This page explains how you can contribute to the development of statsmodels by submitting patches, statistical tests, new models, or examples.

statsmodels is developed on Github using the Git version control system.

Submitting a Bug Report

  • 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

First, review the Working with the statsmodels Code section for an intro to the git version control system.

For a pull request to be accepted, you must meet the below requirements. This greatly helps 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 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. (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.

  • Each function, class, method, and attribute needs to be documented using docstrings. We conform to the numpy 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
    

    Check that the build output does not have any warnings due to your changes.

    Generating the docs requires additional dependencies, see docs/README.md for details.

  • Follow PEP8 style guidelines wherever possible. Lint your code by running LINT=true ./lint.sh.

  • Compare your changes to what’s in main by running git diff upstream/main.

  • 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.

How to Submit a Pull Request

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

  1. Fork the statsmodels repository on Github.

  2. Create a new feature branch. 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 make a pull request and let the bot check for you. This can be slow, and if you are unsure about the fix or enhancement, it is best to run pytest locally.

  4. Submit a pull request

Pull requests are thoroughly reviewed before being accepted into the codebase. If your pull request becomes out of date, rebase your pull request on the latest version in the central repository.

Mailing List

Conversations about development take place on the statsmodels mailing list.

License

statsmodels is released under the Modified (3-clause) BSD license.

Contents


Last update: Dec 23, 2024