Skip to main content

Library for comparing routing models

Project description

Routy

Comparing routing algorithms made easy

Ever worked on your reinforcement learning routing algorithm and wondered how on earth it is performing? How do you convince someone you are actually providing a better solution than their existing heuristics?

Routy is the library to help you do exactly that.

Usage

Installation

Install your library.

pip install routy

Examples

Import the library

from routy import Comparison

Initialize your comparison object.

comparison = Comparison()
  • plot_route

After you have gotten the suggested route by your model, pass the coordinates, the suggested route, and optionally the file name in the plot_route method. This method saves an image at the filename.png file displaying the route your model suggested.

coordinates = [(0, 0), (1, 1), (2, 2), (3, 0), (1, -1)]
route = [0, 1, 2, 3, 4]
filename = "myroute"
comparison.plot_route(coordinates, route, filename)
  • plot_routes

Let's say you have more than one model and you want to compare the route each model suggests for the same coordinates. You can do that using the 'plot_routes' function.

coordinates = [(0, 0), (1, 1), (2, 2), (3, 0), (1, -1)]
route1 = [0, 1, 2, 3, 4]
route2 = [1, 2, 0, 4, 3]

# Pass multiple routes as a list
all_routes = [route1, route2]
comparison.plot_routes(coordinates, all_routes, filename)

All available methods

You can find all the available methods documented here. This is autogenerated documentation, so you can take its word more seriously :)

Development

Want to create a pull request? This section is for you.

Documentation is important

Create documentation by running this command at project folder.

pdoc --html --force . ./comparison.py 

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

routy-0.1.2.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

routy-0.1.2-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file routy-0.1.2.tar.gz.

File metadata

  • Download URL: routy-0.1.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for routy-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3730c9db7ddf168122a3e5efcf2ce96ef5b8a7fc0a58b5881271136a882566bb
MD5 9d95c4ee06a60bb66cafef929f0525d8
BLAKE2b-256 ded9f68848f4a2d2f4b777b9e57ac18b953573df155c4e231121f1cf9e388816

See more details on using hashes here.

File details

Details for the file routy-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: routy-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for routy-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cc680034b85bcd02b608e1e053e01cd616326a951c1df1c98c010efe33c5aae2
MD5 d38da7302cf28c6b7c55e47a729705b1
BLAKE2b-256 ad87cbeec2231cd41ce6292179072dd9b599b6eaf3a04a6fa3a83a0fe4907405

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