LSSTDESC / CCL

DESC Core Cosmology Library: cosmology routines with validated numerical accuracy
BSD 3-Clause "New" or "Revised" License
145 stars 68 forks source link

camb bbn module not always available #1186

Open itrharrison opened 4 months ago

itrharrison commented 4 months ago

I have managed to encounter a situation in which the line:

https://github.com/LSSTDESC/CCL/blob/dfa2b3b7be13afef0da11b5c4392e413af4e67eb/pyccl/boltzmann.py#L118

returns an error as the camb.bbn module is not directly available.

Confusingly (for me anyway), the bbn module is listed in the camb docs, but not in the camb __init__.py here.

I have also been able to directly access camb.bbn at other times 🤷 .

Either way I note that camb.model.bbn is always available, so an easy fix would be to replace the above line with

cp.bbn_predictor = camb.model.bbn.get_predictor()
itrharrison commented 4 months ago

...okay, this also happens with camb.constants (with camb.model.constants being available). I will try and work out what has gone strange with the camb import I am using (from cobaya packages).