Contributing to Cvxportfolio

Cvxportfolio is a collaborative project. Its development is hosted on Github at this repository.

You can open bug reports using the issue tracking system there.

The following is copied from the README file on the repository.

Contributions

We welcome contributors and you don’t need to sign a CLA. If you don’t have a Github account you may also send a git patch via email to the project maintainer.

Bug fixes, improvements in the documentations and examples, new constraints, new cost objects, …, are good contributions and can be done even if you’re not familiar with the low-level details on the library. For more advanced contributions we recommend reading the TODOs and roadmap file.

Development

To set up a development environment locally you should clone the repository (or, fork on Github and then clone your fork)

git clone https://github.com/cvxgrp/cvxportfolio.git
cd cvxportfolio

Then, you should have a look at our Makefile and possibly change the PYTHON variable to match your system’s python interpreter. Once you have done that,

make env
make test

This will replicate our development environment and run our test suite.

You activate the shell environment with one of scripts in env/bin (or env\Scripts on Windows), for example if you use bash on POSIX

source env/bin/activate

and from the environment you can run any of the scripts in the examples (the cvxportfolio package is installed in editable mode). Or, if you don’t want to activate the environment, you can just run scripts directly using env/bin/python (or env\Scripts\python on Windows) like we do in the Makefile.

Additionally, to match our CI/CD pipeline, you may set the following git hooks

echo "make lint" > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
echo "make test" > .git/hooks/pre-push
chmod +x .git/hooks/pre-push

Code style and quality

Cvxportfolio follows the PEP8 specification for code style. This is enforced by the Pylint automated linter, with options in the Pyproject configuration file. Pylint is also used to enforce code quality standards, along with some of its optional plugins. Docstrings are written in the Sphinx style, are also checked by Pylint, and are used to generate the documentation.