-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Description
Hola:
I found a small bug in the I_0_22 method of the HMCalculator class.
The function claims that if no prof2 is passed, it will default to use prof. This is not correctly implemented and it will throw an exception:
import pyccl as ccl
import numpy as np
k = np.geomspace(1e-3, 10)
cosmo = ccl.Cosmology(Omega_c=0.25, Omega_b=0.05,
h=0.7, n_s=0.95, sigma8=0.8,
transfer_function='bbks')
cM = ccl.halos.ConcentrationDiemer15()
nM = ccl.halos.MassFuncSheth99(mass_def=ccl.halos.MassDef200c, mass_def_strict=False)
bM = ccl.halos.HaloBiasSheth99(mass_def=ccl.halos.MassDef200c, mass_def_strict=False)
pM = ccl.halos.HaloProfileNFW(mass_def=ccl.halos.MassDef200c, concentration=cM, fourier_analytic=True)
hmc = ccl.halos.HMCalculator(mass_function=nM, halo_bias=bM)
p2pt = ccl.halos.Profile2pt()
I0_3_CL = hmc.I_0_22(cosmo, k, 1, prof=pM, prof12_2pt=p2pt)
AttributeError: 'NoneType' object has no attribute 'mass_def'
If this is the expected behaviour, the documentation should be changed, else a quick fix
if prof2 is None:
prof2 = prof
Thanks
davidesciotti
Metadata
Metadata
Assignees
Labels
No labels