qlroms.utils.builder
Config-driven qlROM building: one YAML file per model, one CLI.
python -m qlroms.utils.builder configs/ks1d_chaotic.yml [--set rom.K=20]
Three blocks, in the same style as the sibling packages' configs. case names
the test case and its window (<case module>/<TEST_CASES key> plus the
overrides that case accepts), rom says which quantized-local family to fit
and with how many charts and modes, and check says what to measure once it
is fitted: a closed-loop forecast, optionally against the global (K = 1) ROM
of the same family and rank. Unknown keys fail loudly.
Both the case trajectory and the fitted ROM come from the case's own cached
pipeline, so re-running a config only pays for what changed. Nothing here
assimilates anything -- qlroms.model.QLModel is where a fitted ROM meets an
estimator, and that lives outside this package.
load_config(path, block_keys=None, defaults=None, **overrides)
Read a YAML config, apply dotted overrides, fill defaults, reject unknown keys.
block_keys / defaults default to this module's schema; pass another pair to
validate a config of a different shape with the same rules.
Source code in qlroms/utils/builder.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |
build_case(cfg, K=None)
Case FOM, fitted qlROM and snapshot windows a resolved config describes.
Returns (fom, rom, Xtrain, Xtest, save_dir). K overrides the config's chart
count, which is how the global (K = 1) reference ROM is built from the same
charts pipeline. Trajectory and ROM are both cached under
qlroms.utils.paths.data_dir.
Source code in qlroms/utils/builder.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | |
run_build(config, **overrides)
Fit the qlROM a config describes and score it; return the metrics dict.
With check.compare_global the same family is also fitted at K = 1 and
scored on the same window, which is the comparison the ql-ROM claim rests on.
With check.save_figs the FOM-vs-ROMs page lands next to the cached model.
Source code in qlroms/utils/builder.py
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | |