pyorps 0.3.2__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyorps-0.3.2 → pyorps-0.4.0}/PKG-INFO +120 -15
- pyorps-0.3.2/pyorps.egg-info/PKG-INFO → pyorps-0.4.0/README.md +87 -83
- pyorps-0.4.0/pyorps/__init__.py +154 -0
- pyorps-0.4.0/pyorps/certify/__init__.py +48 -0
- pyorps-0.4.0/pyorps/certify/line_integral.py +108 -0
- pyorps-0.4.0/pyorps/certify/rv.py +302 -0
- pyorps-0.4.0/pyorps/certify/windows.py +391 -0
- pyorps-0.4.0/pyorps/collector/__init__.py +58 -0
- pyorps-0.4.0/pyorps/collector/_voltage_numba.py +172 -0
- pyorps-0.4.0/pyorps/collector/bounds.py +394 -0
- pyorps-0.4.0/pyorps/collector/design.py +340 -0
- pyorps-0.4.0/pyorps/collector/exact.py +127 -0
- pyorps-0.4.0/pyorps/collector/model.py +391 -0
- pyorps-0.4.0/pyorps/collector/raster.py +729 -0
- pyorps-0.4.0/pyorps/collector/raster_pricer.py +90 -0
- pyorps-0.4.0/pyorps/collector/reference.py +1020 -0
- pyorps-0.4.0/pyorps/collector/voltage.py +863 -0
- pyorps-0.4.0/pyorps/collector/voltage_batch.py +684 -0
- pyorps-0.4.0/pyorps/collector/voltage_pgm.py +339 -0
- pyorps-0.4.0/pyorps/collector/voltage_plant.py +731 -0
- pyorps-0.4.0/pyorps/collector/voltage_rv.py +356 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/core/__init__.py +16 -0
- pyorps-0.4.0/pyorps/core/constrained_path.py +152 -0
- pyorps-0.4.0/pyorps/core/corridor.py +509 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/core/cost_assumptions.py +497 -24
- pyorps-0.4.0/pyorps/core/ensemble.py +150 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/core/exceptions.py +16 -6
- pyorps-0.4.0/pyorps/core/infrastructure_profile.py +312 -0
- pyorps-0.4.0/pyorps/core/metric_stack.py +682 -0
- pyorps-0.4.0/pyorps/core/objective.py +602 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/core/path.py +129 -1
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/core/types.py +4 -2
- pyorps-0.4.0/pyorps/costmodel/__init__.py +32 -0
- pyorps-0.4.0/pyorps/costmodel/catalogue.py +229 -0
- pyorps-0.4.0/pyorps/costmodel/losses.py +216 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/graph/__init__.py +43 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/graph/api/cython_api.py +93 -28
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/graph/api/graph_library_api.py +129 -9
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/graph/api/igraph_api.py +3 -1
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/graph/api/networkit_api.py +2 -2
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/graph/api/networkx_api.py +1 -1
- pyorps-0.4.0/pyorps/graph/api/raster_fim_api.py +1693 -0
- pyorps-0.4.0/pyorps/graph/api/raster_gpu_api.py +538 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/graph/api/rustworkx_api.py +1 -1
- pyorps-0.4.0/pyorps/graph/constrained_path_finder.py +1101 -0
- pyorps-0.4.0/pyorps/graph/corridor.py +632 -0
- pyorps-0.4.0/pyorps/graph/mixed_legs.py +156 -0
- pyorps-0.4.0/pyorps/graph/path_finder.py +3163 -0
- pyorps-0.4.0/pyorps/graph/search_session.py +2781 -0
- pyorps-0.4.0/pyorps/graph/tower_field.py +2122 -0
- pyorps-0.4.0/pyorps/graph/tower_field_oracle.py +487 -0
- pyorps-0.4.0/pyorps/gui/__init__.py +24 -0
- pyorps-0.4.0/pyorps/gui/__main__.py +24 -0
- pyorps-0.4.0/pyorps/gui/app.py +248 -0
- pyorps-0.4.0/pyorps/gui/assets/00-bootstrap.min.css +6 -0
- pyorps-0.4.0/pyorps/gui/assets/basemap-control.js +12 -0
- pyorps-0.4.0/pyorps/gui/assets/draw-preview.js +49 -0
- pyorps-0.4.0/pyorps/gui/assets/dropdown-close.js +50 -0
- pyorps-0.4.0/pyorps/gui/assets/gui.css +1284 -0
- pyorps-0.4.0/pyorps/gui/assets/leaflet-global-shim.js +78 -0
- pyorps-0.4.0/pyorps/gui/assets/sidebar-resize.js +60 -0
- pyorps-0.4.0/pyorps/gui/assets/table-resize.js +72 -0
- pyorps-0.4.0/pyorps/gui/assets/unsaved-guard.js +20 -0
- pyorps-0.4.0/pyorps/gui/callbacks/__init__.py +25 -0
- pyorps-0.4.0/pyorps/gui/callbacks/attrs.py +102 -0
- pyorps-0.4.0/pyorps/gui/callbacks/browse.py +56 -0
- pyorps-0.4.0/pyorps/gui/callbacks/constrained.py +265 -0
- pyorps-0.4.0/pyorps/gui/callbacks/costmodel.py +615 -0
- pyorps-0.4.0/pyorps/gui/callbacks/data.py +798 -0
- pyorps-0.4.0/pyorps/gui/callbacks/edit.py +652 -0
- pyorps-0.4.0/pyorps/gui/callbacks/groups.py +359 -0
- pyorps-0.4.0/pyorps/gui/callbacks/guide.py +74 -0
- pyorps-0.4.0/pyorps/gui/callbacks/interaction.py +179 -0
- pyorps-0.4.0/pyorps/gui/callbacks/io.py +157 -0
- pyorps-0.4.0/pyorps/gui/callbacks/layers.py +697 -0
- pyorps-0.4.0/pyorps/gui/callbacks/notifications.py +153 -0
- pyorps-0.4.0/pyorps/gui/callbacks/raster.py +693 -0
- pyorps-0.4.0/pyorps/gui/callbacks/routes.py +502 -0
- pyorps-0.4.0/pyorps/gui/callbacks/theme.py +57 -0
- pyorps-0.4.0/pyorps/gui/ids.py +291 -0
- pyorps-0.4.0/pyorps/gui/layout.py +1553 -0
- pyorps-0.4.0/pyorps/gui/presets.py +551 -0
- pyorps-0.4.0/pyorps/gui/services/__init__.py +1 -0
- pyorps-0.4.0/pyorps/gui/services/catalog.py +183 -0
- pyorps-0.4.0/pyorps/gui/services/combinations.py +316 -0
- pyorps-0.4.0/pyorps/gui/services/constrained.py +257 -0
- pyorps-0.4.0/pyorps/gui/services/cost.py +156 -0
- pyorps-0.4.0/pyorps/gui/services/cost_model.py +358 -0
- pyorps-0.4.0/pyorps/gui/services/data_io.py +172 -0
- pyorps-0.4.0/pyorps/gui/services/dialogs.py +78 -0
- pyorps-0.4.0/pyorps/gui/services/errors.py +424 -0
- pyorps-0.4.0/pyorps/gui/services/geo.py +188 -0
- pyorps-0.4.0/pyorps/gui/services/graduated.py +221 -0
- pyorps-0.4.0/pyorps/gui/services/logbook.py +103 -0
- pyorps-0.4.0/pyorps/gui/services/manual_cost.py +142 -0
- pyorps-0.4.0/pyorps/gui/services/osm.py +301 -0
- pyorps-0.4.0/pyorps/gui/services/project_io.py +288 -0
- pyorps-0.4.0/pyorps/gui/services/raster_algebra.py +143 -0
- pyorps-0.4.0/pyorps/gui/services/rasterize.py +176 -0
- pyorps-0.4.0/pyorps/gui/services/routing.py +392 -0
- pyorps-0.4.0/pyorps/gui/services/routing_job.py +80 -0
- pyorps-0.4.0/pyorps/gui/services/tiles.py +332 -0
- pyorps-0.4.0/pyorps/gui/services/validate.py +220 -0
- pyorps-0.4.0/pyorps/gui/state.py +284 -0
- pyorps-0.4.0/pyorps/io/field_codec.py +370 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/io/geo_dataset.py +89 -3
- pyorps-0.4.0/pyorps/io/gpu_raster.py +147 -0
- pyorps-0.4.0/pyorps/io/provenance.py +368 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/io/raster_loader.py +18 -14
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/io/vector_loader.py +50 -4
- pyorps-0.4.0/pyorps/raster/__init__.py +59 -0
- pyorps-0.4.0/pyorps/raster/_geojson.py +159 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/raster/handler.py +222 -25
- pyorps-0.4.0/pyorps/raster/rasterizer.py +1629 -0
- pyorps-0.4.0/pyorps/raster/thinness.py +1596 -0
- pyorps-0.4.0/pyorps/siting/__init__.py +84 -0
- pyorps-0.4.0/pyorps/siting/bounds.py +320 -0
- pyorps-0.4.0/pyorps/siting/candidates.py +197 -0
- pyorps-0.4.0/pyorps/siting/export.py +279 -0
- pyorps-0.4.0/pyorps/siting/footprint.py +302 -0
- pyorps-0.4.0/pyorps/siting/site_field.py +317 -0
- pyorps-0.4.0/pyorps/siting/terminals.py +116 -0
- pyorps-0.4.0/pyorps/utils/_constrained_context.cpp +40157 -0
- pyorps-0.4.0/pyorps/utils/_constrained_context.pxd +180 -0
- pyorps-0.4.0/pyorps/utils/_constrained_context.pyx +728 -0
- pyorps-0.4.0/pyorps/utils/_constrained_delta.cpp +66413 -0
- pyorps-0.4.0/pyorps/utils/_constrained_delta.pyx +2695 -0
- pyorps-0.4.0/pyorps/utils/_constrained_dijkstra.cpp +44236 -0
- pyorps-0.4.0/pyorps/utils/_constrained_dijkstra.pyx +954 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/utils/_delta_stepping.cpp +49956 -36506
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/utils/_delta_stepping.pyx +1014 -498
- pyorps-0.4.0/pyorps/utils/_delta_stepping_fused.cpp +42223 -0
- pyorps-0.4.0/pyorps/utils/_delta_stepping_fused.pyx +750 -0
- pyorps-0.4.0/pyorps/utils/_dijkstra.cpp +73055 -0
- pyorps-0.4.0/pyorps/utils/_dijkstra.pyx +2276 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/utils/_heap.cpp +5247 -3467
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/utils/_raster_context.cpp +15138 -11447
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/utils/_raster_context.pxd +1 -1
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/utils/_raster_context.pyx +26 -8
- pyorps-0.4.0/pyorps/utils/_traversal.cpp +48497 -0
- pyorps-0.4.0/pyorps/utils/_traversal.pxd +33 -0
- pyorps-0.4.0/pyorps/utils/_traversal.pyx +927 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/utils/_traversal_numba.py +225 -25
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/utils/atomic_cas.h +19 -0
- pyorps-0.4.0/pyorps/utils/constrained_path_algorithms.py +14 -0
- pyorps-0.4.0/pyorps/utils/constrained_path_algorithms.pyx +754 -0
- pyorps-0.4.0/pyorps/utils/constrained_sssp_gpu.py +752 -0
- pyorps-0.4.0/pyorps/utils/constrained_sssp_gpu_v2.py +1637 -0
- pyorps-0.4.0/pyorps/utils/constrained_sssp_gpu_v4.py +1245 -0
- pyorps-0.4.0/pyorps/utils/directional.py +394 -0
- pyorps-0.4.0/pyorps/utils/eikonal_gpu.py +3650 -0
- pyorps-0.4.0/pyorps/utils/kernels/__init__.py +0 -0
- pyorps-0.4.0/pyorps/utils/linestring_simplify.py +118 -0
- pyorps-0.4.0/pyorps/utils/metric_edges.py +215 -0
- pyorps-0.4.0/pyorps/utils/metric_eval.py +340 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/utils/neighborhood.py +4 -4
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/utils/path_algorithms.py +2 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/utils/path_core.py +2 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/utils/plotting.py +4 -4
- pyorps-0.4.0/pyorps/utils/resources.py +84 -0
- pyorps-0.4.0/pyorps/utils/sssp_gpu.py +3059 -0
- pyorps-0.4.0/pyorps/utils/traversal.py +97 -0
- pyorps-0.4.0/pyorps/utils/traversal_gpu.py +97 -0
- pyorps-0.4.0/pyorps/webviz/__init__.py +29 -0
- pyorps-0.4.0/pyorps/webviz/__main__.py +71 -0
- pyorps-0.4.0/pyorps/webviz/app.py +414 -0
- pyorps-0.4.0/pyorps/webviz/builder.py +35 -0
- pyorps-0.4.0/pyorps/webviz/cost.py +7 -0
- pyorps-0.4.0/pyorps/webviz/geo.py +15 -0
- pyorps-0.4.0/pyorps/webviz/layout.py +289 -0
- pyorps-0.4.0/pyorps/webviz/reroute.py +15 -0
- pyorps-0.4.0/pyorps/webviz/tiles.py +9 -0
- pyorps-0.4.0/pyorps/webviz/viewer.py +297 -0
- pyorps-0.3.2/README.md → pyorps-0.4.0/pyorps.egg-info/PKG-INFO +188 -15
- pyorps-0.4.0/pyorps.egg-info/SOURCES.txt +191 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps.egg-info/requires.txt +36 -0
- pyorps-0.4.0/pyproject.toml +241 -0
- pyorps-0.4.0/setup.py +342 -0
- pyorps-0.4.0/tests/test_build_provenance.py +812 -0
- pyorps-0.4.0/tests/test_exactness_referee.py +613 -0
- pyorps-0.3.2/pyorps/__init__.py +0 -70
- pyorps-0.3.2/pyorps/graph/path_finder.py +0 -1127
- pyorps-0.3.2/pyorps/raster/__init__.py +0 -23
- pyorps-0.3.2/pyorps/raster/rasterizer.py +0 -737
- pyorps-0.3.2/pyorps/utils/_dijkstra.cpp +0 -40678
- pyorps-0.3.2/pyorps/utils/_dijkstra.pyx +0 -726
- pyorps-0.3.2/pyorps/utils/traversal.py +0 -68
- pyorps-0.3.2/pyorps.egg-info/SOURCES.txt +0 -53
- pyorps-0.3.2/pyproject.toml +0 -144
- pyorps-0.3.2/setup.py +0 -156
- {pyorps-0.3.2 → pyorps-0.4.0}/LICENSE +0 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/MANIFEST.in +0 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/graph/api/__init__.py +0 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/graph/api/graph_api.py +0 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/io/__init__.py +0 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/utils/__init__.py +0 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/utils/_heap.pxd +0 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps/utils/_heap.pyx +0 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps.egg-info/dependency_links.txt +0 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps.egg-info/not-zip-safe +0 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/pyorps.egg-info/top_level.txt +0 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/setup.cfg +0 -0
- {pyorps-0.3.2 → pyorps-0.4.0}/tests/test_security_hardening.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyorps
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: PYORPS - (Python for Optimal Routes in Power Systems)
|
|
5
5
|
Author-email: Martin Hofmann <martin.hofmann-3@ei.thm.de>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -20,8 +20,10 @@ License-File: LICENSE
|
|
|
20
20
|
Requires-Dist: numpy>=2.0.0
|
|
21
21
|
Requires-Dist: pandas>=2.2.0
|
|
22
22
|
Requires-Dist: geopandas>=1.0.0
|
|
23
|
+
Requires-Dist: shapely>=2.0.0
|
|
23
24
|
Requires-Dist: numba>=0.61.0
|
|
24
25
|
Requires-Dist: rasterio>=1.4.0
|
|
26
|
+
Requires-Dist: scipy>=1.11
|
|
25
27
|
Requires-Dist: matplotlib>=3.10.0
|
|
26
28
|
Requires-Dist: requests>=2.32.0
|
|
27
29
|
Requires-Dist: defusedxml>=0.7.0
|
|
@@ -45,6 +47,36 @@ Requires-Dist: pandapower>=3.0.0; extra == "case-studies"
|
|
|
45
47
|
Requires-Dist: contextily>=1.6.0; extra == "case-studies"
|
|
46
48
|
Provides-Extra: additionals
|
|
47
49
|
Requires-Dist: openpyxl>=3.1.0; extra == "additionals"
|
|
50
|
+
Provides-Extra: gui
|
|
51
|
+
Requires-Dist: dash>=3.0.0; extra == "gui"
|
|
52
|
+
Requires-Dist: dash-leaflet>=1.1.0; extra == "gui"
|
|
53
|
+
Requires-Dist: dash-ag-grid>=31.0.0; extra == "gui"
|
|
54
|
+
Requires-Dist: dash-extensions>=1.0.0; extra == "gui"
|
|
55
|
+
Requires-Dist: dash-bootstrap-components>=1.6.0; extra == "gui"
|
|
56
|
+
Requires-Dist: localtileserver>=0.10.0; extra == "gui"
|
|
57
|
+
Requires-Dist: pywebview>=5.0; extra == "gui"
|
|
58
|
+
Requires-Dist: pyyaml>=6.0; extra == "gui"
|
|
59
|
+
Requires-Dist: orjson>=3.10; extra == "gui"
|
|
60
|
+
Requires-Dist: flask-compress>=1.15; extra == "gui"
|
|
61
|
+
Requires-Dist: pyarrow>=17.0; extra == "gui"
|
|
62
|
+
Requires-Dist: waitress>=3.0; extra == "gui"
|
|
63
|
+
Requires-Dist: geobuf>=1.1; extra == "gui"
|
|
64
|
+
Provides-Extra: viz
|
|
65
|
+
Requires-Dist: dash>=3.0.0; extra == "viz"
|
|
66
|
+
Requires-Dist: dash-leaflet>=1.1.0; extra == "viz"
|
|
67
|
+
Requires-Dist: dash-ag-grid>=31.0.0; extra == "viz"
|
|
68
|
+
Requires-Dist: dash-extensions>=1.0.0; extra == "viz"
|
|
69
|
+
Requires-Dist: dash-bootstrap-components>=1.6.0; extra == "viz"
|
|
70
|
+
Requires-Dist: localtileserver>=0.10.0; extra == "viz"
|
|
71
|
+
Requires-Dist: pywebview>=5.0; extra == "viz"
|
|
72
|
+
Requires-Dist: pyyaml>=6.0; extra == "viz"
|
|
73
|
+
Requires-Dist: orjson>=3.10; extra == "viz"
|
|
74
|
+
Requires-Dist: flask-compress>=1.15; extra == "viz"
|
|
75
|
+
Requires-Dist: pyarrow>=17.0; extra == "viz"
|
|
76
|
+
Requires-Dist: waitress>=3.0; extra == "viz"
|
|
77
|
+
Requires-Dist: geobuf>=1.1; extra == "viz"
|
|
78
|
+
Provides-Extra: simplify
|
|
79
|
+
Requires-Dist: simplification<1.0,>=0.7; extra == "simplify"
|
|
48
80
|
Provides-Extra: gpu
|
|
49
81
|
Requires-Dist: cupy-cuda12x>=13.0.0; extra == "gpu"
|
|
50
82
|
Provides-Extra: gpu-full
|
|
@@ -64,6 +96,7 @@ Requires-Dist: fiona>=1.10.0; extra == "full"
|
|
|
64
96
|
Requires-Dist: pandapower>=3.0.0; extra == "full"
|
|
65
97
|
Requires-Dist: contextily>=1.6.0; extra == "full"
|
|
66
98
|
Requires-Dist: openpyxl>=3.1.0; extra == "full"
|
|
99
|
+
Requires-Dist: simplification<1.0,>=0.7; extra == "full"
|
|
67
100
|
Dynamic: license-file
|
|
68
101
|
|
|
69
102
|
# **PYORPS** - Python for Optimal Routes in Power Systems
|
|
@@ -94,7 +127,7 @@ While tailored for distribution grids, it can be adapted for various infrastruct
|
|
|
94
127
|
<table>
|
|
95
128
|
<tr>
|
|
96
129
|
<td align="center" width="100%">
|
|
97
|
-
<img src="https://raw.githubusercontent.com/marhofmann/pyorps/refs/heads/main/docs/images/pyorps_planning_results_21_targets_22_5deg_1mxm.png" alt="ex." width="100%"/><br>
|
|
130
|
+
<img src="https://raw.githubusercontent.com/marhofmann/pyorps/refs/heads/main/docs/source/_static/images/pyorps_planning_results_21_targets_22_5deg_1mxm.png" alt="ex." width="100%"/><br>
|
|
98
131
|
<sub>
|
|
99
132
|
<b>Figure 1:</b> Parallel computation of 21 paths from single source to multiple targets.<br>
|
|
100
133
|
332 s total runtime on laptop with Intel(R) Core(TM) i7-8850H CPU @ 2.6 GHz and 32 GB memory
|
|
@@ -104,6 +137,51 @@ While tailored for distribution grids, it can be adapted for various infrastruct
|
|
|
104
137
|
</table>
|
|
105
138
|
|
|
106
139
|
|
|
140
|
+
## What's new in 0.4.0
|
|
141
|
+
|
|
142
|
+
- **Route length in CRS units.** Lengths and costs no longer change with the raster resolution (breaking change for
|
|
143
|
+
results that were reported in cell units).
|
|
144
|
+
- **Several metrics at once.** `CostAssumptions(metrics=...)`, `MetricStack`, `Objective` and DEM-based slope for
|
|
145
|
+
multi-objective routing.
|
|
146
|
+
- **GPU backends.** `raster_gpu` (persistent delta-stepping kernels) and `raster_fim` (eikonal fast-iterative-method
|
|
147
|
+
solver, raw `.gpur` rasters); install with `pip install pyorps[gpu]`.
|
|
148
|
+
- **Cost fields and search sessions.** Solve one field once and price many endpoint pairs.
|
|
149
|
+
- **Corridor graphs and tower fields.** Shared trenches for many routes; precomputed fields for overhead lines.
|
|
150
|
+
- **Interactive GUI.** `pip install pyorps[gui]`, then `python -m pyorps.gui`.
|
|
151
|
+
- **Route simplification.** `simplify` option of `PathFinder.find_route`.
|
|
152
|
+
|
|
153
|
+
Everything is listed with its status (`stable` or `experimental`) in the
|
|
154
|
+
[release status](https://pyorps.readthedocs.io/en/latest/getting_started/release_status.html) and the
|
|
155
|
+
[changelog](https://pyorps.readthedocs.io/en/latest/reference/changelog.html).
|
|
156
|
+
|
|
157
|
+
### Planning substation sites with cost fields
|
|
158
|
+
|
|
159
|
+
Instead of routing from every candidate site to every terminal, the siting research code solves one cost field per
|
|
160
|
+
fixed terminal (grid connection points and turbines) and then prices each candidate substation site by lookup.
|
|
161
|
+
|
|
162
|
+
<table>
|
|
163
|
+
<tr>
|
|
164
|
+
<td align="center" width="100%">
|
|
165
|
+
<img src="https://raw.githubusercontent.com/marhofmann/pyorps/refs/heads/main/docs/source/_static/images/substation_siting_method.gif" alt="Animation: ten cost fields are settled on a cost raster and candidate substation sites are priced by lookup" width="100%"/><br>
|
|
166
|
+
<sub>
|
|
167
|
+
<b>Figure 2:</b> Method illustration on public geodata: ten cost fields rooted at the fixed terminals
|
|
168
|
+
(<b>+</b> turbines, <b>■</b> grid connection points), then four illustrative candidate sites (<b>○</b>),
|
|
169
|
+
one west, north, east and south of the wind farm, are read off the fields.<br>
|
|
170
|
+
The siting packages (<code>pyorps.siting</code>, <code>pyorps.collector</code>, <code>pyorps.costmodel</code>,
|
|
171
|
+
<code>pyorps.certify</code>) are research code: shipped, but not part of the stable API.
|
|
172
|
+
</sub>
|
|
173
|
+
</td>
|
|
174
|
+
</tr>
|
|
175
|
+
</table>
|
|
176
|
+
|
|
177
|
+
How the workflow in Figure 2 runs:
|
|
178
|
+
|
|
179
|
+
- Start from a cost raster in which every cell has a price per metre of trench and forbidden cells are black.
|
|
180
|
+
- Solve one cost field per fixed terminal (seven turbines and three grid connection points). Each field is kept in memory, and the raster is not searched again.
|
|
181
|
+
- Read a route out of a field by following the predecessor chain from a candidate site back to its root. No new search runs.
|
|
182
|
+
- Move the candidate site and read all ten routes again (seven medium-voltage feeders and three high-voltage connections). The cheapest of each kind is the one that counts.
|
|
183
|
+
- Ten searches therefore answer any number of candidate sites, because the search is rooted at what is fixed and what moves is looked up.
|
|
184
|
+
|
|
107
185
|
## Features
|
|
108
186
|
|
|
109
187
|
- **Flexible Input Data**: Use local raster files directly or create custom rasterized geodata from WFS services or
|
|
@@ -114,6 +192,9 @@ While tailored for distribution grids, it can be adapted for various infrastruct
|
|
|
114
192
|
- **Environmental Consideration**: Add cost modifiers for nature reserves, water protection zones, and other sensitive
|
|
115
193
|
regions
|
|
116
194
|
- **GIS Integration**: Export results as GeoJSON for further analysis in GIS applications
|
|
195
|
+
- **Multiple Metrics**: Route on cost, slope or other metrics at once with `metrics=` and `Objective`
|
|
196
|
+
- **GPU Backends**: `raster_gpu` and `raster_fim` for very large rasters (extra `gpu`)
|
|
197
|
+
- **Interactive GUI**: Draw an area, load data from WFS services, edit costs and compare routes (extra `gui`)
|
|
117
198
|
|
|
118
199
|
|
|
119
200
|
## Quick Start
|
|
@@ -147,7 +228,7 @@ path_finder.plot_paths()
|
|
|
147
228
|
path_finder.save_paths(r"<PATH>\<TO>\<YOUR>\<RESULTS>.geojson" )
|
|
148
229
|
```
|
|
149
230
|
|
|
150
|
-
Please check out the [example](https://github.com/marhofmann/pyorps/blob/
|
|
231
|
+
Please check out the [example](https://github.com/marhofmann/pyorps/blob/main/examples/create_rasterized_geodata.ipynb)
|
|
151
232
|
for creating and setting up a dedicated raster dataset for your planning task.
|
|
152
233
|
|
|
153
234
|
## Binder - Run Examples
|
|
@@ -184,6 +265,9 @@ This command will install the core functionality of **PYORPS** along with its es
|
|
|
184
265
|
- [Numba](https://github.com/numba/numba)
|
|
185
266
|
- [Rasterio](https://github.com/rasterio/rasterio)
|
|
186
267
|
|
|
268
|
+
> **macOS 14 or older with Python 3.12 or newer:** rasterio 1.5 ships macOS wheels for macOS 15 only, so pip would try to build it
|
|
269
|
+
> from source (this needs GDAL). Install `pip install "rasterio<1.5"` first.
|
|
270
|
+
|
|
187
271
|
#### Optional Dependencies
|
|
188
272
|
|
|
189
273
|
**PYORPS** offers several optional dependencies that enhance its functionality. You can install these extras by specifying them in square brackets:
|
|
@@ -203,6 +287,23 @@ This command will install the core functionality of **PYORPS** along with its es
|
|
|
203
287
|
pip install pyorps[dev]
|
|
204
288
|
```
|
|
205
289
|
|
|
290
|
+
- **Interactive GUI**: Dash-based route-planning workbench (`python -m pyorps.gui`):
|
|
291
|
+
```bash
|
|
292
|
+
pip install pyorps[gui]
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
- **GPU backends**: CuPy for `raster_gpu` and `raster_fim` (CUDA 12; `gpu-full` adds cuGraph and cuDF):
|
|
296
|
+
```bash
|
|
297
|
+
pip install pyorps[gpu]
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
- **Other graph libraries**: Rustworkx, iGraph, NetworkX and NetworKit backends:
|
|
301
|
+
```bash
|
|
302
|
+
pip install pyorps[graph]
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
- **Route simplification**: `pip install pyorps[simplify]`
|
|
306
|
+
|
|
206
307
|
- **Full Installation**: To install all optional dependencies at once:
|
|
207
308
|
```bash
|
|
208
309
|
pip install pyorps[full]
|
|
@@ -247,9 +348,9 @@ This dramatically reduces memory and computation time, especially for high-resol
|
|
|
247
348
|
<table>
|
|
248
349
|
<tr>
|
|
249
350
|
<td align="center" width="100%">
|
|
250
|
-
<img src="https://raw.githubusercontent.com/marhofmann/pyorps/refs/heads/main/docs/images/buffer_600.png" alt="search spaces"
|
|
351
|
+
<img src="https://raw.githubusercontent.com/marhofmann/pyorps/refs/heads/main/docs/source/_static/images/buffer_600.png" alt="search spaces"
|
|
251
352
|
width="100%"/><br>
|
|
252
|
-
<sub><b>Figure
|
|
353
|
+
<sub><b>Figure 3:</b> Various optimal paths for different search spaces on rasterised geodata with 1 m² resolution</sub>
|
|
253
354
|
</td>
|
|
254
355
|
</tr>
|
|
255
356
|
</table>
|
|
@@ -271,14 +372,14 @@ This allows you to balance accuracy (following real-world paths) and performance
|
|
|
271
372
|
<table>
|
|
272
373
|
<tr>
|
|
273
374
|
<td align="center" width="50%">
|
|
274
|
-
<img src="https://raw.githubusercontent.com/marhofmann/pyorps/refs/heads/main/docs/images/R3-complete.PNG"
|
|
375
|
+
<img src="https://raw.githubusercontent.com/marhofmann/pyorps/refs/heads/main/docs/source/_static/images/R3-complete.PNG"
|
|
275
376
|
alt="R3 complete" width="79%"/><br>
|
|
276
|
-
<sub><b>Figure
|
|
377
|
+
<sub><b>Figure 4a:</b> Steps for neighbourhoods R0 (blue), R1 (green), R2 (yellow), and R3 (red)</sub>
|
|
277
378
|
</td>
|
|
278
379
|
<td align="center" width="50%">
|
|
279
|
-
<img src="https://raw.githubusercontent.com/marhofmann/pyorps/refs/heads/main/docs/images/intermediate_steps.PNG"
|
|
380
|
+
<img src="https://raw.githubusercontent.com/marhofmann/pyorps/refs/heads/main/docs/source/_static/images/intermediate_steps.PNG"
|
|
280
381
|
alt="intermediates" width="90%"/><br>
|
|
281
|
-
<sub><b>Figure
|
|
382
|
+
<sub><b>Figure 4b:</b> Intermediate elements Ik for selected edges of vertex v<sub>5,5</sub>.</sub>
|
|
282
383
|
</td>
|
|
283
384
|
</tr>
|
|
284
385
|
</table>
|
|
@@ -370,9 +471,9 @@ Routing is driven by a **cost raster**. **PYORPS** supports:
|
|
|
370
471
|
- **[Rustworkx](https://qiskit.org/documentation/rustworkx/)**: Pythonic, Rust-powered graph algorithms.
|
|
371
472
|
- **[NetworkX](https://networkx.org/)**: Widely-used, pure Python graph library.
|
|
372
473
|
- **[iGraph](https://igraph.org/python/)**: Efficient C-based graph library.
|
|
373
|
-
- **(
|
|
474
|
+
- **GPU** (experimental, extra `gpu`): `raster_gpu` (delta-stepping on the GPU) and `raster_fim` (eikonal fast-iterative-method solver).
|
|
374
475
|
|
|
375
|
-
You can select the backend via the `graph_api` parameter in `PathFinder
|
|
476
|
+
You can select the backend by name via the `graph_api` parameter in `PathFinder` (default `"cython"`; there is no automatic choice by problem size). Each backend exposes a unified interface for shortest path computation, supporting:
|
|
376
477
|
|
|
377
478
|
- **Δ-stepping**: Parallel path-finding algorithm - highest performance on multicore
|
|
378
479
|
CPUs
|
|
@@ -384,17 +485,21 @@ You can select the backend via the `graph_api` parameter in `PathFinder`. Each b
|
|
|
384
485
|
## Documentation
|
|
385
486
|
|
|
386
487
|
The documentation for **PYORPS**, including detailed explanations and usage instructions, can be found on
|
|
387
|
-
https://pyorps.readthedocs.io.
|
|
488
|
+
https://pyorps.readthedocs.io. It is organised into concepts (cost semantics, neighborhoods, search space, path
|
|
489
|
+
lengths and units, known limitations), one API page per feature and a
|
|
490
|
+
[release status](https://pyorps.readthedocs.io/en/latest/getting_started/release_status.html) page. Every page
|
|
491
|
+
states whether it is `stable` or `experimental`. For AI assistants and tools, the built site also ships
|
|
492
|
+
`llms.txt`, `llms-full.txt` and `api-index.json` at its root.
|
|
388
493
|
Examples demonstrating the functionality of **PYORPS**, along with practical use cases, are included as jupyter notebooks
|
|
389
|
-
in the [examples directory](https://github.com/marhofmann/pyorps/blob/
|
|
494
|
+
in the [examples directory](https://github.com/marhofmann/pyorps/blob/main/examples).
|
|
390
495
|
|
|
391
496
|
## Contributing
|
|
392
497
|
|
|
393
|
-
Contributions are welcome! If you want to contribute, please check out the [**PYORPS** contribution guidelines](https://github.com/marhofmann/pyorps/blob/
|
|
498
|
+
Contributions are welcome! If you want to contribute, please check out the [**PYORPS** contribution guidelines](https://github.com/marhofmann/pyorps/blob/main/CONTRIBUTING.md).
|
|
394
499
|
|
|
395
500
|
## License
|
|
396
501
|
|
|
397
|
-
This project is licensed under the [MIT License](https://github.com/marhofmann/pyorps/blob/
|
|
502
|
+
This project is licensed under the [MIT License](https://github.com/marhofmann/pyorps/blob/main/LICENSE).
|
|
398
503
|
|
|
399
504
|
## Citation
|
|
400
505
|
|
|
@@ -1,71 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: pyorps
|
|
3
|
-
Version: 0.3.2
|
|
4
|
-
Summary: PYORPS - (Python for Optimal Routes in Power Systems)
|
|
5
|
-
Author-email: Martin Hofmann <martin.hofmann-3@ei.thm.de>
|
|
6
|
-
License-Expression: MIT
|
|
7
|
-
Project-URL: Homepage, https://github.com/marhofmann/pyorps
|
|
8
|
-
Project-URL: Bug Tracker, https://github.com/marhofmann/pyorps/issues
|
|
9
|
-
Keywords: power line routing,distribution grid,power systems planning,path finding,rasterized GIS data
|
|
10
|
-
Classifier: Development Status :: 3 - Alpha
|
|
11
|
-
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
-
Classifier: Topic :: Scientific/Engineering :: GIS
|
|
16
|
-
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
17
|
-
Requires-Python: >=3.11
|
|
18
|
-
Description-Content-Type: text/markdown
|
|
19
|
-
License-File: LICENSE
|
|
20
|
-
Requires-Dist: numpy>=2.0.0
|
|
21
|
-
Requires-Dist: pandas>=2.2.0
|
|
22
|
-
Requires-Dist: geopandas>=1.0.0
|
|
23
|
-
Requires-Dist: numba>=0.61.0
|
|
24
|
-
Requires-Dist: rasterio>=1.4.0
|
|
25
|
-
Requires-Dist: matplotlib>=3.10.0
|
|
26
|
-
Requires-Dist: requests>=2.32.0
|
|
27
|
-
Requires-Dist: defusedxml>=0.7.0
|
|
28
|
-
Requires-Dist: psutil>=5.9.0
|
|
29
|
-
Provides-Extra: graph
|
|
30
|
-
Requires-Dist: rustworkx>=0.16.0; extra == "graph"
|
|
31
|
-
Requires-Dist: python-igraph>=0.11.0; extra == "graph"
|
|
32
|
-
Requires-Dist: networkx>=3.4.0; extra == "graph"
|
|
33
|
-
Requires-Dist: networkit>=11.1; extra == "graph"
|
|
34
|
-
Provides-Extra: dev
|
|
35
|
-
Requires-Dist: coverage[toml]>=7.8.0; extra == "dev"
|
|
36
|
-
Requires-Dist: pytest>=8.3.0; extra == "dev"
|
|
37
|
-
Requires-Dist: cython>=3.0.0; extra == "dev"
|
|
38
|
-
Provides-Extra: examples
|
|
39
|
-
Requires-Dist: notebook>=7.4.0; extra == "examples"
|
|
40
|
-
Requires-Dist: fiona>=1.10.0; extra == "examples"
|
|
41
|
-
Provides-Extra: case-studies
|
|
42
|
-
Requires-Dist: notebook>=7.4.0; extra == "case-studies"
|
|
43
|
-
Requires-Dist: fiona>=1.10.0; extra == "case-studies"
|
|
44
|
-
Requires-Dist: pandapower>=3.0.0; extra == "case-studies"
|
|
45
|
-
Requires-Dist: contextily>=1.6.0; extra == "case-studies"
|
|
46
|
-
Provides-Extra: additionals
|
|
47
|
-
Requires-Dist: openpyxl>=3.1.0; extra == "additionals"
|
|
48
|
-
Provides-Extra: gpu
|
|
49
|
-
Requires-Dist: cupy-cuda12x>=13.0.0; extra == "gpu"
|
|
50
|
-
Provides-Extra: gpu-full
|
|
51
|
-
Requires-Dist: cupy-cuda12x>=13.0.0; extra == "gpu-full"
|
|
52
|
-
Requires-Dist: cugraph-cu12>=25.02; extra == "gpu-full"
|
|
53
|
-
Requires-Dist: cudf-cu12>=25.02; extra == "gpu-full"
|
|
54
|
-
Provides-Extra: full
|
|
55
|
-
Requires-Dist: rustworkx>=0.16.0; extra == "full"
|
|
56
|
-
Requires-Dist: python-igraph>=0.11.0; extra == "full"
|
|
57
|
-
Requires-Dist: networkx>=3.4.0; extra == "full"
|
|
58
|
-
Requires-Dist: networkit>=11.1; extra == "full"
|
|
59
|
-
Requires-Dist: coverage[toml]>=7.8.0; extra == "full"
|
|
60
|
-
Requires-Dist: pytest>=8.3.0; extra == "full"
|
|
61
|
-
Requires-Dist: cython>=3.0.0; extra == "full"
|
|
62
|
-
Requires-Dist: notebook>=7.4.0; extra == "full"
|
|
63
|
-
Requires-Dist: fiona>=1.10.0; extra == "full"
|
|
64
|
-
Requires-Dist: pandapower>=3.0.0; extra == "full"
|
|
65
|
-
Requires-Dist: contextily>=1.6.0; extra == "full"
|
|
66
|
-
Requires-Dist: openpyxl>=3.1.0; extra == "full"
|
|
67
|
-
Dynamic: license-file
|
|
68
|
-
|
|
69
1
|
# **PYORPS** - Python for Optimal Routes in Power Systems
|
|
70
2
|
|
|
71
3
|
[](https://pypi.org/project/pyorps/)
|
|
@@ -94,7 +26,7 @@ While tailored for distribution grids, it can be adapted for various infrastruct
|
|
|
94
26
|
<table>
|
|
95
27
|
<tr>
|
|
96
28
|
<td align="center" width="100%">
|
|
97
|
-
<img src="https://raw.githubusercontent.com/marhofmann/pyorps/refs/heads/main/docs/images/pyorps_planning_results_21_targets_22_5deg_1mxm.png" alt="ex." width="100%"/><br>
|
|
29
|
+
<img src="https://raw.githubusercontent.com/marhofmann/pyorps/refs/heads/main/docs/source/_static/images/pyorps_planning_results_21_targets_22_5deg_1mxm.png" alt="ex." width="100%"/><br>
|
|
98
30
|
<sub>
|
|
99
31
|
<b>Figure 1:</b> Parallel computation of 21 paths from single source to multiple targets.<br>
|
|
100
32
|
332 s total runtime on laptop with Intel(R) Core(TM) i7-8850H CPU @ 2.6 GHz and 32 GB memory
|
|
@@ -104,6 +36,51 @@ While tailored for distribution grids, it can be adapted for various infrastruct
|
|
|
104
36
|
</table>
|
|
105
37
|
|
|
106
38
|
|
|
39
|
+
## What's new in 0.4.0
|
|
40
|
+
|
|
41
|
+
- **Route length in CRS units.** Lengths and costs no longer change with the raster resolution (breaking change for
|
|
42
|
+
results that were reported in cell units).
|
|
43
|
+
- **Several metrics at once.** `CostAssumptions(metrics=...)`, `MetricStack`, `Objective` and DEM-based slope for
|
|
44
|
+
multi-objective routing.
|
|
45
|
+
- **GPU backends.** `raster_gpu` (persistent delta-stepping kernels) and `raster_fim` (eikonal fast-iterative-method
|
|
46
|
+
solver, raw `.gpur` rasters); install with `pip install pyorps[gpu]`.
|
|
47
|
+
- **Cost fields and search sessions.** Solve one field once and price many endpoint pairs.
|
|
48
|
+
- **Corridor graphs and tower fields.** Shared trenches for many routes; precomputed fields for overhead lines.
|
|
49
|
+
- **Interactive GUI.** `pip install pyorps[gui]`, then `python -m pyorps.gui`.
|
|
50
|
+
- **Route simplification.** `simplify` option of `PathFinder.find_route`.
|
|
51
|
+
|
|
52
|
+
Everything is listed with its status (`stable` or `experimental`) in the
|
|
53
|
+
[release status](https://pyorps.readthedocs.io/en/latest/getting_started/release_status.html) and the
|
|
54
|
+
[changelog](https://pyorps.readthedocs.io/en/latest/reference/changelog.html).
|
|
55
|
+
|
|
56
|
+
### Planning substation sites with cost fields
|
|
57
|
+
|
|
58
|
+
Instead of routing from every candidate site to every terminal, the siting research code solves one cost field per
|
|
59
|
+
fixed terminal (grid connection points and turbines) and then prices each candidate substation site by lookup.
|
|
60
|
+
|
|
61
|
+
<table>
|
|
62
|
+
<tr>
|
|
63
|
+
<td align="center" width="100%">
|
|
64
|
+
<img src="https://raw.githubusercontent.com/marhofmann/pyorps/refs/heads/main/docs/source/_static/images/substation_siting_method.gif" alt="Animation: ten cost fields are settled on a cost raster and candidate substation sites are priced by lookup" width="100%"/><br>
|
|
65
|
+
<sub>
|
|
66
|
+
<b>Figure 2:</b> Method illustration on public geodata: ten cost fields rooted at the fixed terminals
|
|
67
|
+
(<b>+</b> turbines, <b>■</b> grid connection points), then four illustrative candidate sites (<b>○</b>),
|
|
68
|
+
one west, north, east and south of the wind farm, are read off the fields.<br>
|
|
69
|
+
The siting packages (<code>pyorps.siting</code>, <code>pyorps.collector</code>, <code>pyorps.costmodel</code>,
|
|
70
|
+
<code>pyorps.certify</code>) are research code: shipped, but not part of the stable API.
|
|
71
|
+
</sub>
|
|
72
|
+
</td>
|
|
73
|
+
</tr>
|
|
74
|
+
</table>
|
|
75
|
+
|
|
76
|
+
How the workflow in Figure 2 runs:
|
|
77
|
+
|
|
78
|
+
- Start from a cost raster in which every cell has a price per metre of trench and forbidden cells are black.
|
|
79
|
+
- Solve one cost field per fixed terminal (seven turbines and three grid connection points). Each field is kept in memory, and the raster is not searched again.
|
|
80
|
+
- Read a route out of a field by following the predecessor chain from a candidate site back to its root. No new search runs.
|
|
81
|
+
- Move the candidate site and read all ten routes again (seven medium-voltage feeders and three high-voltage connections). The cheapest of each kind is the one that counts.
|
|
82
|
+
- Ten searches therefore answer any number of candidate sites, because the search is rooted at what is fixed and what moves is looked up.
|
|
83
|
+
|
|
107
84
|
## Features
|
|
108
85
|
|
|
109
86
|
- **Flexible Input Data**: Use local raster files directly or create custom rasterized geodata from WFS services or
|
|
@@ -114,6 +91,9 @@ While tailored for distribution grids, it can be adapted for various infrastruct
|
|
|
114
91
|
- **Environmental Consideration**: Add cost modifiers for nature reserves, water protection zones, and other sensitive
|
|
115
92
|
regions
|
|
116
93
|
- **GIS Integration**: Export results as GeoJSON for further analysis in GIS applications
|
|
94
|
+
- **Multiple Metrics**: Route on cost, slope or other metrics at once with `metrics=` and `Objective`
|
|
95
|
+
- **GPU Backends**: `raster_gpu` and `raster_fim` for very large rasters (extra `gpu`)
|
|
96
|
+
- **Interactive GUI**: Draw an area, load data from WFS services, edit costs and compare routes (extra `gui`)
|
|
117
97
|
|
|
118
98
|
|
|
119
99
|
## Quick Start
|
|
@@ -147,7 +127,7 @@ path_finder.plot_paths()
|
|
|
147
127
|
path_finder.save_paths(r"<PATH>\<TO>\<YOUR>\<RESULTS>.geojson" )
|
|
148
128
|
```
|
|
149
129
|
|
|
150
|
-
Please check out the [example](https://github.com/marhofmann/pyorps/blob/
|
|
130
|
+
Please check out the [example](https://github.com/marhofmann/pyorps/blob/main/examples/create_rasterized_geodata.ipynb)
|
|
151
131
|
for creating and setting up a dedicated raster dataset for your planning task.
|
|
152
132
|
|
|
153
133
|
## Binder - Run Examples
|
|
@@ -184,6 +164,9 @@ This command will install the core functionality of **PYORPS** along with its es
|
|
|
184
164
|
- [Numba](https://github.com/numba/numba)
|
|
185
165
|
- [Rasterio](https://github.com/rasterio/rasterio)
|
|
186
166
|
|
|
167
|
+
> **macOS 14 or older with Python 3.12 or newer:** rasterio 1.5 ships macOS wheels for macOS 15 only, so pip would try to build it
|
|
168
|
+
> from source (this needs GDAL). Install `pip install "rasterio<1.5"` first.
|
|
169
|
+
|
|
187
170
|
#### Optional Dependencies
|
|
188
171
|
|
|
189
172
|
**PYORPS** offers several optional dependencies that enhance its functionality. You can install these extras by specifying them in square brackets:
|
|
@@ -203,6 +186,23 @@ This command will install the core functionality of **PYORPS** along with its es
|
|
|
203
186
|
pip install pyorps[dev]
|
|
204
187
|
```
|
|
205
188
|
|
|
189
|
+
- **Interactive GUI**: Dash-based route-planning workbench (`python -m pyorps.gui`):
|
|
190
|
+
```bash
|
|
191
|
+
pip install pyorps[gui]
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
- **GPU backends**: CuPy for `raster_gpu` and `raster_fim` (CUDA 12; `gpu-full` adds cuGraph and cuDF):
|
|
195
|
+
```bash
|
|
196
|
+
pip install pyorps[gpu]
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
- **Other graph libraries**: Rustworkx, iGraph, NetworkX and NetworKit backends:
|
|
200
|
+
```bash
|
|
201
|
+
pip install pyorps[graph]
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
- **Route simplification**: `pip install pyorps[simplify]`
|
|
205
|
+
|
|
206
206
|
- **Full Installation**: To install all optional dependencies at once:
|
|
207
207
|
```bash
|
|
208
208
|
pip install pyorps[full]
|
|
@@ -247,9 +247,9 @@ This dramatically reduces memory and computation time, especially for high-resol
|
|
|
247
247
|
<table>
|
|
248
248
|
<tr>
|
|
249
249
|
<td align="center" width="100%">
|
|
250
|
-
<img src="https://raw.githubusercontent.com/marhofmann/pyorps/refs/heads/main/docs/images/buffer_600.png" alt="search spaces"
|
|
250
|
+
<img src="https://raw.githubusercontent.com/marhofmann/pyorps/refs/heads/main/docs/source/_static/images/buffer_600.png" alt="search spaces"
|
|
251
251
|
width="100%"/><br>
|
|
252
|
-
<sub><b>Figure
|
|
252
|
+
<sub><b>Figure 3:</b> Various optimal paths for different search spaces on rasterised geodata with 1 m² resolution</sub>
|
|
253
253
|
</td>
|
|
254
254
|
</tr>
|
|
255
255
|
</table>
|
|
@@ -271,14 +271,14 @@ This allows you to balance accuracy (following real-world paths) and performance
|
|
|
271
271
|
<table>
|
|
272
272
|
<tr>
|
|
273
273
|
<td align="center" width="50%">
|
|
274
|
-
<img src="https://raw.githubusercontent.com/marhofmann/pyorps/refs/heads/main/docs/images/R3-complete.PNG"
|
|
274
|
+
<img src="https://raw.githubusercontent.com/marhofmann/pyorps/refs/heads/main/docs/source/_static/images/R3-complete.PNG"
|
|
275
275
|
alt="R3 complete" width="79%"/><br>
|
|
276
|
-
<sub><b>Figure
|
|
276
|
+
<sub><b>Figure 4a:</b> Steps for neighbourhoods R0 (blue), R1 (green), R2 (yellow), and R3 (red)</sub>
|
|
277
277
|
</td>
|
|
278
278
|
<td align="center" width="50%">
|
|
279
|
-
<img src="https://raw.githubusercontent.com/marhofmann/pyorps/refs/heads/main/docs/images/intermediate_steps.PNG"
|
|
279
|
+
<img src="https://raw.githubusercontent.com/marhofmann/pyorps/refs/heads/main/docs/source/_static/images/intermediate_steps.PNG"
|
|
280
280
|
alt="intermediates" width="90%"/><br>
|
|
281
|
-
<sub><b>Figure
|
|
281
|
+
<sub><b>Figure 4b:</b> Intermediate elements Ik for selected edges of vertex v<sub>5,5</sub>.</sub>
|
|
282
282
|
</td>
|
|
283
283
|
</tr>
|
|
284
284
|
</table>
|
|
@@ -370,9 +370,9 @@ Routing is driven by a **cost raster**. **PYORPS** supports:
|
|
|
370
370
|
- **[Rustworkx](https://qiskit.org/documentation/rustworkx/)**: Pythonic, Rust-powered graph algorithms.
|
|
371
371
|
- **[NetworkX](https://networkx.org/)**: Widely-used, pure Python graph library.
|
|
372
372
|
- **[iGraph](https://igraph.org/python/)**: Efficient C-based graph library.
|
|
373
|
-
- **(
|
|
373
|
+
- **GPU** (experimental, extra `gpu`): `raster_gpu` (delta-stepping on the GPU) and `raster_fim` (eikonal fast-iterative-method solver).
|
|
374
374
|
|
|
375
|
-
You can select the backend via the `graph_api` parameter in `PathFinder
|
|
375
|
+
You can select the backend by name via the `graph_api` parameter in `PathFinder` (default `"cython"`; there is no automatic choice by problem size). Each backend exposes a unified interface for shortest path computation, supporting:
|
|
376
376
|
|
|
377
377
|
- **Δ-stepping**: Parallel path-finding algorithm - highest performance on multicore
|
|
378
378
|
CPUs
|
|
@@ -384,17 +384,21 @@ You can select the backend via the `graph_api` parameter in `PathFinder`. Each b
|
|
|
384
384
|
## Documentation
|
|
385
385
|
|
|
386
386
|
The documentation for **PYORPS**, including detailed explanations and usage instructions, can be found on
|
|
387
|
-
https://pyorps.readthedocs.io.
|
|
387
|
+
https://pyorps.readthedocs.io. It is organised into concepts (cost semantics, neighborhoods, search space, path
|
|
388
|
+
lengths and units, known limitations), one API page per feature and a
|
|
389
|
+
[release status](https://pyorps.readthedocs.io/en/latest/getting_started/release_status.html) page. Every page
|
|
390
|
+
states whether it is `stable` or `experimental`. For AI assistants and tools, the built site also ships
|
|
391
|
+
`llms.txt`, `llms-full.txt` and `api-index.json` at its root.
|
|
388
392
|
Examples demonstrating the functionality of **PYORPS**, along with practical use cases, are included as jupyter notebooks
|
|
389
|
-
in the [examples directory](https://github.com/marhofmann/pyorps/blob/
|
|
393
|
+
in the [examples directory](https://github.com/marhofmann/pyorps/blob/main/examples).
|
|
390
394
|
|
|
391
395
|
## Contributing
|
|
392
396
|
|
|
393
|
-
Contributions are welcome! If you want to contribute, please check out the [**PYORPS** contribution guidelines](https://github.com/marhofmann/pyorps/blob/
|
|
397
|
+
Contributions are welcome! If you want to contribute, please check out the [**PYORPS** contribution guidelines](https://github.com/marhofmann/pyorps/blob/main/CONTRIBUTING.md).
|
|
394
398
|
|
|
395
399
|
## License
|
|
396
400
|
|
|
397
|
-
This project is licensed under the [MIT License](https://github.com/marhofmann/pyorps/blob/
|
|
401
|
+
This project is licensed under the [MIT License](https://github.com/marhofmann/pyorps/blob/main/LICENSE).
|
|
398
402
|
|
|
399
403
|
## Citation
|
|
400
404
|
|
|
@@ -407,4 +411,4 @@ Hofmann, M., Stetz, T., Kammer, F., Repo, S.: 'PYORPS: An Open-Source Tool for A
|
|
|
407
411
|
|
|
408
412
|
## Contact
|
|
409
413
|
|
|
410
|
-
For questions and feedback, please open an issue on our GitHub repository.
|
|
414
|
+
For questions and feedback, please open an issue on our GitHub repository.
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"""PYORPS - Python for Optimal Routes in Power Systems."""
|
|
2
|
+
|
|
3
|
+
__version__ = "0.4.0"
|
|
4
|
+
|
|
5
|
+
# Suppress third-party deprecation warnings triggered during import
|
|
6
|
+
import warnings as _warnings
|
|
7
|
+
|
|
8
|
+
_warnings.filterwarnings(
|
|
9
|
+
"ignore",
|
|
10
|
+
message="The 'shapely.geos' module is deprecated",
|
|
11
|
+
category=DeprecationWarning,
|
|
12
|
+
)
|
|
13
|
+
del _warnings
|
|
14
|
+
|
|
15
|
+
# Import key components for easy access
|
|
16
|
+
from .core.cost_assumptions import ( # pylint: disable=wrong-import-position
|
|
17
|
+
CostAssumptions,
|
|
18
|
+
detect_feature_columns,
|
|
19
|
+
get_zero_cost_assumptions,
|
|
20
|
+
save_empty_cost_assumptions,
|
|
21
|
+
)
|
|
22
|
+
from .core.exceptions import ( # pylint: disable=wrong-import-position
|
|
23
|
+
AlgorithmNotImplementedError,
|
|
24
|
+
CostAssumptionsError,
|
|
25
|
+
NoPathFoundError,
|
|
26
|
+
PairwiseError,
|
|
27
|
+
PyorpsError,
|
|
28
|
+
RasterShapeError,
|
|
29
|
+
WFSError,
|
|
30
|
+
)
|
|
31
|
+
from .core.ensemble import RouteEnsemble # pylint: disable=wrong-import-position
|
|
32
|
+
from .core.metric_stack import MetricStack # pylint: disable=wrong-import-position
|
|
33
|
+
from .core.objective import ( # pylint: disable=wrong-import-position
|
|
34
|
+
GradientOptions,
|
|
35
|
+
Objective,
|
|
36
|
+
)
|
|
37
|
+
from .core.path import ( # Fixed: import from core.path instead of graph # pylint: disable=wrong-import-position
|
|
38
|
+
Path,
|
|
39
|
+
PathCollection,
|
|
40
|
+
)
|
|
41
|
+
from .graph.path_finder import PathFinder # pylint: disable=wrong-import-position
|
|
42
|
+
from .graph.search_session import ( # pylint: disable=wrong-import-position
|
|
43
|
+
CostField,
|
|
44
|
+
CostFieldSet,
|
|
45
|
+
Leg,
|
|
46
|
+
SavedCostField,
|
|
47
|
+
SearchSession,
|
|
48
|
+
fields_fit_in_memory,
|
|
49
|
+
full_window_buffer_m,
|
|
50
|
+
)
|
|
51
|
+
from .graph.tower_field import ( # pylint: disable=wrong-import-position
|
|
52
|
+
AngleTables,
|
|
53
|
+
ClearanceModel,
|
|
54
|
+
TowerField,
|
|
55
|
+
TowerFieldModel,
|
|
56
|
+
TowerFieldSolver,
|
|
57
|
+
TowerLattice,
|
|
58
|
+
angle_tables_from_profile,
|
|
59
|
+
check_bounds,
|
|
60
|
+
clearance_from_profile,
|
|
61
|
+
solve_tower_field,
|
|
62
|
+
tower_field_bounds,
|
|
63
|
+
tower_field_from_raster,
|
|
64
|
+
)
|
|
65
|
+
from .graph.corridor import ( # pylint: disable=wrong-import-position
|
|
66
|
+
cell_sharing_profile,
|
|
67
|
+
corridor_graph_from_routes,
|
|
68
|
+
route_metrics,
|
|
69
|
+
supercover_cells,
|
|
70
|
+
)
|
|
71
|
+
from .io.geo_dataset import ( # pylint: disable=wrong-import-position
|
|
72
|
+
GeoDataset,
|
|
73
|
+
InMemoryRasterDataset,
|
|
74
|
+
InMemoryVectorDataset,
|
|
75
|
+
LocalRasterDataset,
|
|
76
|
+
LocalVectorDataset,
|
|
77
|
+
RasterDataset,
|
|
78
|
+
VectorDataset,
|
|
79
|
+
WFSVectorDataset,
|
|
80
|
+
initialize_geo_dataset,
|
|
81
|
+
)
|
|
82
|
+
from .raster.rasterizer import GeoRasterizer # pylint: disable=wrong-import-position
|
|
83
|
+
from .raster.thinness import ( # pylint: disable=wrong-import-position
|
|
84
|
+
MIN_FORBIDDEN_WIDTH_CELLS,
|
|
85
|
+
ForbiddenBurnAssessment,
|
|
86
|
+
ForbiddenBurnReport,
|
|
87
|
+
ForbiddenBurnRoutingAssessment,
|
|
88
|
+
ForbiddenBurnSeverity,
|
|
89
|
+
RepairSealReport,
|
|
90
|
+
ResolutionAdvice,
|
|
91
|
+
SealedOpeningError,
|
|
92
|
+
SealedOpeningWarning,
|
|
93
|
+
ThinForbiddenFeatureError,
|
|
94
|
+
ThinForbiddenFeatureWarning,
|
|
95
|
+
detect_forbidden_burn_defects,
|
|
96
|
+
detect_repair_seals,
|
|
97
|
+
is_thin,
|
|
98
|
+
min_feature_width,
|
|
99
|
+
recommended_geometry_buffer_m,
|
|
100
|
+
safe_forbidden_width_m,
|
|
101
|
+
suggest_resolution,
|
|
102
|
+
thin_parts,
|
|
103
|
+
widen_thin_features,
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
__all__ = [
|
|
107
|
+
# Core dataset classes
|
|
108
|
+
"GeoDataset", "VectorDataset", "RasterDataset",
|
|
109
|
+
"InMemoryVectorDataset", "LocalVectorDataset",
|
|
110
|
+
"WFSVectorDataset", "LocalRasterDataset",
|
|
111
|
+
"InMemoryRasterDataset", "initialize_geo_dataset",
|
|
112
|
+
|
|
113
|
+
# Rasterization
|
|
114
|
+
"GeoRasterizer",
|
|
115
|
+
|
|
116
|
+
# Sub-cell forbidden features (thin barriers)
|
|
117
|
+
"MIN_FORBIDDEN_WIDTH_CELLS", "safe_forbidden_width_m",
|
|
118
|
+
"recommended_geometry_buffer_m",
|
|
119
|
+
"is_thin", "min_feature_width", "thin_parts", "widen_thin_features",
|
|
120
|
+
"detect_forbidden_burn_defects", "ForbiddenBurnReport",
|
|
121
|
+
"ForbiddenBurnAssessment", "ForbiddenBurnSeverity",
|
|
122
|
+
"ForbiddenBurnRoutingAssessment",
|
|
123
|
+
"suggest_resolution", "ResolutionAdvice",
|
|
124
|
+
"ThinForbiddenFeatureWarning", "ThinForbiddenFeatureError",
|
|
125
|
+
"detect_repair_seals", "RepairSealReport",
|
|
126
|
+
"SealedOpeningWarning", "SealedOpeningError",
|
|
127
|
+
|
|
128
|
+
# Graph and routing
|
|
129
|
+
"PathFinder", "Path", "PathCollection",
|
|
130
|
+
|
|
131
|
+
# Retained search fields (rooted cost fields, incremental editing)
|
|
132
|
+
"CostField", "CostFieldSet", "SavedCostField", "SearchSession",
|
|
133
|
+
"Leg", "full_window_buffer_m", "fields_fit_in_memory",
|
|
134
|
+
"corridor_graph_from_routes", "route_metrics", "cell_sharing_profile",
|
|
135
|
+
"supercover_cells",
|
|
136
|
+
|
|
137
|
+
# Precomputed tower fields (overhead siting without a state explosion)
|
|
138
|
+
"TowerField", "TowerFieldModel", "TowerFieldSolver", "TowerLattice",
|
|
139
|
+
"AngleTables", "ClearanceModel", "solve_tower_field",
|
|
140
|
+
"tower_field_from_raster", "tower_field_bounds", "check_bounds",
|
|
141
|
+
"angle_tables_from_profile", "clearance_from_profile",
|
|
142
|
+
|
|
143
|
+
# Feasibility objective
|
|
144
|
+
"Objective", "GradientOptions", "MetricStack", "RouteEnsemble",
|
|
145
|
+
|
|
146
|
+
# Cost assumptions
|
|
147
|
+
"CostAssumptions", "get_zero_cost_assumptions", "detect_feature_columns",
|
|
148
|
+
"save_empty_cost_assumptions",
|
|
149
|
+
|
|
150
|
+
# Exceptions
|
|
151
|
+
"PyorpsError", "NoPathFoundError", "RasterShapeError",
|
|
152
|
+
"AlgorithmNotImplementedError", "PairwiseError",
|
|
153
|
+
"CostAssumptionsError", "WFSError",
|
|
154
|
+
]
|