From b0cd1a03930682645f3547a2db1e6611b3258549 Mon Sep 17 00:00:00 2001 From: jchavesmontero Date: Tue, 2 Jul 2024 17:35:54 +0200 Subject: [PATCH] set default nrun to zero for Nyx in camb_cosmo --- lace/cosmo/camb_cosmo.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lace/cosmo/camb_cosmo.py b/lace/cosmo/camb_cosmo.py index 92c8c306..b5ee937d 100644 --- a/lace/cosmo/camb_cosmo.py +++ b/lace/cosmo/camb_cosmo.py @@ -26,8 +26,6 @@ def get_cosmology( pivot_scalar=0.05, w=-1, ): - - """Given set of cosmological parameters, return CAMB cosmology object.""" pars = camb.CAMBparams() @@ -419,7 +417,10 @@ def get_Nyx_cosmology(params): # collect primorial power parameters As = params["A_s"] ns = params["n_s"] - nrun = params["nrun"] + if "nrun" in params.keys(): + nrun = params["nrun"] + else: + nrun = 0 # update primordial power pars.InitPower.set_params(As=As, ns=ns, nrun=nrun)