Skip to main content

Weather-aware pathfinding for a mobile solar-car strategy system

Project description

pylon_pathfind

A lightweight, weather-aware pathfinding library designed for the IoT‑Powered Mobile Weather Observation Station project. It provides a clean API to compute shortest paths under dynamic penalties (e.g., rain, fog), and is ready to integrate on a Raspberry Pi.

Install (local)

pip install .   # from the project root (the folder with pyproject.toml)
# or
pip install /path/to/pylon_pathfind-0.1.0-py3-none-any.whl

Usage

from pylon_pathfind import PathFinder, WeatherPenalties

pf = PathFinder()

# (optional) replace default penalties
pf.set_weather_penalties(WeatherPenalties(clear=1.0, rain=1.2, heavy_rain=1.8, fog=1.4))

# Load edges (name, name, distance_km)
edges = [
    ("Winterveld", "Reefentse", 24.0),
    ("Reefentse", "Temba", 12.0),
    ("Temba", "Klipdrift", 16.0),
    ("Temba", "Marokoleng", 7.3),
]
pf.load_edges(edges)

# Mark weather on a specific road (u->v)
pf.set_edge_condition(("Temba", "Klipdrift"), "rain")

# Compute best route (returns node_names_path, total_cost)
path_names, total = pf.find_path("Winterveld", "Marokoleng")
print(path_names, total)

Key Concepts

  • Graph by names: You can work entirely with human‑readable names (no indices necessary).
  • Weather conditions: Attach a condition per directed edge; weights are multiplied by a penalty.
  • Pluggable algorithm: Uses Dijkstra by default (suitable for non-negative weights).

Raspberry Pi integration tips

  • The package depends only on networkx. It runs fine on Raspberry Pi OS (Python ≥ 3.9).
  • Keep the graph small and preloaded in JSON to avoid runtime parsing overhead.
  • For live weather, map your sensor stream (BME280, Anemometer, GPS) to set_edge_condition() calls before computing routes.

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

pylon_pathfind-0.1.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

pylon_pathfind-0.1.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file pylon_pathfind-0.1.0.tar.gz.

File metadata

  • Download URL: pylon_pathfind-0.1.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for pylon_pathfind-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a8de9af474cf7db67657f71d2d3e98da1bc1c3f54b12af832c2e949fed796813
MD5 d285c0c3d240c039c2ec8d3976c653cb
BLAKE2b-256 5a170fcfefad1e9f70d9adf690986a2ce49bc765c612879666c2311dd941f419

See more details on using hashes here.

File details

Details for the file pylon_pathfind-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pylon_pathfind-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for pylon_pathfind-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0653a7de80dad8a8568a7a8355e759709fb960043b7a72f4e8f5d03275d8ef8
MD5 d3f51e235890ecb99bca1d127c409434
BLAKE2b-256 3a31bf51080a303e560ddce2b3d706f37bb0fcd571131e96141f18f7391e8f7e

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