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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 15.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

dsf_suite-6.2.4-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.4-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.4.tar.gz.

File metadata

  • Download URL: dsf_suite-6.2.4.tar.gz
  • Upload date:
  • Size: 169.5 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.4.tar.gz
Algorithm Hash digest
SHA256 fe174e16d9f0c0645eff86adf9c8ed50af51ac82ac964b025d0131b1b6688628
MD5 1abb9bc26260147025727daa9f342064
BLAKE2b-256 039a9367da404c382288d25a22739c3a9049fac829cefcf72bbcc59fbf948449

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dsf_suite-6.2.4-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.4-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 08c8e2764ff1f3ced8ffc758b3382ea97a87031dcaad9431ba7d500ec3b493a8
MD5 702f495adb40c0f3cd049b95f9af56e8
BLAKE2b-256 53afb988c14ff857cc900b6cd90685536a757b7b24b0d8a2bfaf450e97261510

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.2.4-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 60991d0e686aa8bc73deb7deb4e07ee3ce2cc4484183dfc28740eced17ef3661
MD5 35e42858bc943f61943ebcc1c6bea3cf
BLAKE2b-256 1f72e87008f082e5a55b7f2b3a19bb32f86c363e32725b22456a3e80fc0bf553

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.2.4-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 c2ddd0378203a6248923b9a63154fe48bec1a37b835eea4f8598111d2214cd94
MD5 3186b8e65434cca1492e14cb8bcf3197
BLAKE2b-256 eb141203cdf363f41ac18a1e30d834babe5c145532a442d120570f5a5cc2cf91

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dsf_suite-6.2.4-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.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 04e85e1c118ab9e6c0638fe793f9a62fda7eb873ad4d5f6957ee57a7759fbc8c
MD5 8b04fad4f10a711cc9412ace5cc988bc
BLAKE2b-256 19b0539ae2f417ae3ee4bdc6c3b29d75d1e9f744e1fe24372125d504719ed30b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.2.4-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1fd0b5a379baba9099954364d0ef44d3c1e9e88db5d72e6854e974031923c976
MD5 7e11215327d586dba85d45639d37c126
BLAKE2b-256 6afb3a7b34e2adb68dd07de9c643bd52e4f36d3753d67ef0ae01e592da9f1199

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.2.4-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 38d6d7573f005e402b458bcaa65237e2d69ee0da806eee6345ed2b402109376c
MD5 8f1cb0c8740539b7ac9ef3135c4e75fd
BLAKE2b-256 3483979cea2910b9f671a074ee213ce97643ab7939ed5bea5e2410f6e13afadf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dsf_suite-6.2.4-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.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8aeddaee77af5fba69400482ae5b207953caa733e312d1090bed6786fd718d59
MD5 62844211cf777737702b43f2517d0452
BLAKE2b-256 348c1c972cbca94830303f68a4f0d0ead3996a346b4d6d518a7b96c8729870e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.2.4-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e265ffcf8d1cc1506551e39b806bd1103fa5e162b774c2eedf84a71e24e8e4d1
MD5 a27a7e651f71926dce727f205c624a35
BLAKE2b-256 499f1514743ffc181621c96cbffedbfce141b7e80c2bc1737df53c82ec217ec2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_suite-6.2.4-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 979add5e9981651f829aab02e53717984162d9b67c58086a27daa6c6c47d1365
MD5 8100d249af0a24ae40b330dd75582bbf
BLAKE2b-256 9b8de4f65c7fc28fb423ea8523759f29d978e5a399443a414efa72d5a4abb1f5

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