cadet.config¶
CADET configuration package.
- What this is for:
The typed configuration layer for CADET experiments: the schema, the typed per-app parameter models, the weather presets, and the loader that applies overrides, expands sweeps and derives run ids.
- What it contains:
Re-exports the most-used names so callers can do
from cadet.config import Config, load_run_configs, run_id.- How it fits into CADET:
Everything that needs to read an experiment definition (the
cadet validateCLI, and later the runner/orchestrator and roles) depends on this package rather than on the legacycadet/params.pymodule.
- class cadet.config.Config(**data)¶
Bases:
_StrictA complete CADET experiment configuration.
- Parameters:
experiment (Experiment)
source (Annotated[CarlaSource | ReplaySource | SyntheticSource | LiveSource | DatasetSource, FieldInfo(annotation=NoneType, required=True, discriminator='kind')])
models (Models)
nodes (List[Node])
channels (List[Channel])
connectors (List[Connector])
links (List[Link])
routes (List[Route])
transport (TransportConfig)
metrics (MetricsConfig)
app (App)
pipeline (PipelineConfig | None)
sweep (Sweep)
outputs (Outputs)
analysis (AnalysisConfig)
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
experiment:
Experiment¶
-
source:
Annotated[Union[CarlaSource,ReplaySource,SyntheticSource,LiveSource,DatasetSource]]¶
-
transport:
TransportConfig¶
-
metrics:
MetricsConfig¶
-
pipeline:
Optional[PipelineConfig]¶
-
analysis:
AnalysisConfig¶
- exception cadet.config.ConfigError¶
Bases:
ExceptionRaised for unreadable/undecodable configs or bad override strings.
- cadet.config.build_config(data)¶
Validate a mapping into a
Config(raisesValidationError).- Return type:
- Parameters:
data (Dict[str, Any])
- cadet.config.config_hash(config)¶
Short, stable digest of a resolved config, excluding
IDENTITY_EXCLUDES.Keys are sorted so the digest is order-independent.
- Return type:
str- Parameters:
config (Config)
- cadet.config.expand_sweep(data)¶
Expand
sweep.axesinto the cartesian product of concrete configs.Each produced config has its swept paths set and an empty
sweep. With no axes, this returns a single config. Validation happens per combination.- Return type:
List[Config]- Parameters:
data (Dict[str, Any])
- cadet.config.format_validation_error(exc)¶
Render a pydantic
ValidationErroras readableloc: messagelines.- Return type:
str- Parameters:
exc (ValidationError)
- cadet.config.load_config_data(path, _seen=())¶
Load a YAML config, resolving any
extends:base(s) by deep-merge.extendsmay be a single path or a list of paths, each relative to the config file that declares it. Bases are merged left-to-right, then the current file is merged on top (so the child always wins). Supports nested extends and detects cycles.- Return type:
Dict[str,Any]- Parameters:
path (str)
_seen (Tuple[str, ...])
- cadet.config.load_run_configs(path, overrides)¶
Load, override and expand a config file into concrete run configs.
Returns
(run_configs, base_config)wherebase_configis the single pre-expansion config (useful for reporting).
- cadet.config.load_yaml(path)¶
Parse a YAML file into a mapping (raises
ConfigError).- Return type:
Dict[str,Any]- Parameters:
path (str)
- cadet.config.resolve_app_params(config)¶
Validate
config.app.paramsagainst the registered plugin’s model.The app plugin (registered via
cadet.core.apps, typically by importing anexamples/*module) declaresparams_model. This validates the raw params against it and returns the typed instance. RaisesConfigErrorif the plugin is not registered, orValidationErrorif params are invalid.- Parameters:
config (Config)
- cadet.config.run_id(config, rep)¶
Identifier for one repetition:
<config-hash>-r<rep>.- Return type:
str- Parameters:
config (Config)
rep (int)
- cadet.config.seed_for_rep(config, rep)¶
Per-repetition seed:
experiment.seed + rep(orNoneif unset).- Return type:
Any- Parameters:
config (Config)
rep (int)
- cadet.config.unimplemented_features(config, allow_experimental=False)¶
Return the requested features this codebase will not run.
Each string is a human-readable “<path>=<value>” plus the tier that refused it, so the reader can tell “there is no code for this” from “there is code but you did not opt in”.
allow_experimentalaccepts the experimental tier. It never accepts the planned tier: there is nothing behind a planned option, so allowing it could only replace a clear refusal with a crash.- Return type:
List[str]- Parameters:
config (Config)
allow_experimental (bool)
CADET experiment configuration schema (pydantic, Python 3.8 compatible).
Defines the single, typed shape of a CADET experiment config. A YAML file is
parsed into Config; validation errors are turned into readable
messages by the loader/CLI. Nothing here executes an experiment: this is the
contract every runner, role and launcher reads.
Top-level sections of Config: experiment, source (discriminated union
on kind), models, nodes, channels, links (with a typed network model),
transport, metrics, app (generic plugin + raw params, validated against
the registered plugin’s model by the loader), sweep, outputs, analysis. Plus the leaf
models those sections use and the cross-field validators (app/plugin agreement,
channel/link endpoints must name existing nodes).
Some options are declared here but not implemented yet (e.g.
nodes.launcher: ssh_venv). They
validate against the schema and are
rejected with a “planned” message by cadet.config.implemented at
cadet validate; they are never silently ignored.
cadet.config.loader builds Config from YAML + --set
overrides, expands sweep into concrete per-run configs, and derives the
run_id. cadet validate reports validation errors against this schema.
Author a YAML with the sections above (see configs/*.yaml). Weather is a
named preset (cadet.config.weather); model artifacts are per-device in
models.registry; swept fields are dotted paths under sweep.axes.
- class cadet.config.schema.Experiment(**data)¶
Bases:
_StrictIdentity and repetition policy for a run family.
- Parameters:
name (str)
app (str)
repetitions (int)
seed (int | None)
max_startup_s (float | None)
max_active_s (float | None)
end_on (Literal['client_report', 'sim_hook_exit', 'first'])
end_grace_s (float)
client_start (Literal['before_scenario', 'after_scenario'])
require_output (bool)
inter_run_pause_s (float)
resume (bool)
allow_experimental (bool)
-
name:
str¶
-
app:
str¶
-
repetitions:
int¶
-
seed:
Optional[int]¶
-
max_startup_s:
Optional[float]¶
-
max_active_s:
Optional[float]¶
-
end_on:
Literal['client_report','sim_hook_exit','first']¶
-
end_grace_s:
float¶
-
client_start:
Literal['before_scenario','after_scenario']¶
-
require_output:
bool¶
-
inter_run_pause_s:
float¶
-
resume:
bool¶
-
allow_experimental:
bool¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.Camera(**data)¶
Bases:
_StrictEgo camera sensor geometry.
- Parameters:
width (int)
height (int)
fov (float)
mount_x (float)
mount_z (float)
mount_pitch (float)
queue_size (int)
fixed_rate (bool)
-
width:
int¶
-
height:
int¶
-
fov:
float¶
-
mount_x:
float¶
-
mount_z:
float¶
-
mount_pitch:
float¶
-
queue_size:
int¶
-
fixed_rate:
bool¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.Spawn(**data)¶
Bases:
_StrictA world pose (metres, degrees) for spawning an actor.
- Parameters:
x (float)
y (float)
z (float)
yaw (float)
-
x:
float¶
-
y:
float¶
-
z:
float¶
-
yaw:
float¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.Occluder(**data)¶
Bases:
_StrictA parked actor used to block the ego’s line of sight.
- Parameters:
model (str)
spawn (Spawn)
-
model:
str¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.Pedestrian(**data)¶
Bases:
_StrictA pedestrian that holds, then crosses at
speed_mpsaftert_start_s.- Parameters:
spawn (Spawn)
speed_mps (float)
t_start_s (float)
-
speed_mps:
float¶
-
t_start_s:
float¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.CarlaClientEgg(**data)¶
Bases:
_StrictWhich CARLA client egg a run must use, and where to find it.
nameis the egg’s filename, and it is the pin: the Python and CARLA versions are read out of it and checked against the interpreter and the server image (seecadet.orchestrator.versions).host_pathis a directory on the machine the role runs on; with it unset the image’s own baked path is used, which is not configurable because it is the image’s convention rather than a machine’s.The two are separate because one earlier field had to mean both “which egg” and “where the egg is”, and could express neither when they disagreed.
- Parameters:
name (str)
host_path (str | None)
-
name:
str¶
-
host_path:
Optional[str]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.ScenarioRunnerPin(**data)¶
Bases:
_StrictWhere the ScenarioRunner tree is, and which tree it must be.
source_digestpins the tree by file contents, not by a commit id. The copies in play are the same files in different repositories - a working tree with its own upstream history and a local snapshot repository that tracks the same files - so their commit ids differ by design and a hash pin could never hold for both. Seecadet.sim.versions.- Parameters:
path (str)
source_digest (str | None)
commit (str | None)
image (str | None)
-
path:
str¶
-
source_digest:
Optional[str]¶
-
commit:
Optional[str]¶
-
image:
Optional[str]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.CarlaSettings(**data)¶
Bases:
_StrictHow a run reaches CARLA, and - when it launches one - how it starts it.
host,portandtimeoutare what every role uses to reach the simulator, and they are what ScenarioRunner is told as well, so the scenario and the client cannot end up on different servers. That was two fields once - the client’s connect port and the launch’s own port, with nothing tying them - and a config could launch a server on one port while the client dialled another, which fails as an ego-attach timeout rather than as a connection error.portdefaults to CARLA’s own 2000, which is the original’s: its client openedcarla.Client('localhost', 2000)andrun_scenario.shpassed no--port, taking ScenarioRunner’s default of 2000. A run that must not collide with a hand-started server sets another port; preflight already refuses a port held by a process that is not ours, and names the holder.imageis what makes this a launch rather than an attach: with it set the orchestrator starts the server, and without it the simulator is somebody else’s to run.- Parameters:
host (str)
port (int)
timeout (int)
image (str | None)
gpu_index (int | None)
quality (Literal['Low', 'Epic'])
offscreen (bool)
per_run (bool)
client_egg (CarlaClientEgg | None)
-
host:
str¶
-
port:
int¶
-
timeout:
int¶
-
image:
Optional[str]¶
-
gpu_index:
Optional[int]¶
-
quality:
Literal['Low','Epic']¶
-
offscreen:
bool¶
-
per_run:
bool¶
-
client_egg:
Optional[CarlaClientEgg]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.Scenario(**data)¶
Bases:
_StrictScenario geometry and lifetime (fields optional; apps use a subset).
- Parameters:
map (str | None)
ego_vehicle (str | None)
target_object (str | None)
ego_speed (str | None)
ego_spawn (Spawn | None)
occluder (Occluder | None)
pedestrian (Pedestrian | None)
timeout_s (float | None)
ego_role_name (str | None)
ego_attach_timeout_s (float)
runner (ScenarioRunnerPin | None)
name (str | None)
definition (str | None)
config_file (str | None)
-
map:
Optional[str]¶
-
ego_vehicle:
Optional[str]¶
-
target_object:
Optional[str]¶
-
ego_speed:
Optional[str]¶
-
pedestrian:
Optional[Pedestrian]¶
-
timeout_s:
Optional[float]¶
-
ego_role_name:
Optional[str]¶
-
ego_attach_timeout_s:
float¶
-
runner:
Optional[ScenarioRunnerPin]¶
-
name:
Optional[str]¶
-
definition:
Optional[str]¶
-
config_file:
Optional[str]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.CarlaSource(**data)¶
Bases:
_StrictInput from a running CARLA simulator (the only live backend today).
- Parameters:
kind (Literal['carla'])
carla (CarlaSettings)
fps (int)
sync_mode (bool)
camera (Camera)
scenario (Scenario)
weather (Literal['clear', 'light', 'high'] | None)
-
kind:
Literal['carla']¶
-
carla:
CarlaSettings¶
-
fps:
int¶
-
sync_mode:
bool¶
-
weather:
Optional[Literal['clear','light','high']]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.ReplaySource(**data)¶
Bases:
_StrictDeterministic replay from a folder of images or a video file.
- Parameters:
kind (Literal['replay'])
path (str)
fps (float)
loop (bool)
limit (int | None)
-
kind:
Literal['replay']¶
-
path:
str¶
-
fps:
float¶
-
loop:
bool¶
-
limit:
Optional[int]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.SyntheticSource(**data)¶
Bases:
_StrictGenerated frames for tests (no files, no hardware).
- Parameters:
kind (Literal['synthetic'])
count (int)
width (int)
height (int)
fps (float)
-
kind:
Literal['synthetic']¶
-
count:
int¶
-
width:
int¶
-
height:
int¶
-
fps:
float¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.LiveSource(**data)¶
Bases:
_StrictLive capture: a camera device index or a network stream URL.
The replay path pointed at something arriving in real time rather than at a directory (see
cadet.sources.live.LiveSource). Exactly one ofdeviceandurlnames where frames come from; OpenCV takes either directly.loopis absent on purpose: a camera has no beginning to seek back to and a stream is not seekable.- Parameters:
kind (Literal['live'])
device (int | None)
url (str | None)
fps (float)
limit (int | None)
-
kind:
Literal['live']¶
-
device:
Optional[int]¶
-
url:
Optional[str]¶
-
fps:
float¶
-
limit:
Optional[int]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.DatasetSource(**data)¶
Bases:
_StrictDeterministic dataset replay for model evaluation (the “Dataset Mode”).
Yields one sample per frame, carrying both the input image and the sample’s ground truth in the frame metadata, so a consumer can score a model’s answer against it. Two tasks are supported:
vqa(image + question + answers) anddetection(image + ground-truth boxes).With
pathunset the source generates a small, deterministic, built-in sample set in process: no file, no download and no network, which is what the stub/quick config and the unit tests run on. Withpathset it reads a manifest (a JSON list of samples) and the images it names from that folder; the example’sfetch_dataset.pywrites one from public data.- Parameters:
kind (Literal['dataset'])
task (Literal['vqa', 'detection'])
path (str | None)
manifest (str | None)
fps (float)
limit (int | None)
count (int)
-
kind:
Literal['dataset']¶
-
task:
Literal['vqa','detection']¶
-
path:
Optional[str]¶
-
manifest:
Optional[str]¶
-
fps:
float¶
-
limit:
Optional[int]¶
-
count:
int¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.ModelEntry(**data)¶
Bases:
_StrictA logical model mapped to a concrete artifact per device type.
Only the artifact mapping lives here; decision thresholds (conf_thresh, …) belong to the app params so each value has a single source of truth.
- Parameters:
per_device (Dict[str, str])
-
per_device:
Dict[str,str]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.Models(**data)¶
Bases:
_StrictPipeline component choices plus the logical-name -> artifact registry.
There is no
devicefield: the device type a model runs on is derived from the node that hosts it (the server/sim node’sdevice), so device lives in one place.- Parameters:
detector (str)
tracker (str)
predictor (str)
model (str | None)
warmup (bool)
registry (Dict[str, ModelEntry])
-
detector:
str¶
-
tracker:
str¶
-
predictor:
str¶
-
model:
Optional[str]¶
-
warmup:
bool¶
-
registry:
Dict[str,ModelEntry]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.TransportTuning(**data)¶
Bases:
_StrictTCP stack settings for one node, applied only in that node’s namespace.
Packet-level backends (
netem,netwaggle) let the transport react to the emulated link, and for small paced request/response messages that reaction is large: measured on a 60 ms forward link, the same traffic took 141 ms with kernel defaults and 110 ms with Nagle off. These knobs make that policy explicit instead of inherited.Every field defaults to
None, meaning “leave the kernel’s default alone”.tcp_nodelayis a socket option and works anywhere;tcp_slow_start_after_idleis a per-namespace sysctl andinitcwnda route attribute, so both require the node to own a network namespace (a container or an emulated host) and are refused for alocalnode, where they would change the host.- Parameters:
tcp_nodelay (bool | None)
tcp_slow_start_after_idle (bool | None)
initcwnd (int | None)
-
tcp_nodelay:
Optional[bool]¶
-
tcp_slow_start_after_idle:
Optional[bool]¶
-
initcwnd:
Optional[int]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.Node(**data)¶
Bases:
_StrictA compute node that hosts a role (client/server/sim).
launcherand the optionalcontainer/venv/user/ssh_portfields capture how the node is reached; they generalise the constants in the external orchestrator (ssh-into-docker, ssh+docker, ssh+venv tiers).- Parameters:
name (str)
host (str)
port (int | None)
launcher (Literal['local', 'docker', 'ssh_docker', 'ssh_venv'])
role (Literal['client', 'server', 'sim', 'leader', 'load', 'waypoint'])
device (str)
gpu_index (int | None)
scheduler (Literal['fifo', 'round_robin'] | None)
extra_processing_ms (float | None)
server_delay_mode (Literal['blocking', 'link'])
enforce_queue_policy (bool)
inbound_block_at (int | None)
clients (int | None)
rate_hz (float | None)
arrival (Literal['constant', 'poisson'] | None)
frames (int | None)
transport_tuning (TransportTuning | None)
connector (str | None)
position (str | None)
container (str | None)
venv (str | None)
user (str | None)
ssh_port (int | None)
ssh_identity (str | None)
-
name:
str¶
-
host:
str¶
-
port:
Optional[int]¶
-
launcher:
Literal['local','docker','ssh_docker','ssh_venv']¶
-
role:
Literal['client','server','sim','leader','load','waypoint']¶
-
device:
str¶
-
gpu_index:
Optional[int]¶
-
scheduler:
Optional[Literal['fifo','round_robin']]¶
-
extra_processing_ms:
Optional[float]¶
-
server_delay_mode:
Literal['blocking','link']¶
-
enforce_queue_policy:
bool¶
-
inbound_block_at:
Optional[int]¶
-
clients:
Optional[int]¶
-
rate_hz:
Optional[float]¶
-
arrival:
Optional[Literal['constant','poisson']]¶
-
frames:
Optional[int]¶
-
transport_tuning:
Optional[TransportTuning]¶
-
connector:
Optional[str]¶
-
position:
Optional[str]¶
-
container:
Optional[str]¶
-
venv:
Optional[str]¶
-
user:
Optional[str]¶
-
ssh_port:
Optional[int]¶
-
ssh_identity:
Optional[str]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.Channel(**data)¶
Bases:
_StrictA direct data path between two nodes (no network emulation).
- Parameters:
name (str)
from_ (str)
to (str)
stream_fps (int | None)
max_queue (int)
send_meta (bool)
stop_on_brake (bool)
device_id (str | None)
-
name:
str¶
-
from_:
str¶
-
to:
str¶
-
stream_fps:
Optional[int]¶
-
max_queue:
int¶
-
send_meta:
bool¶
-
stop_on_brake:
bool¶
-
device_id:
Optional[str]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.ConstantDist(**data)¶
Bases:
_StrictFixed per-packet delay.
- Parameters:
kind (Literal['constant'])
value_ms (float)
-
kind:
Literal['constant']¶
-
value_ms:
float¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.NormalDist(**data)¶
Bases:
_StrictGaussian delay.
- Parameters:
kind (Literal['normal'])
mean_ms (float)
std_ms (float)
-
kind:
Literal['normal']¶
-
mean_ms:
float¶
-
std_ms:
float¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.LognormalDist(**data)¶
Bases:
_StrictLog-normal delay (long tail), stated as two percentiles.
A latency spec is normally given as percentiles, and these are them:
p50_msis the median (the distribution’s scale, e^mu) andp99_msfixes the shape, sigma = ln(p99/p50) / 2.3263. Neither is the mean or the standard deviation of the random variable, which is why they are not called that: a log-normal’s mean sits above its median, so a field namedmeanholding the median is read wrong by everyone who has not read the code.- Parameters:
kind (Literal['lognormal'])
p50_ms (float)
p99_ms (float)
-
kind:
Literal['lognormal']¶
-
p50_ms:
float¶
-
p99_ms:
float¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.TraceDist(**data)¶
Bases:
_StrictReplay delays from a recorded trace file.
- Parameters:
kind (Literal['trace'])
path (str)
-
kind:
Literal['trace']¶
-
path:
str¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.WifiNodeSpec(**data)¶
Bases:
_StrictOne endpoint’s radio role and position on a wireless link.
positionis"x,y,z"in metres. It is what the propagation model acts on, so leaving it unset on a link whose model depends on distance makes the link’s behaviour arbitrary.- Parameters:
role (Literal['ap', 'station'])
position (str | None)
-
role:
Literal['ap','station']¶
-
position:
Optional[str]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.WifiMedium(**data)¶
Bases:
_StrictRadio parameters of one wireless medium, with no endpoints in them.
The propagation model is the point of the wireless medium: it derives signal strength, and therefore association and loss, from the distance between positions.
mobility_tracenames a file of timed positions for a node that moves during the run.These are properties of the medium, not of whoever is on it, which is why they are separated from the endpoints: a point-to-point wireless link states them alongside its two radio roles (
WifiConfig), and an access-point connector states them for the whole cell (Connector).- Parameters:
ssid (str)
mode (Literal['a', 'b', 'g', 'n', 'ac'])
channel (int)
propagation_model (Literal['logDistance', 'friis', 'twoRayGround', 'logNormalShadowing', 'ITU'])
propagation_exp (float)
propagation_params (Dict[str, float])
mobility_trace (str | None)
-
ssid:
str¶
-
mode:
Literal['a','b','g','n','ac']¶
-
channel:
int¶
-
propagation_model:
Literal['logDistance','friis','twoRayGround','logNormalShadowing','ITU']¶
-
propagation_exp:
float¶
-
propagation_params:
Dict[str,float]¶
-
mobility_trace:
Optional[str]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.WifiConfig(**data)¶
Bases:
WifiMediumA point-to-point wireless link’s medium plus the radio role of each end.
This is the spelling for a link whose two endpoints are the whole cell. A cell with several stations on one access point is not point to point and is declared as a
connectorsentry instead; seeConnector.- Parameters:
ssid (str)
mode (Literal['a', 'b', 'g', 'n', 'ac'])
channel (int)
propagation_model (Literal['logDistance', 'friis', 'twoRayGround', 'logNormalShadowing', 'ITU'])
propagation_exp (float)
propagation_params (Dict[str, float])
mobility_trace (str | None)
nodes (Dict[str, WifiNodeSpec])
-
nodes:
Dict[str,WifiNodeSpec]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.Connector(**data)¶
Bases:
_StrictA shared medium that nodes attach to, and that runs nothing itself.
A
linksentry is point to point: onefrom, oneto, and its own qdiscs. A Wi-Fi cell is not that shape. Five stations associating with one access point share one medium, sit in one subnet, and reach each other over the air with no L3 hop and no route between them, which two point-to-point links in series cannot express.So a connector is infrastructure, deliberately not a
nodesentry: there is no role to dispatch on it and nothing binds an address on it. In Mininet-WiFi an access point is a switch in the root namespace with no address of its own, so a role process placed on one has nothing to bind and dies withCannot assign requested address; keeping the two namespaces apart is what prevents that config from being expressible at all.typeapis an access point: the nodes on it are stations, associating over a radio whosewifiparameters govern the whole cell, and each one’spositionis what the propagation model acts on.switchis the same idea without radios - a wired shared segment - and goes through the same code rather than a special case.
Shaping is the medium’s own, not a per-link qdisc: a cell’s loss and delay come from the propagation model and the distances, which is why the distances are the axis such an experiment varies. A connector therefore has no
distribution,lossorbandwidth_mbps; a path that needs those is alinksentry.- Parameters:
name (str)
type (Literal['ap', 'switch'])
position (str | None)
wifi (WifiMedium | None)
-
name:
str¶
-
type:
Literal['ap','switch']¶
-
position:
Optional[str]¶
-
wifi:
Optional[WifiMedium]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.NetworkModel(**data)¶
Bases:
_StrictEmulated-network behaviour applied to a link’s traffic.
modeselects the backend:none(no emulation),delay(an in-process delay line in the transport),netem(tc inside the sending node’s own container, filtered to this link’s flow) ornetwaggle(a real emulated network built with Mininet-WiFi).mediumapplies tonetwaggleonly and chooses a wired or a wireless link.- Parameters:
mode (Literal['none', 'delay', 'netem', 'netwaggle'])
medium (Literal['wired', 'wifi'])
distribution (Annotated[ConstantDist | NormalDist | LognormalDist | TraceDist, FieldInfo(annotation=NoneType, required=True, discriminator='kind')])
loss (float)
bandwidth_mbps (float | None)
wifi (WifiConfig | None)
-
mode:
Literal['none','delay','netem','netwaggle']¶
-
medium:
Literal['wired','wifi']¶
-
distribution:
Annotated[Union[ConstantDist,NormalDist,LognormalDist,TraceDist]]¶
-
loss:
float¶
-
bandwidth_mbps:
Optional[float]¶
-
wifi:
Optional[WifiConfig]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.Link(**data)¶
Bases:
_StrictA network-emulated data path between two nodes.
directionpicks which path is delayed:forward(requests, from->to; the default, matching the originals which delayed only requests),reverse(replies, to->from), orboth.- Parameters:
name (str)
from_ (str)
to (str)
direction (Literal['forward', 'reverse', 'both'])
network (NetworkModel)
-
name:
str¶
-
from_:
str¶
-
to:
str¶
-
direction:
Literal['forward','reverse','both']¶
-
network:
NetworkModel¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.Route(**data)¶
Bases:
_StrictA path from one node to another across several links, in order.
hopsnames existinglinksentries, so a hop is a link and a route is an ordering over links: everything that already readslinks- the netem rules, the emulated topology, the link report, the feature gate - keeps working on the hops without knowing a route exists.realisesays what a multi-hop path is, which is not something that can be inferred:composeOne end-to-end connection whose behaviour is the composition of the hops. Nothing runs on the waypoints; they name where the path goes. A composed path cannot queue, cannot drop on a full buffer and cannot be where computation happens.
relayEach waypoint runs a forwarding stage that receives a message and sends it on, so a hop is a real store-and-forward step with its own queue and its own failure mode. This is what an experiment about the waypoint needs.
viais optional and redundant: when given it must name exactly the waypoints the hops already imply, which makes a route readable without re-deriving it and is checked rather than trusted.- Parameters:
name (str)
from_ (str)
to (str)
hops (List[str])
realise (Literal['compose', 'relay'])
via (List[str] | None)
-
name:
str¶
-
from_:
str¶
-
to:
str¶
-
hops:
List[str]¶
-
realise:
Literal['compose','relay']¶
-
via:
Optional[List[str]]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.TransportConfig(**data)¶
Bases:
_StrictWire transport for node-to-node traffic.
protocolselects the carrier:tcpis a plain socket,websocketwraps the same framing in RFC 6455 binary frames over one HTTP upgrade.modeselects framing:framesends one length-prefixed message per payload,streamdrops the transport’s prefix and lets the receiver find each record’s end in the encoding itself (so it needsencoding: safe).encodingselects the wire format of a payload.safeis a self-describing record - a JSON header plus the raw image bytes - that executes nothing it decodes.pickleis the original scripts’ format (zlib.compress(pickle.dumps(...))); it is what the originals put on the wire, and it means the receiver runs code chosen by whoever can connect to the port, so it is an explicit opt-in rather than a default.- Parameters:
protocol (Literal['tcp', 'websocket'])
mode (Literal['frame', 'stream'])
encoding (Literal['safe', 'pickle'])
-
protocol:
Literal['tcp','websocket']¶
-
mode:
Literal['frame','stream']¶
-
encoding:
Literal['safe','pickle']¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.GpuMetrics(**data)¶
Bases:
_StrictOptions for the
gpucollector (utilization, memory, power).interval_msdefaults to the original’s: its power log came fromnvidia-smi ... -lms 10.sourcepins the reader -autoprefers NVML and falls back to thenvidia-smistream the original used, and every row records which one produced it.devicesselects device indices; unset means every visible device.- Parameters:
interval_ms (int)
source (Literal['auto', 'nvml', 'nvidia-smi'])
devices (List[int] | None)
-
interval_ms:
int¶
-
source:
Literal['auto','nvml','nvidia-smi']¶
-
devices:
Optional[List[int]]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.CpuMetrics(**data)¶
Bases:
_StrictOptions for the
cpucollector (host and per-process CPU and memory).interval_msis 100 ms rather than the GPU default: a CPU percentage is time divided by a window, so too short a window measures the sampling jitter.per_processrecords this role’s own share beside the host’s; set it false for the host scope only.- Parameters:
interval_ms (int)
per_process (bool)
-
interval_ms:
int¶
-
per_process:
bool¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.EnergyMetrics(**data)¶
Bases:
_StrictOptions for the
energycollector (power over the run, per inference).interval_msunset takes the chosen source’s own original cadence: 10 ms for the GPU and Jetson readers, which is what every one of those originals sampled at, and 100 ms forrpi_proxy, which is what its original used. Setting it pins one value for whatever source is chosen.sourcepins the power source;autotries NVML, thenvidia-smistream,tegrastats, the Jetson INA channels in sysfs, then x86 RAPL, and refuses if none can be read.The two Jetson sources are ports of the project’s own
tegrastats_logger.pyandjetson_power_logger.py- rails, units, cadence and failure behaviour taken from those scripts - but they are verified on hardware: no: no Jetson is reachable from this environment. They also meter different rail sets (tegrastatsreads the GPU and CPU rails; sysfs reads GPU, CPU and SOC), so they are not interchangeable.rpi_proxyis a port of the method inrpi_yolo.pyand is not a power measurement: it is a weighted sum of a CPU percentage, a memory percentage and an undifferenced cumulative disk-byte counter. It is recorded in its ownactivity_indexcolumn and never as watts or joules, andautowill not choose it.tegrastats_sudokeeps thesudothe original rantegrastatsunder; set it false where the role is already root or there is nosudo.- Parameters:
interval_ms (int | None)
source (Literal['auto', 'nvml', 'nvidia-smi', 'tegrastats', 'tegra_sysfs', 'rapl', 'rpi_proxy'])
devices (List[int] | None)
tegrastats_sudo (bool)
-
interval_ms:
Optional[int]¶
-
source:
Literal['auto','nvml','nvidia-smi','tegrastats','tegra_sysfs','rapl','rpi_proxy']¶
-
devices:
Optional[List[int]]¶
-
tegrastats_sudo:
bool¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.BandwidthMetrics(**data)¶
Bases:
_StrictOptions for the
bandwidthcollector (bytes per link and direction).interval_msis 100 ms for the same reason as the CPU collector: a byte counter only becomes a rate over a window.- Parameters:
interval_ms (int)
-
interval_ms:
int¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.ClockOffsetMetrics(**data)¶
Bases:
_StrictOptions for the
clock_offsetcollector (per-node clock difference).Unlike the sampling collectors this one is measured by the orchestrator, once per run per node, and recorded in
run.jsonrather than in a CSV: it describes the run’s timestamps rather than being one of them.methodisautoby default, which estimates the offset from round trips the orchestrator makes itself and records each machine’s own time daemon beside it as an independent cross-check.round_triprecords only the former;time_serviceuses the daemons as the estimate and refuses the run if either machine runs none, rather than falling back to a different method than the one that was asked for.- Parameters:
method (Literal['auto', 'round_trip', 'time_service'])
probes (int)
timeout_s (float)
-
method:
Literal['auto','round_trip','time_service']¶
-
probes:
int¶
-
timeout_s:
float¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.MetricsConfig(**data)¶
Bases:
_StrictOptional measurement collectors to run during an experiment.
Per-frame latency (model-level) and per-request server queue metrics are always recorded. The
collectorslist enables additional system/task collectors, each of which runs on the node it measures and writes<collector>_<node>.csvinto the run directory.clock_offsetis the one exception to that shape: a clock difference is a property of a pair of machines rather than of a node, so the orchestrator measures it and writes it, with its uncertainty, into theclock_offsetblock ofrun.json. It corrects nothing - seecadet.metrics.clock_offset.The default is an empty list, so an unconfigured run starts no sampling threads, opens no readers and writes no extra files - it behaves exactly as it did before the collectors existed. That default is pinned in
tests/unit/test_collectors.py.- Parameters:
collectors (List[Literal['gpu', 'cpu', 'bandwidth', 'queue', 'energy', 'clock_offset']])
gpu (GpuMetrics)
cpu (CpuMetrics)
energy (EnergyMetrics)
bandwidth (BandwidthMetrics)
clock_offset (ClockOffsetMetrics)
-
collectors:
List[Literal['gpu','cpu','bandwidth','queue','energy','clock_offset']]¶
-
gpu:
GpuMetrics¶
-
cpu:
CpuMetrics¶
-
energy:
EnergyMetrics¶
-
bandwidth:
BandwidthMetrics¶
-
clock_offset:
ClockOffsetMetrics¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.DeadlineSpec(**data)¶
Bases:
_StrictA per-stage time-to-decision budget (ported deadline-enforcement semantics).
noneruns the stage at full fidelity;statichands it a fixedbudget_msevery frame;dynamichands it the time remaining until the end-to-endbudget_ms. A stage reads the budget only if it adapts its work.- Parameters:
policy (Literal['none', 'static', 'dynamic'])
budget_ms (float | None)
-
policy:
Literal['none','static','dynamic']¶
-
budget_ms:
Optional[float]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.StageSpec(**data)¶
Bases:
_StrictOne placed stage: an impl from the registry assigned to a node.
- Parameters:
name (str)
impl (str)
node (str)
params (Dict[str, Any])
queue_policy (Literal['latest_only', 'fifo'])
deadline (DeadlineSpec | None)
-
name:
str¶
-
impl:
str¶
-
node:
str¶
-
params:
Dict[str,Any]¶
-
queue_policy:
Literal['latest_only','fifo']¶
-
deadline:
Optional[DeadlineSpec]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.PipelineConfig(**data)¶
Bases:
_StrictThe ordered list of stages that make up a staged application.
- Parameters:
stages (List[StageSpec])
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.Sweep(**data)¶
Bases:
_StrictCartesian sweep over dotted config paths -> list of values.
- Parameters:
axes (Dict[str, List[Any]])
-
axes:
Dict[str,List[Any]]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.Outputs(**data)¶
Bases:
_StrictWhere run artifacts go. By policy, results/weights are never committed.
- Parameters:
root (str)
naming (str)
save (List[str])
-
root:
str¶
-
naming:
str¶
-
save:
List[str]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.AnalysisConfig(**data)¶
Bases:
_StrictWhere
cadet summarize/cadet asksend a run’s reduced record.The analysis layer ends in files; this section says what may read them back and answer questions about them. It configures no part of a run: nothing in the orchestrator, the roles or the transport reads it, and a run never calls a model.
backend: noneis the default, so an unconfigured CADET has no backend configured and both subcommands refuse with a message naming what to set.openai_chatis any OpenAI-compatible/chat/completionsendpoint, or a local model served behind the same route shape; the call is one HTTP POST, so it adds no dependency.There is no field for an API key, and there will not be one.
api_key_envnames an environment variable, and the key is read from the environment at the moment of a request. A key in a config would be copied into every run directory’s resolvedconfig.yaml, which is the one place it must never be. Set it empty for an endpoint that takes no key, such as a model served on the machine the command runs on.- Parameters:
backend (Literal['none', 'openai_chat'])
endpoint (str | None)
model (str | None)
api_key_env (str)
timeout_s (float)
max_context_bytes (int)
temperature (float)
-
backend:
Literal['none','openai_chat']¶
-
endpoint:
Optional[str]¶
-
model:
Optional[str]¶
-
api_key_env:
str¶
-
timeout_s:
float¶
-
max_context_bytes:
int¶
-
temperature:
float¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.App(**data)¶
Bases:
_StrictApp selector + its raw parameters.
The framework is app-agnostic:
paramsis a free mapping here and is validated against the registered plugin’s typed model separately (seecadet.config.loader.resolve_app_params()), socadet/never imports app-specific param models.- Parameters:
plugin (str)
params (Dict[str, Any])
-
plugin:
str¶
-
params:
Dict[str,Any]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cadet.config.schema.Config(**data)¶
Bases:
_StrictA complete CADET experiment configuration.
- Parameters:
experiment (Experiment)
source (CarlaSource | ReplaySource | SyntheticSource | LiveSource | DatasetSource)
models (Models)
nodes (List[Node])
channels (List[Channel])
connectors (List[Connector])
links (List[Link])
routes (List[Route])
transport (TransportConfig)
metrics (MetricsConfig)
app (App)
pipeline (PipelineConfig | None)
sweep (Sweep)
outputs (Outputs)
analysis (AnalysisConfig)
-
experiment:
Experiment¶
-
source:
Annotated[Union[CarlaSource,ReplaySource,SyntheticSource,LiveSource,DatasetSource]]¶
-
transport:
TransportConfig¶
-
metrics:
MetricsConfig¶
-
pipeline:
Optional[PipelineConfig]¶
-
analysis:
AnalysisConfig¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Loading, overriding, sweeping and identifying CADET configs.
- What this is for:
Turns a YAML file into validated
Configobjects. Applies--set key=valuecommand-line overrides, expands asweepinto one concrete config per parameter combination, and derives a stablerun_idand per-repetition seed.- What it contains:
load_yaml(),load_config_data()(resolvesextends:bases by deep-merge),apply_overrides(),set_by_path()build_config()(dict ->Config)expand_sweep()(base dict -> list of concreteConfig)ConfigErrorandformat_validation_error()for readable errors
- How it fits into CADET:
cadet validate(cadet.cli) and, later, the runner/orchestrator call these helpers. Overrides and sweeps are applied to the raw mapping before validation, so every produced config is typed and checked.- How to configure it:
Overrides are
dotted.path=yaml_value(list indices allowed, e.g.nodes[1].host=localhost). Sweep axes are the same dotted paths mapped to value lists undersweep.axes.
- exception cadet.config.loader.ConfigError¶
Bases:
ExceptionRaised for unreadable/undecodable configs or bad override strings.
- cadet.config.loader.load_yaml(path)¶
Parse a YAML file into a mapping (raises
ConfigError).- Return type:
Dict[str,Any]- Parameters:
path (str)
- cadet.config.loader.load_config_data(path, _seen=())¶
Load a YAML config, resolving any
extends:base(s) by deep-merge.extendsmay be a single path or a list of paths, each relative to the config file that declares it. Bases are merged left-to-right, then the current file is merged on top (so the child always wins). Supports nested extends and detects cycles.- Return type:
Dict[str,Any]- Parameters:
path (str)
_seen (Tuple[str, ...])
- cadet.config.loader.set_by_path(data, path, value)¶
Set
valueatpathinside the nesteddata(mutates in place).Intermediate dict keys are created if missing; list indices must already exist (we never guess list length). A list may also be subscripted by an element’s
name-nodes[server].hostandnodes['server'].hostboth mean the node namedserver- which is how a node is identified everywhere else in a config, and which survives a node being inserted above it.- Return type:
None- Parameters:
data (Dict[str, Any])
path (str)
value (Any)
- cadet.config.loader.apply_overrides(data, overrides)¶
Apply
key=valueoverrides to a copy ofdataand return it.The value is parsed as a YAML scalar, so
5,trueand[a, b]get their natural types.- Return type:
Dict[str,Any]- Parameters:
data (Dict[str, Any])
overrides (List[str])
- cadet.config.loader.reject_moved_keys(data)¶
Raise
ConfigErrornaming the replacement for each moved key.- Return type:
None- Parameters:
data (Dict[str, Any])
- cadet.config.loader.build_config(data)¶
Validate a mapping into a
Config(raisesValidationError).- Return type:
- Parameters:
data (Dict[str, Any])
- cadet.config.loader.resolve_app_params(config)¶
Validate
config.app.paramsagainst the registered plugin’s model.The app plugin (registered via
cadet.core.apps, typically by importing anexamples/*module) declaresparams_model. This validates the raw params against it and returns the typed instance. RaisesConfigErrorif the plugin is not registered, orValidationErrorif params are invalid.- Parameters:
config (Config)
- cadet.config.loader.expand_sweep(data)¶
Expand
sweep.axesinto the cartesian product of concrete configs.Each produced config has its swept paths set and an empty
sweep. With no axes, this returns a single config. Validation happens per combination.- Return type:
List[Config]- Parameters:
data (Dict[str, Any])
- cadet.config.loader.config_hash(config)¶
Short, stable digest of a resolved config, excluding
IDENTITY_EXCLUDES.Keys are sorted so the digest is order-independent.
- Return type:
str- Parameters:
config (Config)
- cadet.config.loader.run_id(config, rep)¶
Identifier for one repetition:
<config-hash>-r<rep>.- Return type:
str- Parameters:
config (Config)
rep (int)
- cadet.config.loader.seed_for_rep(config, rep)¶
Per-repetition seed:
experiment.seed + rep(orNoneif unset).- Return type:
Any- Parameters:
config (Config)
rep (int)
- cadet.config.loader.format_validation_error(exc)¶
Render a pydantic
ValidationErroras readableloc: messagelines.- Return type:
str- Parameters:
exc (ValidationError)
- cadet.config.loader.load_run_configs(path, overrides)¶
Load, override and expand a config file into concrete run configs.
Returns
(run_configs, base_config)wherebase_configis the single pre-expansion config (useful for reporting).
Implemented-feature gate: which declared options actually work yet.
The schema (cadet.config.schema) deliberately declares the full planned
config surface, including options not implemented yet, so configs are
forward-compatible and self-documenting. This module is the single place that
says which of those options are wired up, so an experiment that asks for an
unbuilt feature fails loudly (“not implemented yet: X, planned”) instead of
being silently ignored.
Contains IMPLEMENTED (option path to set of built and verified values),
EXPERIMENTAL (implemented but unverified; refused by default), and the
gate functions unimplemented_features(), experimental_features(),
and allow_experimental().
cadet validate and preflight (so cadet run / sweep /
emulate) call unimplemented_features() after schema validation and
refuse to proceed if it is non-empty. Three tiers exist because two were not
enough: a feature that is written but unproven should be refusable by default
yet exercisable with an explicit opt-in that is recorded in the run record. A
planned option stays refused regardless of the opt-in: there is nothing behind
it to run. The opt-in is experiment.allow_experimental in the config, or
--allow-experimental on run / sweep / emulate.
- cadet.config.implemented.tier(path, value)¶
Return
"implemented","experimental"or"planned"for a value.- Return type:
str- Parameters:
path (str)
- cadet.config.implemented.allow_experimental(config, flag=None)¶
Resolve the experimental opt-in from the command line and the config.
The flag wins when it is given, so
--allow-experimentalcan enable a config that does not ask for it; otherwiseexperiment.allow_experimentaldecides, which is what letscadet validatecheck a config that carries its own opt-in.- Return type:
bool- Parameters:
config (Config)
flag (bool | None)
- cadet.config.implemented.experimental_features(config)¶
Return the experimental options this config asks for, opted into or not.
- Return type:
List[str]- Parameters:
config (Config)
- cadet.config.implemented.unimplemented_features(config, allow_experimental=False)¶
Return the requested features this codebase will not run.
Each string is a human-readable “<path>=<value>” plus the tier that refused it, so the reader can tell “there is no code for this” from “there is code but you did not opt in”.
allow_experimentalaccepts the experimental tier. It never accepts the planned tier: there is nothing behind a planned option, so allowing it could only replace a clear refusal with a crash.- Return type:
List[str]- Parameters:
config (Config)
allow_experimental (bool)