If you are using lifelines for survival analysis and have a question about "how do I do X?" or "what does Y do?", the best place to ask that is either in our discussion channel or at stats.stackexchange.com.
We appreciate all bug reports submitted, as this will help the entire community get a better product. Please open up an issue in the Github Repository. If possible, please provide a code snippet, and what version of lifelines you are using.
Please open up an issue in the Github Repository with as much context as possible about the feature you would like to see. Also useful is to link to other libraries/software that have that feature.
If you are interested in contributing to lifelines (and we thank you for the interest!), we recommend first opening up an issue in the GitHub repository to discuss the changes. From there, we can together plan how to execute the changes. See the Development section below for how to setup a local environment.
- From the root directory of
lifelines
activate your virtual environment (if you plan to use one). - Install the development requirements and
pre-commit
hooks. If you are on Mac, Linux, or WindowsWSL
you can use the providedMakefile
. Just typemake
into the console and you're ready to start developing. This will also install the dev-requirements.
lifelines
uses the black
python formatter.
There are 3 different ways to format your code.
- Use the
Makefile
.make lint
- Call
black
directly and pass the correct line length.black . -l 120
- Have your code formatted automatically during commit with the
pre-commit
hook.- Stage and commit your unformatted changes:
git commit -m "your_commit_message"
- Code that needs to be formatted will "fail" the commit hooks and be formatted for you.
- Stage the newly formatted python code:
git add *.py
- Recall your original commit command and commit again:
git commit -m "your_commit_message"
- Stage and commit your unformatted changes:
You can optionally run the test suite after install with
py.test