genplanner.Zone

class genplanner.Zone[source]

Abstract base class for all zone types.

A Zone is a lightweight, comparable entity used across the pipeline to describe named zoning concepts (e.g., territorial zone kinds, functional zone groups, or temporary technical zones). Zones are orderable and hashable based on (name, min_area) so they can be used as dictionary keys and sorted deterministically.

Subclasses must provide a name and may override validation and area constraints.

Notes

  • Ordering and equality are defined by (name, min_area), not identity.

  • min_area is a generic minimum area constraint. For territorial zones it typically represents the minimum block area.

abstract property name

Human-readable zone name.

Returns:

Zone name.

Return type:

str

validate()[source]

Validate the zone configuration.

Subclasses should override this method and raise an exception if the zone is invalid.

Implementations should raise ValueError or TypeError when invalid.

property min_area

Minimum area constraint associated with the zone.

Returns:

Minimum allowed area. Defaults to 1.0.

Return type:

float