defines
Defines API
Classes:
-
ModuleType–Enum representing the type of exported module.
Copyright 2025 Ambiq. All Rights Reserved.
Classes
AnyCaseStrEnum
Case-insensitive string enumeration.
This is useful for parsing user input in a flexible manner.
LowerCaseStrEnum
Lowercase string enumeration.
UpperCaseStrEnum
Uppercase string enumeration.
ModuleType
ScheduleMode
Operator dispatch shape emitted into <prefix>_model.c.
Selects how model_init / model_run invoke each operator. Both modes
preserve the public ABI (signatures, status enum, lifecycle latch and
constant hydration); only the internal dispatch differs.
Attributes:
-
table(str) –Runtime function-pointer table iterated by a
forloop, with the per-nodectx->callbackinstrumentation seam preserved. The integration shape for RTOS scheduling / PMU sampling. -
static(str) –A straight-line sequence of direct calls to each operator's
_run(and_init) symbol. No function-pointer table, no loop, no indirect dispatch — the AOT-correct shape that is fully optimizer-visible. The per-node callback seam is omitted.
Functions
warn_unknown_config_keys
mode="before" validator helper: warn about unknown config keys.
Unknown keys currently load silently (pydantic's default extra="ignore"
drops them), which hides YAML typos like memory.planer. This surfaces
them as deprecation warnings with a did-you-mean suggestion; a future
release will reject them outright.
Keys listed in a class's _REMOVED_KEYS are skipped — a dedicated
migration validator already hard-errors on those with a better message —
and they are excluded from the did-you-mean pool so a typo can never be
"corrected" into a key that then hard-errors.
Coverage note: pydantic dataclasses constructed directly with kwargs
pass an ArgsKwargs (not a dict) through mode="before" validators,
so programmatic TransformSpec(nme=...) stays silent (pre-existing
behavior). All dict-driven paths — YAML config, model_validate — are
covered.
Parameters:
-
(clstype) –The pydantic model or dataclass being validated.
-
(dataobject) –The raw input; passed through untouched.
-
(locationstr) –Human-readable config location for the warning text (e.g.
"memory").
Returns:
-
object–data, unchanged.