Contributing

Interested in contributing to Edward? We appreciate all kinds of help!

Pull requests

We gladly welcome pull requests.

Before making any changes, we recommend opening an issue (if it doesn’t already exist) and discussing your proposed changes. This will let us give you advice on the proposed changes. If the changes are minor, then feel free to make them without discussion.

Want to contribute but not sure what to contribute? Here are a few suggestions:

  1. Add a new example. They are located in the examples/ directory on Github. They are the easiest to contribute to and can get you acquainted with Edward’s developer process.
  2. Add a new tutorial. They are written as Jupyter notebooks and located in the notebooks/ directory on Github. The goal is that all examples eventually become a tutorial—so you can port over an existing example. Each has a corresponding LaTeX document in the docs/tex/ directory. Write either the ipynb or tex version, and we can help you reformat to produce the other.
  3. Add a new algorithm (or improve existing algorithms). They are located in the edward/inferences/ directory on Github.
  4. Solve existing issues in Edward. They range from low-level software bugs to higher-level design problems. Check out the label "Good first contribution".

To make changes, fork the repo. Write code in this fork with the following guidelines.

Style guide. Follow TensorFlow’s style guide for writing code. Follow TensorFlow’s documentation guide for writing documentation.

Unit testing. Unit testing is awesome. It’s useful not only for checking code after having written it, but also in checking code as you are developing it. Most pull requests require unit tests. Follow TensorFlow’s testing guide. To run the unit tests, we use pytest: run pytest tests/ in command line. To run specific unit tests, call pytest individually, e.g., pytest tests/test_metrics.py.

Submit the pull request whenever you’re ready. You can also submit an incomplete pull request to get intermediate feedback.

Suggested developer workflow

If you’re developing in Edward, we recommend downloading and installing Edward locally. This enables any local changes you make to Edward to appear any time you import Edward in a Python session. To install locally, run the following:

git clone git@github.com:blei-lab/edward.git  # use your fork's url
pip install -e edward

We recommend not installing with sudo but with virtualenv. In fact, we recommend virtualenvwrapper, which is a light wrapper on top of virtualenv. Here is a guide on how to set it up.

All code should be compatible with both Python 2 and 3. virtualenvwrapper makes it easy to develop in both Python versions and let them manage their own packages. If you set up virtualenvwrapper from the above guide, here is a guide on how to setup a virtualenv with Python 3. Now we need only work on the corresponding virtualenv to ensure Python 2 and 3 compatibility.