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.1.tar.gz (169.3 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.1-cp314-cp314-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.14Windows x86-64

dsf_suite-6.2.1-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.1-cp314-cp314-macosx_15_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

dsf_suite-6.2.1-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.1-cp313-cp313-macosx_15_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

dsf_suite-6.2.1-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.1-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.1.tar.gz.

File metadata

  • Download URL: dsf_suite-6.2.1.tar.gz
  • Upload date:
  • Size: 169.3 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.1.tar.gz
Algorithm Hash digest
SHA256 d1482e0c5b977267978490a89472a7069ba4c932d069f38276c20458a9a854dc
MD5 6315d68456ae2f7b39166fc31730e3bd
BLAKE2b-256 216b60ebc5b7556f1eb6fa3412a95900084ba75d7bb848d6b2f494dd352d8438

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dsf_suite-6.2.1-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.12.13

File hashes

Hashes for dsf_suite-6.2.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 b98bfd3a0acf0e05e804b9fe15ce170af13a5dddab25f6da6514963c93f872f8
MD5 f8612b8ee109284f6dbbd621cb4850fb
BLAKE2b-256 4c1d30ef53991128ed102d41c79c44403d34c5d0d168e2869a5813df144f5df8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.2.1-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 09d765154ea649b902a339760885502868a54fb83c725c471e8569168ca656d0
MD5 d4173992ba33d94807f11e6fca9bac45
BLAKE2b-256 2beee2fbb03a6e808619a6cf0c99138a229903bbaf852dc1da19a76e0c9b9c40

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.2.1-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 c51106cad205403caa1058dff50e72ed797dd1b1e509b479d6a14c719b960352
MD5 3b8d578218fc6abea68633467e6c387d
BLAKE2b-256 46171b3b6ebf4e87ef5e419b260f4527d9603af43fe14130169a615647941322

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dsf_suite-6.2.1-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.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 62c5540a648c0ed706ed16a1cb301f097b8205dcf8793fe027fb528dcb901164
MD5 aca9581f8c3102a81b58d7505c1e3670
BLAKE2b-256 e30eb13be36efa60c3f2fd4e5a97ec82f12d24ea1d9d46960d819b260b0950c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.2.1-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8de90fcd0e351f20e02b8b8a52391d66d2facdbbeb6c1af0bcce8c8ed1c6544e
MD5 60511e934949b961b4ecd8b666fa1396
BLAKE2b-256 92c351de5eafd0b97f06f75eff3a29b61cba8eacf02525370d6b452ce8646816

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.2.1-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d6afaa9cafc7c9085e53673fc5087ba4f74a56b398ee300f4679ff6601d31d20
MD5 4eeb65305b4d8dcdc4f8f6893bfa717e
BLAKE2b-256 18d7ccb8d58a99729ec7adaf342c4f0f8a5c3f3322aeba6e3e748bf069f60414

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dsf_suite-6.2.1-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.12.13

File hashes

Hashes for dsf_suite-6.2.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8a07b71e6f453055e4e7a8dfcd54fb8c49c0d68fa8647699787c54b15914f185
MD5 c9ccadd0c3694b036724ac722f60d6de
BLAKE2b-256 ccf80db3578506b14aa5bd3ac8166fbee9c07fd6fe765c6435530b6f5b7e7279

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.2.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 dbcc0e3b4856986c4d2156557e3773234efa6675647d236f2c380db4eac48c91
MD5 49e101dfc75966e852e18bd84811b4c6
BLAKE2b-256 08d5dc74b59e0078c7d42e49c3e67a4880189ac28a70dd4f00f8b4e88aaf5218

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.2.1-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 fceea298c791fdba34bb87897a30f24a08f62c8fe6c434ffaa7405d442603a5f
MD5 64bf80b766710929876dee00b7691556
BLAKE2b-256 5e23018538449cf7fe8294a2a995fc249c65f65d7ded6846ad27d9d26a9de4be

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