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

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_suite-6.0.4.tar.gz (160.5 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.0.4-cp314-cp314-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.14Windows x86-64

dsf_suite-6.0.4-cp314-cp314-win32.whl (1.6 MB view details)

Uploaded CPython 3.14Windows x86

dsf_suite-6.0.4-cp314-cp314-manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

dsf_suite-6.0.4-cp314-cp314-macosx_15_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

dsf_suite-6.0.4-cp312-cp312-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.12Windows x86-64

dsf_suite-6.0.4-cp312-cp312-win32.whl (1.6 MB view details)

Uploaded CPython 3.12Windows x86

dsf_suite-6.0.4-cp312-cp312-manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

dsf_suite-6.0.4-cp312-cp312-macosx_15_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for dsf_suite-6.0.4.tar.gz
Algorithm Hash digest
SHA256 d489bcad50e08605ed21c691b874f6e4a08060c2cebd1c5647641f22902d32e6
MD5 79a301efb1d1d95797f932e19df3bf6b
BLAKE2b-256 7a28d393ed97336c1160f3ca6adb083c2c2b3754b39b26acd3205b1a8ff03cf7

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dsf_suite-6.0.4-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 e5c2ddb7006271a0eea17d502c93277955d0bad815d2d0ec8d602ce0b8ba298c
MD5 b6ef6751a1d520005851ab95995606de
BLAKE2b-256 0d4a2fd4acf9c53722d9bffd9721d96962ca1acbd970f8126f8aaa316911c602

See more details on using hashes here.

File details

Details for the file dsf_suite-6.0.4-cp314-cp314-win32.whl.

File metadata

  • Download URL: dsf_suite-6.0.4-cp314-cp314-win32.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.14, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for dsf_suite-6.0.4-cp314-cp314-win32.whl
Algorithm Hash digest
SHA256 00e65a3b9f0649905125d85816f7b24920c5217c1792f16b5861eca38b47b717
MD5 6f5901459dabca7792b949d748b2e4b5
BLAKE2b-256 e5b826d788e5341dd61e68244e57c38f9c45ab23466fa2edea3236c9bd97fc23

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.0.4-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 88bb472cac6b099f71bdb31d2250d97ebec0981e4e5900b2702908c275cd98cd
MD5 5343b7c8a9d32c65e58f70b56620d0cc
BLAKE2b-256 48835ca80f7de19a1b9ffd52532ec4c9e225875cbc9a4646071162d8ad13e3a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.0.4-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 177c0920d0d862537efc42d8272690fcc7f5ecabf1f80fbc8e22bc9f606319b7
MD5 5c7a8f4bfcb93ee0ad4b8777439f33bb
BLAKE2b-256 bedc6d35e2c26ca0cd50dd64f81643958f70ae788881914836f10649a9b77573

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dsf_suite-6.0.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0a9f56e3277941895b856c0f472a8c175d73cf0204faee4911c6840040e59193
MD5 639dfa52545a71eb5e06c5868c981a6b
BLAKE2b-256 d4ff62cf6cb90c0c107b060458d65f31e496b8bf023d70bb65dd16f33279b16c

See more details on using hashes here.

File details

Details for the file dsf_suite-6.0.4-cp312-cp312-win32.whl.

File metadata

  • Download URL: dsf_suite-6.0.4-cp312-cp312-win32.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for dsf_suite-6.0.4-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 d91acdc4419b8144319cbe5bf9ab6bdd7b36ec6cdb96b3275827bfe3e53818ad
MD5 16d021127a5ed850b7849d719f8ea010
BLAKE2b-256 48dd93e5a36db01ff2af97af4f3f15cc636fd4f50155a610699a9feb5ff61570

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.0.4-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8c664751ac9d9be81ba62e683c993d3054fc7414f6bb697857f7edd1bb96ccf5
MD5 5237a11a530416723ef2ff16d6efca8d
BLAKE2b-256 dda1dc76a3684ec120a6e9ac99b711ba9f8d2ec7d9498732889c83e564aa953f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.0.4-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8791d04b4f68b801ff28052031c95e491157c18dad18d796f019e0eee72cd330
MD5 06a1ae3b06eff64af93036c63f0a5a08
BLAKE2b-256 14142afa4342d9da5b21e38d46170ffce38c0c10d47a0abbef047ef270716889

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