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.3.3.tar.gz (173.8 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.3.3-cp314-cp314-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.14Windows x86-64

dsf_suite-6.3.3-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.3.3-cp314-cp314-macosx_26_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.14macOS 26.0+ ARM64

dsf_suite-6.3.3-cp313-cp313-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.13Windows x86-64

dsf_suite-6.3.3-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.3.3-cp313-cp313-macosx_26_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.13macOS 26.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

dsf_suite-6.3.3-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.3.3-cp312-cp312-macosx_26_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.12macOS 26.0+ ARM64

File details

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

File metadata

  • Download URL: dsf_suite-6.3.3.tar.gz
  • Upload date:
  • Size: 173.8 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.3.3.tar.gz
Algorithm Hash digest
SHA256 686f77cc5ec4a7e186e96078ba0013191fdcf0841c79e8497810e3a32db4c83e
MD5 3474270e92d00468e35907d94ceac7bf
BLAKE2b-256 69543570b1bfd9bee3d37944b3055f7c97c5f866bc80c43a260a9592e413d0dc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dsf_suite-6.3.3-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.3.3-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 e9ac8342218cd8c8bbdb1c9cfbc4ab854758e8f1ee7aa49b09cac543da95c6b9
MD5 c0c9ab7879fb196e1b5b05f79fca58b5
BLAKE2b-256 dd895ef0f5f2a7cc2d1724349a617feb4041adbe909a5d6633be6ba2dff1a9bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.3.3-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 57f78c706b7721edf5d357b0cc70015627ef5d04eeb4046f969dfb5d94e4152f
MD5 5f79903674f6e2c4e3fd40aeb7ffa818
BLAKE2b-256 f32245874722a768ecc173c104d572994be9ba4852ecb6f25faa83a435027a2c

See more details on using hashes here.

File details

Details for the file dsf_suite-6.3.3-cp314-cp314-macosx_26_0_arm64.whl.

File metadata

File hashes

Hashes for dsf_suite-6.3.3-cp314-cp314-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 966ebe18924ef82b41caf90fda6899a91dbaba6c45bee6c754c3ffb88f7dd400
MD5 371652ed9377085be5a8fd7808cf1728
BLAKE2b-256 5bb36e01635c4b06f09c7a8ab9bef2907340cb83c05d086a22cf890cbf6f8a43

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dsf_suite-6.3.3-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.7 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.3.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7abd216edae238d5838c7fe8f7e2ba0a0fd4d0fb7f216a05455315244967357b
MD5 163010f393352d497cfde17c68a0caa3
BLAKE2b-256 a4bb377e26d983ff245f2df58a5fa34c0022a23fb04338233214554b7fb43a96

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.3.3-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4cd95f36d0e17bc38cf1c500045f18321409f7f3c1621810f0549d21fca7eabe
MD5 e5006c835b4ccf5cda703ab247adc723
BLAKE2b-256 88a52a1d66b35af8131e559b11dd6de2e4806a603c94c7aeeb7897ee7229bb7e

See more details on using hashes here.

File details

Details for the file dsf_suite-6.3.3-cp313-cp313-macosx_26_0_arm64.whl.

File metadata

File hashes

Hashes for dsf_suite-6.3.3-cp313-cp313-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 107674f971bd7cd24ed354ff30df83c63e706e579b035834f6862c4e5b934c35
MD5 83953cd260eede54ae79b593da10b7ba
BLAKE2b-256 7ca2e67467930e30108205b0effb9c908a9e71241a0b31c9f2d070ceb5eecbeb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dsf_suite-6.3.3-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.3.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 beea3d005d01d7f7b9894be292d433d7ede553067b51c3c61d7f046971620266
MD5 00b84168c43b0d175d628982059964c7
BLAKE2b-256 4e936cb1edfce4a59939a46344f9ed27f1c174895c99339709246353ba5eb427

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.3.3-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e8f85c413fc279450380e96ff1a710624d133a666d7c7cf353312b0c743997af
MD5 261a57b32082f7f9bcd43da4ae9749bb
BLAKE2b-256 7e7eadb0a559fde7db77381c51cb12938aef191fc4fddfa5620bbe4e5186d94b

See more details on using hashes here.

File details

Details for the file dsf_suite-6.3.3-cp312-cp312-macosx_26_0_arm64.whl.

File metadata

File hashes

Hashes for dsf_suite-6.3.3-cp312-cp312-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 0cd6ffaf504dd9ccf6ca2b25e47cd6f70e70a00a182e106974707b6647ae0cb4
MD5 15b1ea265131fce84c20041bdfa4ebf9
BLAKE2b-256 3d6558e8b65441736b2c2c690f459c527aec156017f6a5971a8321fcaaf6194b

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