Metadata-Version: 2.4
Name: opentnsim
Version: 2.2.2
Summary: The OpenTNSim package aims to facilitate the analysis of network performance for different network configurations, fleet compositions and traffic rules.
Project-URL: Homepage, https://github.com/TUDelft-CITG/OpenTNSim
Author-email: Mark van Koningsveld <m.vankoningsveld@tudelft.nl>
License-Expression: MIT
License-File: AUTHORS.rst
License-File: LICENSE.txt
Keywords: OpenCLSim,OpenTNSim,simulation,transport
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Requires-Python: <4,>=3.12
Requires-Dist: click<9,>=8.1.8
Requires-Dist: deprecated>=1.2.18
Requires-Dist: geopandas>=1.0.1
Requires-Dist: matplotlib>=3.10.1
Requires-Dist: networkx>=3.4.2
Requires-Dist: openclsim>=1.6.2
Requires-Dist: pandas>=2.2.3
Requires-Dist: pytz>=2025.2
Requires-Dist: pyyaml>=6.0.3
Requires-Dist: requests-cache>=1.2.1
Requires-Dist: scipy>=1.15.2
Requires-Dist: shapely>=2.1.0
Requires-Dist: simplekml>=1.3.6
Requires-Dist: simpy>=4.1.1
Requires-Dist: sphinx>=7.4.7
Requires-Dist: tqdm>=4.67.1
Requires-Dist: xarray>=2025.3.1
Provides-Extra: testing
Requires-Dist: anywidget; extra == 'testing'
Requires-Dist: colorcet>=3.1.0; extra == 'testing'
Requires-Dist: cython>=3.1.0; extra == 'testing'
Requires-Dist: fiona>=1.10.1; extra == 'testing'
Requires-Dist: folium>=0.19.5; extra == 'testing'
Requires-Dist: ipykernel>=6.29.5; extra == 'testing'
Requires-Dist: ipyleaflet>=0.19.2; extra == 'testing'
Requires-Dist: ipywidgets>=8.1.7; extra == 'testing'
Requires-Dist: jsonschema>=4.23.0; extra == 'testing'
Requires-Dist: jupyter-book<2,>=1.0.4.post1; extra == 'testing'
Requires-Dist: jupyter>=1.1.1; extra == 'testing'
Requires-Dist: jupyterlab-widgets>=3.0.15; extra == 'testing'
Requires-Dist: lonboard>=0.11.1; extra == 'testing'
Requires-Dist: mapclassify>=2.10.0; extra == 'testing'
Requires-Dist: momepy>=0.10.0; extra == 'testing'
Requires-Dist: movingpandas[smoothing,viz]>=0.22.4; extra == 'testing'
Requires-Dist: nbconvert>=7.16.6; extra == 'testing'
Requires-Dist: nbmake>=1.5.5; extra == 'testing'
Requires-Dist: notebook>=7.4.2; extra == 'testing'
Requires-Dist: openpyxl>=3.1.5; extra == 'testing'
Requires-Dist: pyarrow; extra == 'testing'
Requires-Dist: pytest-cov>=6.1.1; extra == 'testing'
Requires-Dist: pytest-datadir>=1.6.1; extra == 'testing'
Requires-Dist: pytest-timeout>=2.3.1; extra == 'testing'
Requires-Dist: pytest>=8.3.5; extra == 'testing'
Requires-Dist: pyyaml>=6.0.2; extra == 'testing'
Requires-Dist: sphinx-rtd-theme>=3.0.2; extra == 'testing'
Description-Content-Type: text/markdown

