- Replace ecu_framework/config.py with ecu_framework/config/ package (loader.py + __init__.py re-exports). Public surface unchanged — every call site already uses 'from ecu_framework.config import ...' which works identically for a module and a package. Brings config into the same shape as lin/, power/, flashing/. - Enrich loader.py with module-level design notes (pipeline diagram, precedence rationale, "known wart" callout) and inline "why" comments: the EcuTestConfig forward-reference quirk, the int(k, 0) hex-key trick, _deep_update's mutate-in-place semantics, and the reason the in-memory overrides are applied last despite being precedence #1. - Add docs/23_config_loader_internals.md covering the merge semantics, type-coercion philosophy, dataclass ordering quirks, PSU side-channel, and the test-surface checklist (four places to touch when adding a new config field). - Fix the now-stale ecu_framework/config.py path in 01_run_sequence.md and DEVELOPER_COMMIT_GUIDE.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
31 lines
776 B
Python
31 lines
776 B
Python
"""
|
|
Configuration package.
|
|
|
|
Exports:
|
|
- EcuTestConfig: Top-level typed configuration container
|
|
- InterfaceConfig: LIN interface settings (mock / MUM / deprecated BabyLIN)
|
|
- FlashConfig: Flashing settings (enabled, hex_path)
|
|
- PowerSupplyConfig: Serial PSU (Owon) settings
|
|
- load_config: Resolve YAML + env + overrides into a typed EcuTestConfig
|
|
- DEFAULT_CONFIG_RELATIVE, ENV_CONFIG_PATH: Public constants used by load_config
|
|
"""
|
|
from .loader import (
|
|
DEFAULT_CONFIG_RELATIVE,
|
|
ENV_CONFIG_PATH,
|
|
EcuTestConfig,
|
|
FlashConfig,
|
|
InterfaceConfig,
|
|
PowerSupplyConfig,
|
|
load_config,
|
|
)
|
|
|
|
__all__ = [
|
|
"EcuTestConfig",
|
|
"InterfaceConfig",
|
|
"FlashConfig",
|
|
"PowerSupplyConfig",
|
|
"load_config",
|
|
"DEFAULT_CONFIG_RELATIVE",
|
|
"ENV_CONFIG_PATH",
|
|
]
|