Interested in contributing to Edward? We appreciate all kinds of help!
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:
examples/directory on Github. They are the easiest to contribute to and can get you acquainted with Edward’s developer process.
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
texversion, and we can help you reformat to produce the other.
edward/inferences/directory on Github.
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, which more or less follows PEP 8. Follow NumPy’s documentation guide for writing documention, and follow TensorFlow’s documentation guide for describing TensorFlow tensors in the 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.,
Submit the pull request whenever you’re ready. You can also submit an incomplete pull request to get intermediate feedback.
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 firstname.lastname@example.org: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.