bloc.calc_note_utils#
Adapter shims that let non-ctwrap callers reuse bloc.calc_note._collect_scenario().
Background#
bloc.calc_note._collect_scenario() was designed to operate on live ctwrap
objects: a Parser-like config (accessed via cfg.parameters.<key> and
cfg.export.<key>) and a Simulation-like result (accessed via sim.data).
Scripts that run their own simulation loop — such as the tube-furnace parametric
study — manage plain Python dicts and never instantiate ctwrap objects. Rather
than duplicating _collect_scenario or coupling it to a second calling convention,
these lightweight adapters duck-type the expected ctwrap interface so that the
same function can be called without modification from either context.
Classes#
- _Ns
Wraps a dict as an attribute-access namespace (
ns.keyinstead ofd["key"]), while preservingdict-style.items()and.get().- _MockConfig
Presents the
ctwrap.Parserinterface (cfg.parameters,cfg.export) backed by plain dicts.- _MockCtSim
Presents the
ctwrap.Simulationinterface (sim.data) backed by a plain result dict.