Part of Stage 1 — behavior-preserving construction (see the Stage-1 tracking issue). Stage 0: #439. Plan documents live in the shared workspace: cellpy-workspace/architecture-plan/ (the architecture-plan repo; formerly architecture-plan/) (alongside the cellpy and cellpy-core repos). Everything in Stage 1 lands on master with the full suite green; nothing flips user-visible behavior.
Goal
Config plan Step 2: the cellpy/config/ package built next to the old system, nothing
importing it yet — models mirroring today's sections (paths, file_names, reader,
db, batch, instruments as typed models, defaults (ScienceDefaults, values in
cellpy units by convention), units (new, validated against
cellpycore.units.CellpyUnits keys), secrets (SecretStr, env-only)); layered loader
(defaults → user cellpy.toml via platformdirs → project-local walk-up → env/.env →
runtime); provenance (sources()); YAML→TOML converter; override() context manager +
isolated_config pytest fixture.
Why
The parallel build is what makes the Step-3 swap a flag-day with a small diff. The
inventory parity test from #430 asserts new defaults == old, field by field — including
deliberate fixes surfaced by validation (the limit_loaded_cycles int-vs-list lie gets a
proper union type here). The units: section is the home the unit plan's Phase 5
depends on (config plan §3.2, added in the 2026-07-09 cross-check).
Links
Acceptance
- Parity test green: every (section, field, default) triple matches or carries a
documented, deliberate divergence note.
override() fixture demonstrated in one test; provenance answers "where did this
value come from" for all four layers.
Goal
Config plan Step 2: the
cellpy/config/package built next to the old system, nothingimporting it yet — models mirroring today's sections (
paths,file_names,reader,db,batch,instrumentsas typed models,defaults(ScienceDefaults, values incellpy units by convention),
units(new, validated againstcellpycore.units.CellpyUnitskeys),secrets(SecretStr, env-only)); layered loader(defaults → user
cellpy.tomlvia platformdirs → project-local walk-up → env/.env→runtime); provenance (
sources()); YAML→TOML converter;override()context manager +isolated_configpytest fixture.Why
The parallel build is what makes the Step-3 swap a flag-day with a small diff. The
inventory parity test from #430 asserts new defaults == old, field by field — including
deliberate fixes surfaced by validation (the
limit_loaded_cyclesint-vs-list lie gets aproper union type here). The
units:section is the home the unit plan's Phase 5depends on (config plan §3.2, added in the 2026-07-09 cross-check).
Links
architecture-plan/cellpy2-configuration-and-parameters-plan.md(Steps 2, §3)architecture-plan/unit-handling-cellpy2-plan.md(Phase 5)Acceptance
documented, deliberate divergence note.
override()fixture demonstrated in one test; provenance answers "where did thisvalue come from" for all four layers.