Developer Guide¶
At some point I’ll fill this in a bit more, but for the time being:
Setting up a development environment¶
To start up an environment to run and test ProbFlow, first make a fork of the ProbFlow github repository. Then, clone your fork to download the repository to your machine (this assumes you’re connecting to github using ssh ):
git clone git@github.com:<your_github_username>/probflow.git
cd probflow
Then, to set up a development environment with tensorflow, run
make init-tensorflow
or alternatively to set up a dev environment with pytorch,
make init-tensorflow
The above command creates a new virtual environment called venv
, activates
that virtual environment, installs the requirements (including tensorflow or
pytorch), dev requirements, and the ProbFlow package in editable mode from your
version of the source code - see the Makefile
for the commands it’s
running).
Tests¶
Then you can edit the source code, which is in src/probflow
. The tests are
in tests
. To run the tensorflow tests, run
make test-tensorflow
and to run the PyTorch tests, run
make test-pytorch
If you get an error during the tests and want to debug, the tests are written using pytest, so to drop into the python debugger on errors, run:
. venv/bin/activate
pytest tests/test_you_want_to_run.py --pdb
Style¶
To run the autoformatting (using isort
and black
) and style checks
(using flake8
), run
make format
Documentation¶
To build the documentation locally (the docs are written for and built with
Sphinx, this command creates html files in the
docs/_html
directory, the main page being docs/_html/index.html
), run:
make docs
Contributing your changes¶
Then if you want to contribute your changes, make a pull request!