gh-492: Adding running of the spectral index and curvature emulators#493
Conversation
|
Hi @ivansladoljev,
|
Ok, I will update and solve any new conflicts that have arisen. Regarding the playground, there is an initial PR for cosmopower in playground [https://github.com/cloe-org/playground/pull/140]. Maybe once that is merged, I can update it with new emulators (or we can do it all in one big PR, since there is not a lot of difference between everything). |
20e84ed to
4f49f71
Compare
|
Sure, we can update that one later, but also, we need to update anything related to CAMB and CLASS as you are adding an extra parameter there :) |
Yes. This PR addresses all the tests for CAMB/CLASS in cloelib, but for playground and cloelike there will be other PR's. For cloelike, there is already a PR for fixing nonlinear perturbations (just the cosmetic one) cloe-org/cloelike#121, and the one for alpha_s cloe-org/cloelike#123. For the playground there are fixes for nonlinear perturbations (cloe-org/playground#138). which are kind of URGENT, since we merged the fixes into cloelib. |
🚀 Pull Request Checklist
✅ Summary
Adds curvature and running spectral index emulators to the CosmoPowerJAX module, and adds alpha_s support to CAMBBackground.
🔄 Changes per file
camb_cosmology.pyCAMBBackground.__init__: addedalpha_s: float = 0.0(optional, after N_ur)CAMBBackground: addedself.alpha_s = alpha_sand passes it toInitPower.set_params(..., nrun=self.alpha_s)CAMBNonLinearPerturbations.__init__: addedlinearperturbationsparameter (typedOptional["CAMBLinearPerturbations"])class_cosmology.pyCLASSBackground.__init__: added**kwargsto accept (and ignore) CAMB-specific params likealpha_s'jax_cosmology.py`
JAXBackground.__init__: added**kwargsfor the same reasoncosmopower_jax_cosmology.pyAdded support for 2-degenerate-neutrino models (
N_mnu=2) for w0waCDM/wCDM/LCDMUpdated Zenodo URL to new record
Renamed emulator .npz filenames (e.g.
w0wa-linear-spectra.npz→w0wa-linear.npz)Added
CosmoPowerJAXCurvaturePerturbationsandCosmoPowerJAXRunningIndexPerturbationsclassesAdded
k_modes_curvature_pathdocs/code_structure/background.mdUpdated CosmoPowerJAX description (linear+nonlinear), added emulator class table, added
alpha_s=0.0to exampledocs/code_structure/summary_statistics.mdRemoved broken
#performance-tipslink from warning admonition; added## Performance Tipssection below ittests/test_baccoemu.pyAdded
alpha_s=0.0toCAMBBackgroundfixturetests/test_bnt.pyAdded
alpha_s=0.0to_cosmo_parsand to the required attributes settests/test_camb_cosmology.pyAdded
alpha_s=0.0to allCAMBBackgroundinstantiationsAdded
linearperturbations=None(orNonepositionally) to allCAMBNonLinearPerturbationscallsAdded new test
test_camb_background_running_spectral_indextests/test_camb_photo_z0_compatibility.pyAdded
alpha_s=0.0to CAMBBackground; added None to CAMBNonLinearPerturbations callt
ests/test_cmb.pyAdded
alpha_s=0.0toCAMBBackground; addedNonetoCAMBNonLinearPerturbationscallstests/test_cosmology_background.py`
Added
alpha_s=0.0to_cosmo_pars; removedalpha_sfromattributes_requiredset (since it was removed from the protocol)tests/test_cosmopower_jax_emulators.pyAdded
alpha_s=0.0toDummyBackgroundAdded
background_w0wa_2degenfixtureAdded imports for
CosmoPowerJAXCurvaturePerturbationsandCosmoPowerJAXRunningIndexPerturbations🛠 How to Test
pytest tests/test_cosmopower_jax_emulators.py -vpytest tests/test_camb_cosmology.py -v📝 Documentation
🏗 Related Issues
Resolves #492
✅ PR Checklist for Developers
pre-commit run --all-files✅ PR Checklist for Reviewers
playgroundwill be updated in a corresponding follow-up PRREADME.mdfile