Skip to main content

DSF C++ core with Python bindings via pybind11

Project description

DynamicalSystemFramework

Latest Release PyPI version DOI

Standard TBB SPDLOG CSV JSON SQLite codecov

The aim of this project is to rework the original Traffic Flow Dynamics Model. This rework consists of a full code rewriting, in order to implement more features (like intersections) and get advantage from the latest C++ updates.

Table of Contents

Installation

The library is available on PyPI:

pip install dsf-mobility

To check the installation you can simply run

import dsf

print(dsf.__version__)

Installation (from source)

Requirements

The project requires C++20 or greater, cmake, tbb simdjson, spdlog, csv-parser and SQLiteCpp. To install requirements on Ubuntu:

sudo apt install cmake libtbb-dev

To install requirements on macOS:

brew install cmake tbb

Utilities are written in python. To install their dependencies:

pip install -r ./requirements.txt

Installation (C++)

The library can be installed using CMake. To build and install the project in the default folder run:

cmake -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build -j$(nproc)
sudo cmake --install build

Otherwise, it is possible to customize the installation path:

cmake -B build -DCMAKE_INSTALL_PREFIX=/path/to/install

then building and installing it (eventually in sudo mode) with:

cmake --build build
cmake --install build

Installation (Python)

If you want to use the library from Python, you can build the Python bindings using pybind11. Make sure you have tbb installed:

sudo apt install libtbb-dev

Then, the installation is automatic via uv:

uv build

or you can just use the classic pip:

pip install .

After installation, you should be able to import the module in Python:

import dsf

print(dsf.__version__)

If you encounter issues, ensure that the installation path is in your PYTHONPATH environment variable.

Testing

This project uses Doctest for testing.

If the project is compiled in Debug or Coverage mode, tests are always built. Otherwise, you can add the -DDSF_TESTS=ON flag to enable test build.

cmake -B build -DDSF_TESTS=ON
cmake --build build -j$(nproc)

To run the tests use the command:

ctest --test-dir build -j$(nproc) --output-on-failure

Benchmarking

Some functionalities of the library have been benchmarked in order to assess their efficiency.
The benchmarks are performed using Google Benchmarks. To build the benchmarks add the flag -DDSF_BENCHMARKS=ON :

cmake -B build -DDSF_BENCHMARKS=ON
cmake --build build -j$(nproc)

To run all the benchmarks together use the command:

cd benchmark
for f in ./*.out ; do ./$f ; done

Citing

@software{berselli_2026_18745492,
  author       = {Berselli, Gregorio},
  title        = {DynamicalSystemFramework},
  month        = mar,
  year         = 2026,
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.18745492},
  url          = {https://doi.org/10.5281/zenodo.18745492},
}

Bibliography

  • Mungai, Veronica (2024) Studio dell'ottimizzazione di una rete semaforica. University of Bologna, Bachelor's Degree in Physics [L-DM270]. Link to Thesis.
  • Berselli, Gregorio (2024) Advanced queuing traffic model for accurate congestion forecasting and management. University of Bologna, Master's Degree in Physics [LM-DM270]. Link to Thesis.
  • Berselli, Gregorio (2022) Modelli di traffico per la formazione della congestione su una rete stradale. University of Bologna, Bachelor's Degree in Physics [L-DM270]. Link to Thesis.

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

dsf_mobility-5.8.0.tar.gz (152.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dsf_mobility-5.8.0-cp312-cp312-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.12Windows x86-64

dsf_mobility-5.8.0-cp312-cp312-manylinux_2_39_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

dsf_mobility-5.8.0-cp312-cp312-macosx_15_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

dsf_mobility-5.8.0-cp310-cp310-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.10Windows x86-64

dsf_mobility-5.8.0-cp310-cp310-manylinux_2_39_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

dsf_mobility-5.8.0-cp310-cp310-macosx_15_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

File details

Details for the file dsf_mobility-5.8.0.tar.gz.

File metadata

  • Download URL: dsf_mobility-5.8.0.tar.gz
  • Upload date:
  • Size: 152.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for dsf_mobility-5.8.0.tar.gz
Algorithm Hash digest
SHA256 b3e1fa31173ae6568602a303784ae1edde5c6dce4542638c205eb4ce1e748d37
MD5 b668aae3ff0b4dbc7ee63e16a8407316
BLAKE2b-256 c3c2dd3870ab056cb2ef782bd9179ee7a0b79dfd1681e2fe44d53c1ef39b81f3

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.8.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for dsf_mobility-5.8.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 63d3969437fdbbd9587a8ec8f8ad103a04b2d04f407c5e14d3510b69f34d3c43
MD5 687b8583e5f9fe61dc6b2bc73abd00d0
BLAKE2b-256 4f9694d59746008754cdee6b8e8f1735e44dea10a694bd31995f50b9845388e1

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.8.0-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for dsf_mobility-5.8.0-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 6f01af3ba2600eb9848d9375b6f221e1d33ed3777b152f0820856a65ab08970b
MD5 d22f6016d9c276030c1001b24a419d48
BLAKE2b-256 f6c7705ed9d364c6e8e54eb5ad91dd4a743e6fa77526642f72d50638bcf06567

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.8.0-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for dsf_mobility-5.8.0-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 7a3bdb029c04b97c3464245cb5d1941cb9572b8da6b5162af79fc61c4a646905
MD5 3b7559e01e6658c8b48e3bec132961d7
BLAKE2b-256 9ca1c695784f76501b26d915f0c253991713dc376c5c40d15ca4300b3d22bc38

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.8.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for dsf_mobility-5.8.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 76db2742a47dcc2f8dd8c3f39f7602f63d40c6a672a5dff2a585b27b2217bdba
MD5 c0f331ad126fad52468fcbb8daaeff4c
BLAKE2b-256 a5dbbbd41268f13781a02685159a7b0312f5bc2b3f7df4ab99896dd1a3068fc6

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.8.0-cp310-cp310-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for dsf_mobility-5.8.0-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 b4eddbbfdaf93ae5ba16dd92daac495381792135fc263c2a7b17376c4beaa855
MD5 85bd99cd40d6bdcd4bebdbee78300af5
BLAKE2b-256 0ec5360cf90486f01d4e114992fce64baad97bd40941e8e39fda09d63479b92e

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.8.0-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for dsf_mobility-5.8.0-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 805e1229f904b22854ed899aed749868e8aa5909facd456fc9495bd971239339
MD5 466376a8a41f64c34db5bb62884880c1
BLAKE2b-256 4e3b09ace0443f19786ff5891dde3a2d5243a5ccfc223236cb8100307009f4fa

See more details on using hashes here.

Supported by

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