Skip to content

Latest commit

 

History

History
84 lines (77 loc) · 3.22 KB

README.md

File metadata and controls

84 lines (77 loc) · 3.22 KB

BRiM

A Modular and Extensible Open-Source Framework for Creating Bicycle-Rider Models.

This package is still under development, therefore there is no guarantee on backwards compatibility.

Installation

brim can either be installed from PyPI or from the development version on GitHub. If one installs from PyPI then one needs to install some (optional) dependencies manually.

pip install git+https://github.com/sympy/sympy.git
pip install brim

Optionally one can also install:

pip install git+https://github.com/moorepants/BicycleParameters.git
pip install git+https://github.com/TJStienstra/symmeplot.git

The development version can easily be installed using:

pip install git+https://github.com/TJStienstra/brim.git

In the last case the dependencies should be correctly handled by poetry.

Contributing

One of the aims when developing this package make it more easy for researchers to also share their bicycle-rider models for research dissemination and academic reproducibility. This goal is aided as follows. poetry is used to manage the dependencies. After installing poetry one can install the necessary dependencies for developing using:

poetry install

Testing

pytest is used for testing. To make sure that each feature introduced in brim is tested, we have set the code coverage to 100%. If a function should for some reason not be tested, then it should be ignored instead of reducing the obligated coverage percentage. Hint: if you like to have nice formatting when running pytest you can also install pytest-sugar. You can run the tests using:

pytest --cov

Linting

To make sure that the same code style is used among different contributors, there has been chosen to set up ruff. ruff is a fast Python linter, which makes sure that everyone uses for example the same spacing and writes some documentation for new features. Besides ruff we did decide to use type hinting in the function descriptions, but not within the functions. mypy has also been removed as it was mainly causing problems. To run ruff use:

ruff .

With pre-commit it is also possible to have some of the checks automatically done on committing a change. This can be set up by running the following:

pip install pre-commit
pre-commit install

Documentation

While you can trigger a build of the documentation manually using:

docs/make.bat html

It is also possible to have the documentation automatically build when a change is committed. This can be set up by running the following:

pip install sphinx-autobuild

and then running:

sphinx-autobuild docs docs/_build/html

A lot of the above settings are inspired by Hypermodern Python by Claudio Jolowicz and Setting up Python Projects by Johannes Schmidt. A tutorial by Aahil Mehta was followed to set up the documenation: Sphinx Tutorial.