Skip to content

Definitions

This section documents shared definitions and semantic primitives exposed by eb-contracts.

These definitions provide canonical constants, enums, and structural building blocks used across Electric Barometer contracts and APIs to ensure consistent interpretation of values and fields.

eb_contracts.definitions

Canonical definitions for forecasting and panel-based evaluation.

This package provides shared vocabulary, conventions, and semantic declarations used across contract schemas and evaluation workflows.

It is intentionally lightweight and declarative: - No validation logic - No business rules - No framework- or industry-specific assumptions

SemanticProfile dataclass

A named set of semantic expectations.

Profiles are descriptive and may be used by validators to decide which checks to enforce. They do not perform validation themselves.

UnitSpec dataclass

Declarative unit specification for a set of values.

Attributes: units: A string describing the measurement units (e.g., "units", "dollars", "minutes"). scale: A multiplicative scale factor applied uniformly to values. Defaults to 1.0. policy: Whether units are expected to be declared ("declared") or may be unknown ("unknown"). This is descriptive; enforcement belongs in contract validators or higher layers.

required_columns_point()

Required columns for the canonical panel point forecast representation.

required_columns_quantile()

Required columns for the canonical panel quantile forecast representation.