User Guide: Installation#

Requirements#

  • Python ≥ 3.12

  • A supported platform: Linux, macOS, or Windows

All core dependencies are installed automatically by pip.

From Source (development)#

Clone the repository and install in editable mode:

git clone https://gitlab.com/dessia/sdk/routing.git
cd routing
pip install -e ".[test,doc]"

The [test] extra installs pytest and coverage, [doc] the Sphinx toolchain.

The search engine is compiled: the install builds four Cython extensions (pathfinding/core/node.py, pathfinding/core/grid.py, pathfinding/finder/finder.py and core/functions_compiled.py), so a source install needs a C++ compiler. After editing one of these files, rebuild them in place:

python setup.py build_ext --inplace

Dependencies#

Core dependencies (installed automatically):

  • volmdlr (> 0.22.4, < 0.23.0) — 3D CAD geometry: STEP file loading, mesh operations

  • numpy — array operations, voxelization

  • scipy — simulated annealing optimizer (dual_annealing)

  • dessia_common (≥ 1.0.1) — serialization base classes

  • pymoo (≥ 0.6) — genetic algorithm behind the harness optimizer (User Guide: Harness Generation)

  • scikit-image — morphology and topological thinning used to skeletonize a bundle

  • xlsx_handler — reading specifications from Excel files (from_xlsx())

  • pandas, networkx, matplotlib, plot_data, packcircles — data, graph and plotting support

Pipe section definitions (piping.Section) ship with the package itself, in routing.core.legacy_piping — no external piping_3d install is required.

Upgrading#

pip install --upgrade routing

Checking the Installation#

Run the quickstart example to confirm everything works:

import numpy as np
from routing.core.grid import SmartGrid
from routing.pathfinding.finder.a_star import AStarFinder
from routing.pathfinding.core.diagonal_movement import DiagonalMovement

weights = np.ones((5, 5, 5))
weights[2, 2, 2] = 0   # obstacle
grid  = SmartGrid(weights, voxel_size=1.0, origin=(0.0, 0.0, 0.0))
start = grid.node(0, 0, 0)
end   = grid.node(4, 4, 4)
start.direction = (1, 0, 0)

finder = AStarFinder(diagonal_movement=DiagonalMovement.always)
path, runs = finder.find_path(start, end, grid)
print(f"Path found: {len(path)} nodes in {runs} iterations")

If this prints a path, the installation is working correctly.