semvec/pypi-packages huggingface dataset:
bmm 1.3
Bayesian Map-matching

# bmm: Bayesian Map-Matching
Map-matching using particle smoothing methods.

[Docs](https://bmm.readthedocs.io/en/latest/) and [methodology](https://arxiv.org/abs/2012.04602).

## Install
```
pip install bmm
```

## Load graph and convert to UTM
UTM (Universal Transverse Mercator) is a commonly used projection of spherical longitude-latitude
coordinates into square x-y coordinates.
```python
import numpy as np
import pandas as pd
import osmnx as ox
import json

import bmm

graph = ox.graph_from_place('Porto, Portugal')
graph = ox.project_graph(graph)
```

## Load polyline and convert to UTM
```python
data_path = 'simulations/porto/test_route.csv'
polyline_longlat = json.loads(pd.read_csv(data_path)['POLYLINE'][0])
polyline_utm = bmm.long_lat_to_utm(polyline_longlat, graph)
```
or generate fake data
```python
fake_route, fake_polyline_utm = bmm.sample_route(graph, timestamps=15, num_obs=25)
```

## Offline map-matching
```python
matched_particles = bmm.offline_map_match(graph, polyline=polyline_utm, n_samps=100, timestamps=15)
```

## Online map-matching
```python
# Initiate with first observation
matched_particles = bmm.initiate_particles(graph, first_observation=polyline_utm[0], n_samps=100)

# Update when new observation comes in
matched_particles = bmm.update_particles(graph, matched_particles, new_observation=polyline_utm[1], time_interval=15)
```

## Plot
```python
bmm.plot(graph, particles=matched_particles, polyline=polyline_utm)
```
![porto_mm](simulations/porto/test_route.png?raw=true "Map-matched route - Porto")
mosaik.CSV-SemVer 1.0.4rc20211006105348
Presents CSV datasets to mosaik as models.

mosaik-csv
==========

This is pseudo simulator that presents CSV data sets to mosaik as models.

Prerequisites
-------------

If installation of psutil fails, installing python developer edition and gcc should help::

    $ sudo apt-get install gcc python3-dev

Tests
-----

You can run the tests with::

    $ git clone https://bitbucket.org/mosaik/mosaik-csv
    $ cd mosaik-csv
    $ python3.8 -m venv venv
    $ venv/bin/python -m pip install -r requirements.txt
    $ venv/bin/python -m tox -e py38

Installation
------------

You can install mosaik system-wide like so:

::

    $ pip install mosaik-csv


Changelog
=========

1.0.3 – 2019-10-10
------------------

- [CHANGE] Added closing of input file.
- [CHANGE] Adjustment to new arrow API.


1.0.2 – 2014-09-22
------------------

- [CHANGE] Updated to mosaik-api 2.0.


1.0.1 – 2014-06-23
------------------

- [CHANGE] Updated to mosaik-api 2.0a3.


1.0 – 2014-03-26
----------------

- Initial release


Authors
=======

The mosaik CSV reader was created by Stefan Scherfke.