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 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_mobility-5.8.4.tar.gz (150.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_mobility-5.8.4-cp314-cp314-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.14Windows x86-64

dsf_mobility-5.8.4-cp314-cp314-manylinux_2_39_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ x86-64

dsf_mobility-5.8.4-cp314-cp314-macosx_15_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

dsf_mobility-5.8.4-cp312-cp312-manylinux_2_39_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

dsf_mobility-5.8.4-cp312-cp312-macosx_15_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for dsf_mobility-5.8.4.tar.gz
Algorithm Hash digest
SHA256 14e8e08b928a9d21ff0e820241a800466bdaeb58376d685cf3977e076e5b801b
MD5 08ff9185070bb4ca2f4a2264f4a8be35
BLAKE2b-256 f2f4fe705806306636f70d9d175ee65a5bd97531f2613faec53673f677a1fdcd

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.8.4-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for dsf_mobility-5.8.4-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 1b1126445d652540246d63a6fccf8f37635ac1b14dba9192c4ce04c3138b055e
MD5 d044d19dbeb0dd0f385e4be66c6c9b64
BLAKE2b-256 73f8a589ab52f83488b518b5d6b94eabbaac18c777a79dcf90a5e472c49c991a

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.8.4-cp314-cp314-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for dsf_mobility-5.8.4-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 97548dd77e33759001ed21a3785edc78d34cc87198bb27e336ca924bc766bd62
MD5 5c5eacb15cc75d67dff406c0d9ce7d5c
BLAKE2b-256 ee2fcdae7903e0a4b1a00838ed30ec2d3d1b9407543ce85629019109cac133d4

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.8.4-cp314-cp314-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for dsf_mobility-5.8.4-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 539c64df274135c802e4dd8e78c94e3f4d71928211b5e42bd550ba08fb2953ef
MD5 fe2a960eb81b66cee29d5416f0c6e4ac
BLAKE2b-256 ee27b3e835fba202b3ab563276eb27acc94998facbd9ce37bf61a3a847077638

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_mobility-5.8.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 355a52dbc38fb8b77509b905146785c01e443a4f8977e80424857f783820d883
MD5 e79689a8bf14c023fea090a073ae287a
BLAKE2b-256 8b9bad75f9450c9b970d0bde9420a75759f9e183b19cc8439f52c05776d0605b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_mobility-5.8.4-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 e4154d24f79eccb1693c8e285dd0e94957d42af6bf49695df2aa4b7e463c02fd
MD5 af305600ba28f38fe3784e50ac134f4d
BLAKE2b-256 959cad14c2e7679b41dc032a594b2e8a947417823436d03976e1796def702758

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_mobility-5.8.4-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 b959e4a0930bd3506c4a12dab4f038b279c4332de40c9182dce5724873389de8
MD5 d07d74508f77d50349695b46cd154860
BLAKE2b-256 410c1505eb33607eb8fa21f5b958e63f185a55e0810a7572f2516290da94e82b

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