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-suite

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

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.

For Developers

This project as a pre-commit configuration. To use it properly, please install:

pip install pre-commit
pre-commit install

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_suite-6.2.5.tar.gz (169.9 kB view details)

Uploaded Source

Built Distributions

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

dsf_suite-6.2.5-cp314-cp314-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.14Windows x86-64

dsf_suite-6.2.5-cp314-cp314-manylinux_2_28_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

dsf_suite-6.2.5-cp314-cp314-macosx_15_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

dsf_suite-6.2.5-cp313-cp313-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.13Windows x86-64

dsf_suite-6.2.5-cp313-cp313-manylinux_2_28_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

dsf_suite-6.2.5-cp313-cp313-macosx_15_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

dsf_suite-6.2.5-cp312-cp312-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.12Windows x86-64

dsf_suite-6.2.5-cp312-cp312-manylinux_2_28_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

dsf_suite-6.2.5-cp312-cp312-macosx_15_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

File details

Details for the file dsf_suite-6.2.5.tar.gz.

File metadata

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

File hashes

Hashes for dsf_suite-6.2.5.tar.gz
Algorithm Hash digest
SHA256 24b56a88284c5bfb2957e0149fd65a0a4f842760b2f5089d0e9a052e41dc5bd9
MD5 7a2e4388536168f068883013f0043460
BLAKE2b-256 a6955c41ab75b8b8918a7319e9e90994a9fb866241fcf67ac5dd61c405494211

See more details on using hashes here.

File details

Details for the file dsf_suite-6.2.5-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: dsf_suite-6.2.5-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for dsf_suite-6.2.5-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 a3b44d67c85260d7e1865c37314e0fd2473e065d077325dd0b42dcd7ff622b34
MD5 c9f4d7fd600e1cf48b4bdc44ee5e80ca
BLAKE2b-256 0b0dfb09c9d2b774ff03324e6fa3ea250a64dc669eeeadbc300432cda275c034

See more details on using hashes here.

File details

Details for the file dsf_suite-6.2.5-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dsf_suite-6.2.5-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cb7e7f04d50335971e0f6fc9eadf444524f86787dcda2de5bcf02278eab49255
MD5 977d522d559190cbeaea201f4a944252
BLAKE2b-256 03674fc3c8450bcac230ca22d14e0a64a65be0d4d32434888f4f7b2638b78547

See more details on using hashes here.

File details

Details for the file dsf_suite-6.2.5-cp314-cp314-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for dsf_suite-6.2.5-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 fd37b51cde023f423ecca8eda33680a4ab6fc64ed048e89313df065d26a2b480
MD5 b58ebf9d471d61a184ef1f79754b3ab6
BLAKE2b-256 82d003af7eb3e407161eaed34f2612952024f6776c5b0b4f151cecc3c362bd3c

See more details on using hashes here.

File details

Details for the file dsf_suite-6.2.5-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: dsf_suite-6.2.5-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for dsf_suite-6.2.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 bef534ccf09bd320a8ac379cb30695ab529f39c8f92b0f23bfc3b44f65068831
MD5 dee3b8cec08e59a2a91d23255f234220
BLAKE2b-256 818e6ce9fe5427747d1be367bca2227cad215f2ac426a75a067ed9ca1f25c34c

See more details on using hashes here.

File details

Details for the file dsf_suite-6.2.5-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dsf_suite-6.2.5-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 56973ac3deca2b9db64ffbad6ce98ce04e9118973690bcf637d848afe0ffab53
MD5 eba0f8ac2e3c337499d9616ec6f7d68f
BLAKE2b-256 4ffa3f168a0ea138abb278491027e4874cddbb3ed1e853e99e125729ad8739f7

See more details on using hashes here.

File details

Details for the file dsf_suite-6.2.5-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for dsf_suite-6.2.5-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 7e786b1963b23df9561b4241e5e6e1ca901d5539e126402f22a856d7d836c8a8
MD5 7ebe2347a53ff08c5baf3aa73a983b18
BLAKE2b-256 a3d4cb4646d69f88f6a7226a31a66aa3940cce1bfe9f280a25b3a050b0339c87

See more details on using hashes here.

File details

Details for the file dsf_suite-6.2.5-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: dsf_suite-6.2.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for dsf_suite-6.2.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 cb7acc477b7ec09b4d9c74c66dfbbd25c53e2a578bb2925052859b31d29fc6e0
MD5 72c948da9ccc700758c6231a73d958ea
BLAKE2b-256 e1ffa8bd1a37768bc40a9b536ffa3f490f02991e7173021cae9d1f4d9bed7839

See more details on using hashes here.

File details

Details for the file dsf_suite-6.2.5-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dsf_suite-6.2.5-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 409edb3298f0e8f9afe9145cb1b9fcea11f773c75694598262edeeb31dcc5817
MD5 0d1a52e2dbd38a39c113f457b26520f3
BLAKE2b-256 b736d02f0a4bf419202fae72d75a77e26c6a97f156e8b784729d0c8812d7ca00

See more details on using hashes here.

File details

Details for the file dsf_suite-6.2.5-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for dsf_suite-6.2.5-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d28302ffdd76766bcddadea2e846631a61579a0d2aa79505a1163f4be5e3b02c
MD5 ef92d8614bdd60e5946c6d638a86b3db
BLAKE2b-256 52ee325d492e84f14c5fb0e3d3b2020476e98c669a3a196577d1729d1149d1cf

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