Skip to content

canvas_engineering.schema

Portable, serializable canvas declarations.

canvas_engineering.schema.CanvasSchema dataclass

A complete, serializable declaration of canvas structure.

Bundles layout (geometry + region specs) with topology (connectivity). Designed to be the portable "type signature" for a canvas-based model.

compatible_regions(other, threshold=0.3)

Find pairs of regions across two schemas with low transfer distance.

Returns (self_region, other_region, distance) sorted by distance, filtered to distance <= threshold. Only compares regions that both have semantic_embedding set and share the same embedding_model.

from_dict(d) classmethod

Deserialize from a JSON-compatible dict.

from_json(path) classmethod

Load schema from a JSON file.

to_dict()

Serialize to a JSON-compatible dict.

to_json(path)

Write schema to a JSON file.