Skip to content

Installing SpatialDeform

SpatialDeform requires Python 3.10 or newer. A virtual environment is strongly recommended so GeoPandas, NumPy, SciPy, and scikit-learn do not conflict with system packages.

Optional Rust acceleration

For landmark-scale MDS or repeated large distance-matrix fits, install the Rust extra:

uv add "spatialdeform[rust]"

The estimator and spatial_smacof(..., backend="auto") select the native kernel automatically. The normal installation remains pure Python and uses the same NumPy/SciPy fallback. Confirm the active capability with:

from spatialdeform import rust_available

print(rust_available())

Choose an installation source

SpatialDeform is currently an alpha project and has not yet been released to PyPI. Install from GitHub for now. Once a release is available, the PyPI commands below become the recommended route.

With uv:

uv add "spatialdeform @ git+https://github.com/jasoncpit/dynamic-street-network.git#subdirectory=spatialdeform"

With pip:

python -m venv .venv
source .venv/bin/activate          # macOS/Linux
python -m pip install "spatialdeform @ git+https://github.com/jasoncpit/dynamic-street-network.git#subdirectory=spatialdeform"

With uv:

uv add spatialdeform

With pip:

python -m venv .venv
source .venv/bin/activate          # macOS/Linux
python -m pip install spatialdeform
git clone https://github.com/jasoncpit/dynamic-street-network.git
cd dynamic-street-network/spatialdeform
uv sync --dev --group docs

The package is installed editable inside spatialdeform/.venv.

Platform activation commands

python3 -m venv .venv
source .venv/bin/activate
python -m pip install spatialdeform
py -m venv .venv
.venv\Scripts\Activate.ps1
py -m pip install spatialdeform
py -m venv .venv
.venv\Scripts\activate.bat
py -m pip install spatialdeform

Verify the installation

python -c "import spatialdeform; print(spatialdeform.__version__)"
python -c "from spatialdeform import SpatialDeformer; print(SpatialDeformer())"

Expected version for this documentation:

0.1.0a1

For a fuller environment report:

python - <<'PY'
import geopandas
import numpy
import scipy
import shapely
import sklearn
import spatialdeform

for package in (spatialdeform, geopandas, shapely, numpy, scipy, sklearn):
    print(f"{package.__name__:16} {package.__version__}")
PY

Runtime dependencies

Dependency Minimum Purpose
Python 3.10 runtime
GeoPandas 0.14 geographic tabular input and CRS transformation
Shapely 2.0 LineString and MultiLineString geometry
NumPy 1.24 numerical arrays and linear algebra
SciPy 1.10 shortest paths, distance trees, and matrix solves
scikit-learn 1.3 estimator conventions and validation helpers

Binary wheels are available for these dependencies on common Python/platform combinations. If an installer starts compiling NumPy, SciPy, Shapely, or GeoPandas locally, first update the installer and try again:

python -m pip install --upgrade pip

Build a distribution locally

The project uses the native uv_build PEP 517 backend:

cd spatialdeform
uv build --no-sources

This produces a wheel and source archive in dist/. Test the wheel in an isolated environment:

uv run --isolated --no-project \
  --with dist/spatialdeform-0.1.0a1-py3-none-any.whl \
  tests/smoke_test.py

Version compatibility

SpatialDeform supports Python 3.10–3.13 in continuous integration. Python 3.14 will be added after the full geospatial dependency stack publishes compatible wheels.