Changelog¶
Release: uv version --bump patch|minor|major, move the "Unreleased" notes under the new
version, commit, tag vX.Y.Z and create the GitHub release (publishes to PyPI).
Unreleased¶
Added¶
- Registry operations:
class-e search -p NAME[=LO:HI] -o OBS --class NAME --kind emu|data [--json]: find published files by parameters (and prior range covered), observables and CLASS build.publishrecords the space's box and build and each file's observables.class-e list --json.class-e release --registry-file F: one Zenodo record per registry release holding every file; later releases are new versions under one concept DOI (added to every space'scite); new files get azenodosource;--sandbox,--dry-run. Replacespublish --to zenodo(one record per file).class-e registry check FILE [--download emu|all] [--reachable] [--strict]andclass-e registry init DIR(registry.json, README and a GitHub Actions workflow running the check on pull requests and weekly).- Cobaya:
ClassEwarns when the model is built if the prior reaches outside the bundle's box or constraints (prior_check: 1000samples;0turns it off).class_e.cobaya.check.prior_coverage. - Library:
class_e.hub.search,class_e.hub.release,class_e.hub.audit,class_e.hub.scaffold. - Published datasets,
publish,lineage,reproduce: - Datasets in registries (
kind: data,split,meta_sha256for the sidecar), namedname#splitwherever a dataset path is accepted (class-e train --dataset lcdm#train). class-e download data NAME [--split S], or--for BUNDLEfor exactly the sets a bundle was trained and tested on (by sha256). Downloads over 100 MB are confirmed (--yes).- Hugging Face sources (
host: hf, pinned to a commit; plain HTTPS,$HF_TOKENfor private repositories), Zenodo sources (host: zenodo,meta_url). class-e publish FILE --space S --registry-file F --to file|github|hf: refuses files without a recorded space, from a CLASS build with uncommitted changes (--allow-dirty) or of another space than the registry's; numbers versions;--dry-run; confirms before uploading. Extraclass-e[hf]for Hugging Face uploads.class-e lineage NAME|PATH(bundle, training and test sets, their settings, CLASS build and where to get them) andclass-e reproduce NAME|PATH(retrain from the recorded datasets and configuration, compare errors and predictions).- Library:
class_e.hub.publish,class_e.hub.uploaders,class_e.hub.lineage. - Parameter space and CLASS build: datasets (sidecar) and bundles record
meta["space"]. It holds the parameters (box, aliases,drop),to_classexpressions, constraints, physics CLASS settings (not output selection such asoutput,l_max_scalars,z_pk), lensing, and the CLASS build (name, version, git commit,+dirty.<diff hash>for uncommitted changes), with a sha256fingerprint.classy_info()now reports the build'snameandgitstate from its checkout (e.g.AxiCLASS@ commit);theory.classy.namenames a build.mergerefuses chunks of different spaces,stitchrefuses bundles of different spaces, and downloads whose fingerprint is not the registry's are refused.class-e infoshows the space, the build and the training-set size;class-e listshows the registry's CLASS build. New:class-e diff A B(space, inputs, outputs, training, software) andclass-e verify NAME|PATH(registry sha256 and space, array hashes, reference predictions). Library:class_e.core.provenance,class_e.hub.verify. - Fixed: a bundle trained with
test_datasetrecorded its path and sha256 from the configuration string; it now records the file actually read.class-e infoshowed a recorded CLASS build without its commit. - Published emulators by name:
[registry/]name[@variant][:version](lcdm,lcdm@jax,fzu/ede@sklearn:2) wherever a.cemupath is accepted (class-e info,sample,EmulatedCosmology.load, Cobayabundle:); downloaded on first use, checked against the registry's sha256 and cached by content ($CLASS_E_CACHE).class-e list,class-e download emu NAME --backend jax,class-e registry list|add|remove|refresh,class-e cache path|remove|prune; offline use with--offline/$CLASS_E_OFFLINE=1/ Cobayaoffline: true. Registries (registry.json, schemaclass-e-registry/1) are configured in~/.config/class-e/registries.yaml; sources over HTTP(S) (resumed) or a file system, mirrors tried in order. Library:class_e.hub(resolve,lookup,install); seedocs/published-emulators.md. - Cobaya theory
class_e.cobaya.ClassE: a bundle in place ofclassy(theory: {class_e.cobaya.ClassE: {bundle: model.cemu}}), likelihoods unchanged. It provides lensed (or unlensed)Clwithclassy's units and ell factors,Hubble,angular_diameter_distance(_2),comoving_radial_distancefrom the distance emulator (with its curvature), and derived parameters from the scalar observables (rdrag,H0,h, ...); only requested products are predicted. Parameters are mapped by name, the bundle's aliases, known conversions (logAfromA_s,hfromH0,theta_s_100from100*theta_s, ...) orinput_map, withclassy's renames; points outside the training box or its constraints get zero likelihood (out_of_bounds: reject). Unsupported requests, unread parameters and missing inputs fail when the model is built. Checked againstclassyon Planck plik lite, low-ell TT/EE, DESI DR2 and Union3. Extraclass-e[cobaya]; seedocs/cobaya.md. class-e cobaya check INFO.yaml: a Cobaya input against its ClassE bundle, without likelihood data: errors that would stop the model from building, and the prior volume outside the emulators' domain, per input and constraint (Cobaya's own parameterization samples the prior). Exits 1 on errors. Library:class_e.cobaya.check.check.class_e.theory:ParameterAdapter(sampler names to bundle inputs, differentiable) andEmulatedCosmology(a bundle's spectra, distances and scalars in CLASS units), with no sampler import.- Trained bundles store every grid of the dataset and
meta["theory"](parameter aliases,drop,to_classexpressions, fixed CLASS settings, CLASS build,T_cmb, Cl convention). class-e train CFG --learning-curve 64,128,256,512 [--plots DIR]: the test error (p50, p99) and the PCA compression floor of emulators trained on the first N points, for each N, with a one-line reading per observable (still improving with data / on the compression floor: raisen_pca/ flat above the floor: the emulator is the limit), a log-log figure and the numbers as JSON. Library:class_e.commands.training.learning_curve.class-e train CFG --pca-curve 6,12,24,40 [--plots DIR]: the same for the number of PCA components (full training set;n_pcaforced in every observable and segment), with the gain of each step, a reading (more components still help / no gain beyond n: the GP or the data are the limit / levelling off), the recommendedn_pca(smallest within 10% of the best p99, circled in the figure) andpca_curve.{json,pdf,png}. Library:class_e.commands.training.pca_curve.- sklearn GP fits no longer print sklearn's
ConvergenceWarnings (noise at its 1e-8 floor, L-BFGS "ABNORMAL" line searches): they come from every optimizer start and are expected on noiseless simulator outputs. They are counted inFitResult.details["convergence_warnings"];GaussianProcessPCA.hyperparameter_notes()reports the final kernel's hyperparameters at a bound (e.g. an input whose length scale hit its upper bound barely matters), andclass-e trainprints those as oneGP:line per observable (report["fit_notes"]). InputTransform(class_e.stats.inputs): train any emulator on expressions of the physical parameters, e.g.{"s": "w0 + wa", ...}, with the interface, bundles and gradients still in the physical parameters; no measurable prediction overhead. Bundle kindinput-transform.SegmentedEmulatorsegments use the same machinery.samples.seedin the YAML:compute_datasetandclass-e generateuse it, and the seed is recorded in.meta.json(seed=still overrides it).merge_datasets(..., max_failure_fraction=).- CLI command groups as self-contained Typer apps in
class_e.commands(importable functions, runnable on their own, merged into the flatclass-eCLI): class-e generate CFG --design train|test --seed S --chunk i --n-chunks K --checkpoint-every C: one chunk of a design, resumable from its checkpoint (generate_chunk);class-e merge PREFIX -o out.npz [--max-failure-fraction F](merge_chunks) andclass-e status DIR [--json](chunk_status);class-e train [train.yaml] [flags]: YAML-driven training with shareddefaults, per-observable settings,inputs(InputTransform) and ellsegments; the flags override the YAML or replace it (load_train_config,build_emulator,train);class-e evaluate BUNDLE --test TEST [--ell-ranges] [--by "EXPR:EDGES"] [--worst N] [--json]: errors per ell range and per bin of any parameter expression, compression floor, worst points (error_report,evaluate_bundle).samples.designsin the generation YAML: several designs (e.g. train/test) sharing everything else;parse_config(path, design=).reconstruct(Y)on the GP+PCA emulators (and the wrappers): the compression floor, i.e. the public way to apply a fitted emulator's output transform and PCA.
Changed¶
- Dependencies live in pyproject.toml only;
dev-requirements.txtis gone. Extras are user features:plot,ui,jaxand the newclassy(CLASS from PyPI; other builds are still selected with--classy). Development tools are uv dependency groups, never published:test,lint(ruff, codespell; black and flake8 dropped),docs(no longer an extra),notebooks, anddev= test + lint + docs, installed by default withuv sync. pytest-runner, build, wheel, twine and bump-my-version are dropped (uv build,uv version --bump). class-e trainandclass-e generatemoved toclass_e.commands;class-e trainno longer imports the marimo notebook, so it works without theuiextra (polars);class-e inspectandtrain -isay so when the extra is missing.dev/cluster/uses the CLI (generate_chunk.py,merge_chunks.py,status.pyremoved);configs/w0wacdm-mnu-theta-act.yamldefines its train/test designs.- With
compute_dataset(rows=...)the CLASS failure limit is no longer applied per chunk (one failure in a small chunk aborted it, and again on every resume);merge_datasetschecks it over the whole merged design, and chunks must share the design seed. - Failed points are recorded with their parameters and CLASS's full error message,
meta["failed"][row] = {"theta": {...}, "error": ...}, keyed by row of the full design.
Fixed¶
- The sklearn GP crashed in
predictwithn_pca: 1(one component came back 1-D). tests/test_class_loader.pyran CLASS loading at import and left a customclassyonsys.pathfor later tests; it is now an isolated test.
0.0.4¶
Fixed¶
- Latin hypercube designs (
lhc, andcov) ignored the seed: scipy'sqmc.LatinHypercubedoes not use NumPy's global random state, so the seed now goes throughrng=. Seeded LHC designs are reproducible, and chunked LHC generation (compute_dataset(rows=...),dev/cluster/) draws the same design in every chunk. LHC datasets generated before this fix cannot be redrawn from their seed (their storedthetais still valid).
0.0.3¶
Added¶
EmulatorBundle(.cemu): pickle-free save/load of emulators with checksums and a reference-prediction self-check (class-e info).- JAX VAE+GP emulator (
GaussianProcessVAEJAX), true ARD kernels for the JAX GP, and output standardization (standardize_Y) for the sklearn and JAX GP+PCA backends. ReparametrizedEmulator(learned input map, e.g. h -> 100*theta_s) andSegmentedEmulator+class-e stitch(emulators on separate ell ranges, blended).- Data generation: Sobol sampling, sampling constraints (
samples.constraints), CLASS failure handling with retries, transfer-function observable (Tk), explicitobservables:and storedtheory.classy.ell_maxin YAML, row chunks (compute_dataset(rows=...)), checkpoint/resume,merge_datasets, cluster scripts indev/cluster/. - Configs for massive-neutrino LCDM and w0waCDM (Planck range and ACT/SPT-grade).
Fixed¶
- Parameters sampled as
100*theta_s: class-e solves for h itself; CLASS v3.3's shooting silently returned a wrong h in much of the w0waCDM box. - Aliased parameters (
omega_cdm,A_sfromlogA) not reaching CLASS. P_k_maxsilently dropped with non-linear lensing.- Expressions stored in bundles are parsed, never
eval-ed.
Changed¶
class_e.__version__is read from the package metadata (pyproject.tomlis the single source);bump-my-versionreplaced byuv version.- PyPI workflow:
uv buildand trusted publishing.