Finite metric-space engine
METRIC
Numerical computing for finite metric spaces. Vector spaces are supported as a special case, not assumed as the foundation.
An engine, not an algorithm shelf.
METRIC organizes metric-space computation around one pipeline: records plus a metric become a space; user intent selects strategies, representations, runtimes, and named results.
RecordSet + MetricDefine geometry for strings, vectors, graphs, histograms, time series, images, or structured records.
MetricSpaceOwn stable IDs, metadata, metric assumptions, and finite-space state.
IntentUse clear names: neighbors, groups, embed, map, reduce, denoise, outliers, compare.
Strategy + RuntimeSelect algorithms, exactness, approximation, materialization, parallelism, and reproducibility.
ResultReturn diagnostics, lineage, metric assumptions, warnings, and source-to-target mappings.
Use the metric-space core now. Grow into intent names as the facade lands.
Find
Use nearest-neighbor helpers and explicit representations for local structure.
Represent
Use matrix, graph, and tree spaces when a workflow needs cached or sparse structure.
Transform
Use intrinsic-dimension diagnostics, entropy, MGC, and mapping modules where the current core exposes tested operators.
from metric import Edit, Space
records = ["cat", "cot", "coat", "dog"]
space = Space(records, Edit())
print(space.distance(0, 1))
print(space.neighbors("cut", k=2))