[![Documentation](https://img.shields.io/badge/sphinx-documentation-informational.svg)](https://opentnsim.readthedocs.io/)
[![License: MIT](https://img.shields.io/badge/License-MIT-informational.svg)](https://github.com/TUDelft-CITG/Transport-Network-Analysis/blob/master/LICENSE.txt)
[![DOI](https://zenodo.org/badge/145843547.svg)](https://zenodo.org/badge/latestdoi/145843547)

[![CircleCI](https://dl.circleci.com/status-badge/img/gh/TUDelft-CITG/OpenTNSim/tree/master.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/TUDelft-CITG/OpenTNSim/tree/master)

# OpenTNSim

**Open** source **T**ransport **N**etwork **Sim**ulation -  Analysis of traffic behaviour on networks for different traffic scenarios and network configurations.

Documentation can be found: [here](https://opentnsim.readthedocs.io/)

## Book

<a href="https://happy-bush-0c5d10603.1.azurestaticapps.net"><img src="docs/_static/book.png" style="max-width: 50vw;"></a>

You can find the opentnsim book, based on the examples in the `notebooks` folder on the [opentnsim-book](https://happy-bush-0c5d10603.1.azurestaticapps.net/) website.

## Installation

### Quick Start

**Prerequisites:**
- Python 3.12 or higher
- pip
- Dependency manager: Poetry or uv (Only need one of them)

If you do not have [pip](https://pip.pypa.io) installed, this [Python installation guide](http://docs.python-guide.org/en/latest/starting/installation/) can guide you through the process. You can read the [documentation](https://opentnsim.readthedocs.io/en/latest/installation.html) for other installation methods and a more detailed description. 

It is recommended to use either Poetry or uv for as dependency manager. For help on installing, using and trouble shooting these dependencymanagers see `Virtual Environments basics` folder on  [opentnsim-book](https://happy-bush-0c5d10603.1.azurestaticapps.net/).

#### User 
To install OpenTNSim, you can choose how to install it into your system
The set of commands show the three options for pip, Poetry and uv. Choose your desired installation method and enter the corresponding commands in the terminal:

``` bash
# using pip
pip install opentnsim

# using Poetry
poetry add opentnsim

# using uv
uv add opentnsim

```

Then also install the extra dependencies used for testing and notebook support:
``` bash
# using pip
pip install opentnsim[testing]

# using Poetry
poetry add opentnsim[testing]

# using uv
uv add opentnsim[testing]
```

#### Local Development: Contributing & Notebooks
If you want to contribute or run notebooks follow the steps below:

**Clone the repository**
Clone the repository and navigate to the location on your local machine
``` bash
# Use git to clone OpenTNSim
git clone git://github.com/TUDelft-CITG/OpenTNSim
cd opentnsim
```

**Using uv**
install packages.This will also automatically create your virtual environment under .venv
``` bash
uv sync --extra testing
```
**Using Poetry**
``` bash
poetry install --extras testing
```

Activate your virtual environment:
``` bash
# Linux
source .venv/bin/activate

# Windows
source .venv\Scripts\activate
```

You can now run scripts or tests:
```bash
## run specific python script
python script.py

# run all tests
pytest

# run single tests
pytest -k test_graph

# run notebooks tests
pytest --nbmake ./notebooks --nbmake-kernel=python3 --ignore ./notebooks/cleanup --ignore ./notebooks/student_notebooks --ignore ./notebooks/broken

# run with coverage
pytest --cov=opentnsim
```
### Working with Jupyter Notebooks

1. Check if Jupyter extension is installed with  `poetry show ipykernel` or `uv pip show ipykernel`.
2. Open any `.ipynb` file
3. Select "opentnsim" kernel. Should look something like: `opentnsim-py3.13`.

## Examples
The benefit of OpenTNSim is the generic set-up. A number of examples are presented in in the `notebooks` folder on the [opentnsim-book](https://happy-bush-0c5d10603.1.azurestaticapps.net/) website. Additional examples can be found in the notebooks-folder in this repository. 

## Book

Based on the examples and docs a book can be generated using the commands `make book` and cleaned up using `make clean-book`. These commands are unix only.

## Code quality
Code quality is checked using sonarcloud. You can see results on the [sonarcloud](https://sonarcloud.io/project/overview?id=TUDelft-CITG_OpenTNSim) website. For now we have disabled coverage and duplication checks. These can be enabled when we include coverage measurements and reduce duplication by optimizing the tests.

## OpenCLSim 
OpenTNSim makes use of the [OpenCLSim](https://github.com/TUDelft-CITG/OpenCLSim) code. Both packages are maintained by the same team of developers. You can use these packages together, and combine mixins from both packages. When you experience a problem with integrating the two packages, please let us know. We are working towards further integrating these two software packages.



