Skip to main content

Simulates a dispatching algorithm serving exogenous transportation requests with a fleet of vehicles. Does not simulate the universe, unlike MATSim. Batteries are included.

Project description

Code style: black Tests Docs wheel sdist

RidePy

Simulates a dispatching algorithm serving exogenous transportation requests with a fleet of vehicles. Does not simulate the universe, unlike MATSim. Batteries are included.

The extensive documentation is available at ridepy.org. This includes a high-level overview, as well as a glossary and a detailed reference.

The source code is hosted on GitHub.

Instructions

Prerequisites

  • Python 3.9

  • git

You should probably use an environment. For example, using conda:

conda create -n ridepy python=3.9
conda activate ridepy

Finally, a C++ build environment and the Boost C++ Libraries are necessary if you want or need to build the Cython/C++ part from source. This step can be skipped when installing the Python Wheel via pip on supported platforms (currently only x86-64 Linux).

On Debian-based Linux distributions, these dependencies may be installed as follows:

sudo apt-get update && sudo apt-get -y install libboost-all-dev build-essential

User Installation

Just run

pip install ridepy

If you prefer, you can also use clone the git repository instead:

git clone --recurse-submodules https://github.com/PhysicsOfMobility/ridepy.git
cd ridepy
pip install -e .

Developer Installation

git clone --recurse-submodules https://github.com/PhysicsOfMobility/ridepy.git
cd ridepy
pip install -e ".[dev,doc]"
make -C doc html
pre-commit install
pytest

The built documentation can be found in doc/_build/html/index.html.

First Steps

  • Start jupyter notebook or jupyter lab

  • Open one of the introductory notebooks in the notebooks subdirectory, either just by clicking on it (in jupyter notebook) or right-clicking and choosing Open With > Notebook (for jupyter lab).

  • Run the notebook step-by-step and play around :)

Reporting a Problem

Should you encounter any problems when using RidePy or have a feature request, please don’t hesitate to submit an issue.

Contributing

Generally, branch off from master, implement stuff® and file a pull request back to master. Feel free to do the latter at an early stage using the GitHub’s “Submit Draft” feature.

Versioning Philosophy:

  • master should always improve. Incomplete functionality is welcome.

  • API-breaking changes imply transition to a new major version

  • We use Semantic Versioning

Code style is black for Python and LLVM for C++. To format your code, use

  • black . for Python. Make sure to use the correct version as specified in pyproject.toml. It is automatically installed when installing the dev extras via pip install -e .[dev]. Also, consider using the pre-commit hook (pre-commit install).

  • find . -regex '.*\.\(cxx\|h\)' -exec clang-format -style=file -i {} \; for C++

Testing

  • For each new feature introduced, tests should be written, using the pytest framework

  • Running tests is easy—just execute pytest in the project directory

  • Additional pointers for running pytest:

    • Drop into a debugger on failing test using pytest --pdb

    • Show stdout with pytest -s

    • Run only specific tests by matching the test function name pytest -k <match expression>

    • Be more verbose with pytest -v

  • Warning 1: Pytest may cause confusion as it automagically imports stuff and supplies functions with things they need based on their signature. For this, see e.g. the docs on fixtures.

  • Warning 2: Warning 1 applies in particular to stuff hiding in innocent-looking files named conftest.py. See docs on conftest.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ridepy-2.1.post7.tar.gz (102.3 kB view hashes)

Uploaded Source

Built Distribution

ridepy-2.1.post7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.4 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page