You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consolidate the config loaders around one raw-table merge (#127)
Collapses the config package's merge machinery onto a single raw-table
deep-merge and cleans up the loader API around it.
- Drop the object-merge helpers: `merge_microgrid_configs`,
`merge_config_maps` and the nested per-object merge are gone.
`load_configs` now assembles its layers (default files < Assets API <
override files) as raw assets tables, deep-merges
them, and loads once. The nested `assets.microgrids.<id>` structure
gives per-ID merge and unique-ID passthrough for free; a None-skip in
`_assets._deep_merge` (a no-op on real TOML, which has no null)
reproduces the old "an unset
override keeps the base value" semantics for the API layer.
- Validate the merged whole. Because it loads once at the end,
`load_configs` validates the merged document instead of each layer
independently — so an override that is only complete after merging is
now legal (see also #126).
- load_configs returns the whole `AssetsConfig`. It already built the
full merged document internally, then discarded everything but
`.microgrids`, silently dropping the relations and `market_locations`
the file layers carry. It now returns
the document; callers wanting only the microgrid map read `.microgrids`.
- `load_configs_from_api` is now private (`_load_microgrids_from_api`).
An API-only load is just `load_configs(assets_client=...,
microgrid_ids=...).microgrids`, so the standalone loader no longer needs
to be public.
## Breaking changes (0.x)
- `merge_config_maps` / `merge_microgrid_configs` removed.
- `load_configs` returns `AssetsConfig`, not `dict[str,
MicrogridConfig]`.
- `load_configs_from_api` no longer public.
0 commit comments