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.
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 brimOptionally one can also install:
pip install git+https://github.com/moorepants/BicycleParameters.git
pip install git+https://github.com/TJStienstra/symmeplot.gitThe development version can easily be installed using:
pip install git+https://github.com/TJStienstra/brim.gitIn the last case the dependencies should be correctly handled by poetry.
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 installpytest 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 --covTo 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 installWhile you can trigger a build of the documentation manually using:
docs/make.bat htmlIt 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-autobuildand then running:
sphinx-autobuild docs docs/_build/htmlA 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.