telemetry_config
orchard.core.config.telemetry_config
¶
Telemetry & Filesystem Configuration.
Declarative schema for filesystem orchestration and logging policy. Resolves paths, configures logging cadence and verbosity, and exports environment-agnostic manifests.
TelemetryConfig
¶
Bases: BaseModel
Declarative manifest for telemetry, logging, and filesystem strategy.
Manages experiment artifacts location, logging behavior, and path portability across environments. Frozen after creation for immutability.
Attributes:
| Name | Type | Description |
|---|---|---|
output_dir |
ValidatedPath
|
Validated absolute path to outputs directory. |
log_interval |
LogFrequency
|
Epoch logging cadence (default: 10). |
log_level |
LogLevel
|
Logging verbosity (DEBUG, INFO, WARNING, ERROR, CRITICAL). |
handle_empty_config(data)
classmethod
¶
Handle empty YAML section by returning default dict.
When YAML contains 'telemetry:' with no values, Pydantic receives None. This validator converts None to empty dict, allowing field defaults to apply correctly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Any
|
Raw input data from YAML or dict. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
Empty dict if data is None, otherwise the original data. |
Source code in orchard/core/config/telemetry_config.py
to_portable_dict()
¶
Convert to portable dictionary with environment-agnostic paths.
Transforms absolute paths to project-relative paths (e.g., '/home/user/project/dataset' -> './dataset') to prevent host-specific filesystem leakage in exported configs.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary with all paths converted to relative strings. |