Architecture

UnitFlow is organized in layers with strict downward dependencies. This matches the contributor guidelines in the main repository.

Layer

Package

Role

Dimension algebra

unitflow.core

Base dimensions, exponent vectors

Exact scale

unitflow.core

Rational coefficients, explicit π

Unit semantics

unitflow.core

Immutable units, composition

Quantity core

unitflow.core

Arithmetic, conversion, equality

Display

unitflow.core

Human-readable formatting

Definition system

unitflow.define

define_unit, namespaces, registries, prefixes

Catalogs

unitflow.catalogs

Curated SI and mechanical packs

Expressions

unitflow.expr

Symbols, trees, constraints, compile helpers

Serialization

unitflow.serialization

Structural JSON-safe payloads

Backends

unitflow.backends

Optional NumPy integration

Dependency rules

  • core does not depend on NumPy or expression-only layers.

  • expr may depend on Quantity, Unit, and Dimension.

  • catalogs depend on the semantic core, not on backends.

  • backends depend on core, not the reverse.

Changing dependency direction requires an explicit design discussion. See the full policy in the repository CONTRIBUTING.md.