Skip to main content

Types & Units

Every SedaroML field is statically typed. Types come from SedaroTS, the platform-wide type system, which is what makes models portable across languages and lets the Simulation Compiler verify that models, queries, and behavior implementations all agree — including physical units.

A field is one of three kinds:

KindDeclared asSemantics
Typed datumA SedaroTS type string, e.g. rad, km, #[f64; 3]Unit- and frame-aware value. Assigned values must be convertible to the declared type.
Plain valueA host-language type that maps onto a SedaroTS typeOrdinary scalar/collection data, type-checked against its SedaroTS equivalent.
RelationshipAnother ontology typeA typed reference to another instance. See Relationships.

Typed Data

Typed-datum fields declare their SedaroTS type explicitly and get its full semantics — units, SI unit conversions, reference frames, tensors, and optionals/collections of any of the above (e.g. "[ecef?]?").

Assigned values are checked against the field's declared type: a value must be convertible to that type — assigning 8000 m to a km field, or a plain 0.5 to a rad field, is accepted — while incompatible assignments (wrong dimension, wrong shape) are errors at assignment time, long before a simulation is built.

The type system carries the same unit-awareness into simulation: a behavior that consumes angle in degrees from an instance that stores radians just writes angle as deg in its query, and the conversion is compiler-verified. No manual unit conversions, no unit bugs.

Plain Values

Plain fields are declared with ordinary host-language types, which map onto SedaroTS "basic" types and are stored as-is in the host language. See Fields for the concrete Python-to-SedaroTS mapping.

Enumerations

Enum-typed fields constrain a value to a fixed set of variants. All variants of an enum must share a single underlying SedaroTS type (e.g. all strings, or all integers) — heterogeneous enums are rejected. Enum values are stored and serialized as their underlying values, and the enum definition itself is captured in the model's schema so editors can present the legal choices.

Constraints on Types

  • Typed-datum fields must always declare a SedaroTS type — an "untyped" typed datum is an error.
  • A typed datum may not appear inside a union. Use an optional typed-datum type (e.g. "rad?") instead of a union with None.
  • Map keys may not be optional.

For value-level constraints beyond types (ranges, cross-field conditions), see Constraints & Derivation.