Skip to content

Presets + Cross-Covariance module + ISO rework notebooks#254

Open
ggalloni wants to merge 33 commits into
masterfrom
feat/iso-presets-crosscov
Open

Presets + Cross-Covariance module + ISO rework notebooks#254
ggalloni wants to merge 33 commits into
masterfrom
feat/iso-presets-crosscov

Conversation

@ggalloni

Copy link
Copy Markdown
Collaborator

Summary

Adds a presets layer for ready-to-run SOLikeT configurations, a cross-covariance module to build joint covariances between probes, and an end-to-end ISO simulation pipeline (datasets → cross-covariance → joint analysis), plus reworked tutorials. Builds on the labelled-CrossCov store on master: cross-covariance blocks are aligned to the data by bandpower identity, so they stay correct regardless of build order.

soliket.presets — ready-to-run configurations

  • quickstart(preset) → a Session wrapping a Cobaya model at the fiducial point; build_info(preset) for the raw info dict.
  • resolve_aliases(model) exposes components by role (.mflike, .lensing, .foreground, .cosmo), matched by class — no fragile model.components[i] indexing.
  • Parameters split into per-group files (cosmo / foreground / systematics) plus theory.yaml, loaded via load_params / load_fiducial_map / build_params. A defaults_dir override lets a folder replace any group file (per-file fallback to the package defaults).
  • Templates for mflike, lensing, multigaussian. Clear errors when a group file is missing or not a mapping; foreground-drift tripwire and a cobaya mutate-safety guard.

soliket.cross_covariance — joint covariances

  • Kernels: cmb_lensing_block, lensing_induced_block, shear_kappa_block, n1_crosscov_block; CAMB lensed-Cl derivatives (camb_lensing_derivatives); builders cmb_lensing_crosscov, lensing_induced_cov, shear_kappa_crosscov.
  • CrossCov.from_cmb_lensing(mflike, lensing) computes the CMB×lensing block and labels each row/column with its bandpower identity (CMB rows in mflike's (pol, hasYX_xsp, (t1,t2), leff) vocabulary, kappa columns from the lensing ids). Alignment then happens by identity via CrossCov.to_canonical at assembly — build order is no longer load-bearing.

GaussianLikelihood / data

  • bandpower_ids adapter so external likelihoods (mflike) carry per-bandpower identities; _get_gauss_data populates ids/indices.
  • Unbinned-theory accessor and memoised bandpower binning.

sacc_tools — smooth datasets

  • Builders for smooth (noise-free) MFLike and lensing twins (smooth_mflike_sacc, smooth-twin SACC), top-hat windows, Gaussian covariance.

CCL tracers

  • Fix NLA intrinsic-alignment bias normalization; guard non-buildable tracers.

Notebooks

  • ISO_sims pipeline (one shared ISO fiducial, SO normal-hierarchy neutrinos via a theory.yaml override): create_datasetscreate_cross_covarianceanalyse_datasets. Generated sims/ products are git-ignored (reproducible).
  • analyse_datasets also writes a committable examples/ISO_sims.yaml — a cobaya-run twin of the Python run with <REPO>/<PACKAGES> placeholders for the machine-specific roots.
  • Tutorials: quickstart.ipynb (presets on-ramp) and first_step_tutorial.ipynb (hand-built deep-dive) reworked to use resolve_aliases, source fiducials from the preset (load_fiducial_map), and run the sampler from Python (YAML kept as a serialization demo, cobaya-run noted for clusters).

ggalloni added 29 commits June 12, 2026 16:25
@ggalloni

Copy link
Copy Markdown
Collaborator Author

@itrharrison @HTJense @raphkou @MatForconi Hi guys, let me know what you think of this. In principle, this should be the first step towards the reorganization we discussed at the whiteboard. In particular, have a look at the new notebooks, the preset containing defaults, and new tools for different levels of interaction with the repo.

@raphkou

raphkou commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Thanks @ggalloni for this amazing work! I tested all the notebooks in ISO_sims and they work perfectly! I just had a few questions/comments:

  • In create_datasets.ipynb, why not using the same yaml files to create the galaxy x kappa data? I guess we could use the same cosmology yaml file to ensure that we use the same cosmological parameters?
  • In ISO_sims/defaults, I guess we will also add the other yaml files regarding foreground, accuracy, mcmc parameters, etc.? I can help with that if needed.
  • I also imagine that there is some more cleaning to do in other subfolders of the examples folder or in notebooks/dev, as several files may not be useful anymore.

Many thanks again for this huge piece of work, it's looking very great! I can also handle the grid runs notebook/scripts when this branch becomes more stable or is merged.

@ggalloni

Copy link
Copy Markdown
Collaborator Author

Hi @raphkou, thanks for the feedback! I should have fixed your first point by converting the cosmo-point into the equivalent settings for CCL.

About the second, yes, absolutely! In this first example, I wanted to show that if only a part of the default files is provided in a folder like that, the rest of the options will be inherited from the package-level defaults in the presets folder.

As for the last comment, yes, for now, I kept them there as a backup. I wanted to wait for your approval before removing the old ones, as maybe there is something I missed, etc.

@itrharrison itrharrison self-requested a review June 16, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants