API Reference
This page documents the complete public pourpoint API — every class, method, and
function exported from the package. It is generated automatically from the type
stubs shipped with pourpoint (pourpoint/__init__.pyi), so the signatures here always
match the installed version. Prose is thin where the stubs are signature-only and
is being filled in over time.
For a task-oriented tour, start with the Quickstart and the Staged API guide.
pourpoint
pourpoint — Python bindings for the pourpoint watershed delineation engine.
Resolves bundled GDAL_DATA and PROJ data at import time (wheel installs). For source/editable installs the resolution is silent on miss; the user is expected to have a system GDAL/PROJ already configured.
ProgressCallback = Callable[[ProgressEvent], None]
module-attribute
__all__ = ['AreaOnlyResult', 'AssemblyError', 'BasinGeoParquetWriter', 'DatasetError', 'DelineationResult', 'DelineationUnitMetadata', 'DissolvedWatershed', 'Engine', 'LevelSelection', 'PreMergeDrainageUnit', 'PreMergeDrainageUnits', 'ResolutionError', 'ResolvedOutlet', 'SelectedLevel', 'PourpointError', 'TerminalRefinement', 'UnitBundleGeoParquetWriter', 'UpstreamUnits', 'bench_trace', 'set_log_level']
module-attribute
__version__ = _pkg_version('pourpoint')
module-attribute
ProgressEvent
Bases: TypedDict
Source code in crates/python/python/pourpoint/__init__.py
index
instance-attribute
total
instance-attribute
lat
instance-attribute
lon
instance-attribute
duration_ms
instance-attribute
status
instance-attribute
n_catchments
instance-attribute
error
instance-attribute
PourpointError
Bases: Exception
DatasetError
Bases: PourpointError
ResolutionError
Bases: PourpointError
Source code in crates/python/python/pourpoint/__init__.py
AssemblyError
Bases: PourpointError
Source code in crates/python/python/pourpoint/__init__.py
LevelSelection
DelineationResult
Source code in crates/python/python/pourpoint/__init__.py
terminal_unit_id
property
input_outlet
property
resolved_outlet
property
refined_outlet
property
resolution_method
property
upstream_unit_ids
property
upstream_units
property
area_km2
property
geometry_bbox
property
geometry_wkb
property
to_geojson()
Source code in crates/python/python/pourpoint/__init__.py
__repr__()
DelineationUnitMetadata
Source code in crates/python/python/pourpoint/__init__.py
id
property
level
property
area_km2
property
up_area_km2
property
outlet
property
__repr__()
Source code in crates/python/python/pourpoint/__init__.py
AreaOnlyResult
Source code in crates/python/python/pourpoint/__init__.py
terminal_unit_id
property
input_outlet
property
resolved_outlet
property
refined_outlet
property
resolution_method
property
upstream_unit_ids
property
area_km2
property
__repr__()
Source code in crates/python/python/pourpoint/__init__.py
SelectedLevel
ResolvedOutlet
Source code in crates/python/python/pourpoint/__init__.py
level
property
terminal_unit_id
property
input_outlet
property
resolved_outlet
property
resolution_method
property
__repr__()
UpstreamUnits
Source code in crates/python/python/pourpoint/__init__.py
terminal_unit_id
property
level
property
unit_ids
property
__repr__()
Source code in crates/python/python/pourpoint/__init__.py
PreMergeDrainageUnit
Source code in crates/python/python/pourpoint/__init__.py
id
property
level
property
area_km2
property
up_area_km2
property
outlet
property
__repr__()
Source code in crates/python/python/pourpoint/__init__.py
PreMergeDrainageUnits
TerminalRefinement
status
property
refined_outlet
property
__repr__()
DissolvedWatershed
area_km2
property
geometry_wkb
property
__repr__()
BasinGeoParquetWriter
__init__()
write(engine, path, results, *, basin_ids=None, method=None, allow_default_basin_id=False)
__repr__()
UnitBundleGeoParquetWriter
__init__()
write(engine, path, bundles, refinements, *, method=None)
__repr__()
Engine
__init__(dataset_path, *, snap_radius=None, snap_strategy=None, snap_threshold=None, clean_epsilon=None, refine=True, repair_geometry='auto', parquet_cache=None, parquet_cache_max_mb=512)
delineate_batch(outlets, *, progress=None)
select_level(selection=LevelSelection.FINEST)
resolve_outlet(level, *, lat, lon)
traverse(outlet)
pre_merge_units(upstream)
refine(outlet, units)
dissolve(units, refinement)
compose_result(outlet, upstream, units, refinement, dissolved)
set_log_level(level)
Set the pourpoint log level for both the Rust bridge and Python logging.
Updates the dynamic max-level used by the pyo3-log bridge and configures
the relevant Python loggers so records actually emit. If any pourpoint logger
has no handler, a default StreamHandler is attached to that logger.
Records originating from Rust route through pyo3-log under loggers named
after their Rust crate (_pourpoint.*, pourpoint_core.*, hfx.*).
We therefore set the level on each of those roots in addition to the
Python pourpoint facade.
Valid levels (case-insensitive): "trace", "debug", "info",
"warn"/"warning", "error"/"critical".
Source code in crates/python/python/pourpoint/__init__.py
bench_trace(path)
Write Rust stage-span benchmark telemetry to path inside the context.