Skip to content

build_geometry

Construct a Geometry from a [geometry] config dict.

build_geometry

build_geometry(geo_cfg: dict) -> Geometry

Construct a Geometry from a [geometry] config dict.

Validates the lattice key, then delegates traversal selection and validation to the lattice-specific build_traversal dispatcher, then returns a fully-populated Geometry dataclass.

Parameters:

Name Type Description Default
geo_cfg dict

Geometry sub-dict from the TOML [geometry] section. Must contain lx and optionally ly (default 1), lattice (default 'square'), and traverse (default 'sequential', used by 2D lattices).

required

Returns:

Type Description
Geometry

Fully-resolved geometry struct ready for passing to build_intrcmap or any intrcmap_* builder.

Raises:

Type Description
ValueError

If lattice names an unrecognised option, or if traverse names an option not supported by the selected lattice module.

Supported Values

lattice Builder
"chain" intrcmap_1dchain
"square" intrcmap_square
"kagome" intrcmap_kagome

See Also