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-mobility

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 Doxygen installed to generate the docstrings:

sudo apt install doxygen 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_mobility-5.3.5.tar.gz (140.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dsf_mobility-5.3.5-cp312-cp312-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.12Windows x86-64

dsf_mobility-5.3.5-cp312-cp312-manylinux_2_39_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

dsf_mobility-5.3.5-cp312-cp312-macosx_15_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

dsf_mobility-5.3.5-cp310-cp310-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.10Windows x86-64

dsf_mobility-5.3.5-cp310-cp310-manylinux_2_39_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

dsf_mobility-5.3.5-cp310-cp310-macosx_15_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

File details

Details for the file dsf_mobility-5.3.5.tar.gz.

File metadata

  • Download URL: dsf_mobility-5.3.5.tar.gz
  • Upload date:
  • Size: 140.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for dsf_mobility-5.3.5.tar.gz
Algorithm Hash digest
SHA256 85a6e13218a712a7853755f968a368e2883cc431129cedb02d7db456eb08f30b
MD5 b67ab1d18b85002f20e3d104f0dff660
BLAKE2b-256 fb27cbe5efe7da74b2edb126e1c6e965883dc04901e43065a175d1d8ea027bbc

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.3.5-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for dsf_mobility-5.3.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ff9c8d7eab60b1d9ff3f72015fcb2f3c8ab4268d586be198ffff09746498d754
MD5 9b6d64870b8be8b769593696589ce867
BLAKE2b-256 3524a6a6c805bd274004fe89d3bdda53dbe8a050cede3702c94e8a00f582bb2a

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.3.5-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for dsf_mobility-5.3.5-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 bd5ddf2ee84f6742d4f618d0d9fd026248022efcef8176c3adb1662da3170d4c
MD5 682ccb5bb963af3fa92588ef2f4f677f
BLAKE2b-256 c6833cd27e7cb758ecdef18f0a19078daa7e4505e70ea6d9abf7bb827d81d5b6

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.3.5-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for dsf_mobility-5.3.5-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 a2ea990916b09a9bbaec7ecce980e07a62ad8aedb36b92cefba1de3f3391e564
MD5 508f417cd2e4f8cadbb276f7c8c833d0
BLAKE2b-256 9c85c22e951136182689b4159ac189dd272fef8f771a4957d544f6e62907cc5a

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.3.5-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for dsf_mobility-5.3.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d0c189d314476786670181edc91c71d3381b2f679e048d131f09924d4ce5ddd5
MD5 4e689f0db58dc92f4c76a79fdf395229
BLAKE2b-256 d82efdef7ab6d91ccf5ae56d193d8014156636e7168f6a5915eba4a211265ec0

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.3.5-cp310-cp310-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for dsf_mobility-5.3.5-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 00925ae0e4ae57326af058bdd7cf64dde36c6197addc496550a203f8d9651317
MD5 bf4e45f0b2e2623a1c12a969002bce17
BLAKE2b-256 4548309a3a478554364345fd357dc42012e5f14645795abaa5f762d3ebb2fcbf

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.3.5-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for dsf_mobility-5.3.5-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d7e9c4063ba29b6731735d7bd17400b2e723e2c5a62849c2d9a08f373b5bc013
MD5 efcb3ffdd04c5780a134e0a0ea82a877
BLAKE2b-256 e7a37f8bdf5facfb1ef75db0dcc9d09d89c678b0c1f510ac5f3d15d2e591027a

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