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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14Windows x86

dsf_suite-6.0.2-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.2-cp314-cp314-macosx_15_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12Windows x86

dsf_suite-6.0.2-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.2-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.2.tar.gz.

File metadata

  • Download URL: dsf_suite-6.0.2.tar.gz
  • Upload date:
  • Size: 159.9 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.2.tar.gz
Algorithm Hash digest
SHA256 d182c77d5a8e9ed24e7f6605fe66cf90f4510ad0e0b7db750c53a87dcb6be14e
MD5 fd164eee06f5c69eff605b7498fc694a
BLAKE2b-256 acda7e919d971b2f3cb55216452818059d4c860ce826a698fb070962e2109171

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dsf_suite-6.0.2-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.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 e7d6225bce06316da60601f4500b7b29f1a89dd8e68b5cea3502ec1499ac85cc
MD5 b9f11b25ec7c83cf7047bb626185e016
BLAKE2b-256 5d22ace3458d3b1f4a3dd1a9040c4c5a06e92519d1d8532a1d748b6f6fe8cf32

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dsf_suite-6.0.2-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.2-cp314-cp314-win32.whl
Algorithm Hash digest
SHA256 e4b07041628bd8013b1e2f28e769b7f547a2479be1c06bfda8e26551a2f71003
MD5 124fdcfcb2bc45563f4d352ce62a1724
BLAKE2b-256 d48be56af55438495f3e7661c9b1cbe0a39a72994bb56113a02253e0c3deaaac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.0.2-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e56f5ddd1b5be7b006d60cac9bbb0be51f11905824954297b766027dc4d22600
MD5 6609864e3483bfd6db02526fe58ce619
BLAKE2b-256 a52b8d03e92f52061ad67227c69f1794d2c8f02351618e21b786815aceaa8620

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.0.2-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 6aa23b974081d7be72082256deb90eef4d1f048240d9b0d6447a14f5cc2a831a
MD5 5355000050264e2469d737c879a884eb
BLAKE2b-256 6980593978afa378b7a0eb8f07543ad22479711088ef228831da1ce9b206a745

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dsf_suite-6.0.2-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.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2aacfeaca1b2e6a539d63e2475b573d7478e472a4b1c95b806ce3fecab0e9ef8
MD5 d9e2166fa7aae8077a8a4e075a769a6a
BLAKE2b-256 c3eedf92e82f3493b51b242a4a2e17fb9c9ac87508e35b014827b539a68732de

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dsf_suite-6.0.2-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.2-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 672be708c7d0d6a8820c949b5bade59d7f6e38b1a14cfa5e189ac8724d1b38c7
MD5 74b4099ff8a9a9cbdabcd66c3fe37917
BLAKE2b-256 0f9e4cc62014f339d71292e1fd353c3a2e536322612e5a7212114ac858040a89

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.0.2-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 71727048c9df4899bdf9d31fc592dddd6b30f500f86f10009c983441ea596aca
MD5 d7304a72908c2314908c5f4ac959c67f
BLAKE2b-256 c8c2b524ccec6a40dbab381db7e1c7dfd0e466d8cdeee51ab2c4d90993e32c26

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.0.2-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ba02ee76b31a1895c777420a903d9b5d3d6d4bfa18f5baf909f372c758daff69
MD5 80b3dbc2df49e680ca72b02b88c71b23
BLAKE2b-256 58e1804dd96afbf22c16026726ac1ecf6ebb312f7b344e6dc1d4b3ad94914fe9

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