Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background Calculations #1148

Closed
wants to merge 127 commits into from
Closed
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
0c68867
first commit
nikfilippas Mar 16, 2023
790bc13
Merge branch 'master' into CCLObject_eq
nikfilippas Mar 19, 2023
437f5df
remove warning in the first spin of CCL
nikfilippas Mar 19, 2023
12961f4
kernels chk ok, transfers almost done
nikfilippas Mar 20, 2023
52df271
more tests
nikfilippas Mar 20, 2023
87c8639
halo profiles in their own directory
nikfilippas Mar 20, 2023
1bfab13
finished tracer eq tests
nikfilippas Mar 21, 2023
c510aca
ported changes in halos/profiles
nikfilippas Mar 21, 2023
9474b15
Merge branch 'master' into v3_wip
damonge Mar 21, 2023
b8bb8e9
concentrations in their own directory
nikfilippas Mar 21, 2023
c40cf0c
mass functions & halo biases in their own directory
nikfilippas Mar 21, 2023
4da043f
moved CIB stuff to profiles & 2pts
nikfilippas Mar 21, 2023
ee5e535
split halo model into 1/2/4-pt
nikfilippas Mar 21, 2023
8c20b40
fix imports
nikfilippas Mar 21, 2023
fa9e215
Merge branch 'v3_wip' of https://github.com/LSSTDESC/CCL into v3_wip
nikfilippas Mar 21, 2023
8f29fa2
remove empty module
nikfilippas Mar 21, 2023
5b84d70
Merge branch 'v3_wip' into halos_v3
nikfilippas Mar 21, 2023
8df3d79
fix typo
nikfilippas Mar 21, 2023
ad286d8
Merge branch 'v3_wip' into halos_v3
nikfilippas Mar 21, 2023
2bb015c
changes from star in halos/ (no tests)
nikfilippas Mar 21, 2023
388629a
Baryons in v3 (#1039)
damonge Mar 22, 2023
af2dcb0
Merge branch 'v3_wip' into halos_v3
nikfilippas Mar 22, 2023
13c1206
refactor concentration, mass_function, halo_bias; improvements in HMC…
nikfilippas Mar 23, 2023
5d67de8
HaloProfile subclasses & HaloProfile.normprof attribute
nikfilippas Mar 23, 2023
d8b0d85
simplify imports
nikfilippas Mar 23, 2023
ef815c4
Tracers v3 (#1040)
damonge Mar 24, 2023
3267901
done
damonge Mar 24, 2023
4162fed
Merge branch 'master' into v3_wip
nikfilippas Mar 24, 2023
909695d
Background, boltzmann, and cls in v3 (#1041)
damonge Mar 24, 2023
2e22ce3
Merge branch 'v3_wip' into nu_param_power_v3
damonge Mar 24, 2023
7772dd6
Covariances in v3 (#1046)
damonge Mar 24, 2023
f1c1546
Correlations v3 (#1042)
damonge Mar 24, 2023
16968a0
first commit
nikfilippas Mar 24, 2023
67c537c
rename TNCDM to T_ncdm but preserve API
nikfilippas Mar 24, 2023
606d6fb
T_CMB directly into cosmo struct
nikfilippas Mar 25, 2023
2eb6cc8
Omega_g in ccl_parameters_create; no split between C/Python
nikfilippas Mar 25, 2023
4704831
physical_constants.T_CMB doesn't mutate anymore!
nikfilippas Mar 25, 2023
73a1b24
force mutate T_CMB in benchmarks
nikfilippas Mar 25, 2023
3ca9f53
define defaults on instantiation just in case constants mutate
nikfilippas Mar 25, 2023
3cf0d3c
A_s & sigma8: don't play with numbers
nikfilippas Mar 25, 2023
d1b5fd9
simplify
nikfilippas Mar 25, 2023
7587021
remove leftover mallocs
nikfilippas Mar 25, 2023
5aa7dfb
temporarily preserve API for CCLv3
nikfilippas Mar 25, 2023
9f4dde5
remove HaloProfile.name
nikfilippas Mar 25, 2023
6408590
cleaned up pk_Npt
nikfilippas Mar 25, 2023
5896fa4
add extrap_pk argument
nikfilippas Mar 25, 2023
99dc8eb
FFTLogParams class instead of dictionary in HaloProfile
nikfilippas Mar 26, 2023
fe3a6a3
simplified code
nikfilippas Mar 26, 2023
b46fb44
coverage for _repr.py
nikfilippas Mar 26, 2023
4e2214c
more coverage
nikfilippas Mar 26, 2023
22e348b
more coverage
nikfilippas Mar 26, 2023
675c142
super comprehensive tests & full coverage
nikfilippas Mar 26, 2023
1ad69a5
add a final extra test
nikfilippas Mar 26, 2023
1205e95
removed mass_def from HMIngredients; comprehensive code review 1
nikfilippas Mar 29, 2023
1b7f385
re-implementation, bugfixes, tests
nikfilippas Mar 30, 2023
fdefd88
c_m_relation >> concentration; code improvements; A_SPLINE_MAX in Python
nikfilippas Mar 30, 2023
6a45e72
HMIngredients initializers - no repeated code
nikfilippas Mar 30, 2023
f59089d
rogue file
nikfilippas Mar 30, 2023
551c173
Merge branch 'v3_wip' into halos_v3
nikfilippas Mar 30, 2023
55817de
patch for new changes
nikfilippas Mar 30, 2023
043bfaa
updated Build Status badge website
nikfilippas Mar 30, 2023
f96aab2
fix websites
nikfilippas Mar 30, 2023
4d27c79
added a DOI badge & links
nikfilippas Mar 30, 2023
a1b41ac
added nonbreaking space
nikfilippas Mar 30, 2023
a668101
removed extra space
nikfilippas Mar 30, 2023
c6a30c5
FancyRepr out of CCLObject to simplify
nikfilippas Mar 30, 2023
41b92dd
split base.py and restructured into its own dir to simplify
nikfilippas Mar 30, 2023
b71a210
Merge branch 'v3_wip' into halos_v3
nikfilippas Mar 30, 2023
b96caae
update tests to match changes
nikfilippas Mar 30, 2023
e4aed50
coverage
nikfilippas Mar 30, 2023
0d4623b
simple test for tkkssc
nikfilippas Mar 31, 2023
a58bdbc
more tests for tkkssc
nikfilippas Mar 31, 2023
167658e
addressed comments 1
nikfilippas Apr 1, 2023
055793b
addressed comments 1
nikfilippas Apr 1, 2023
edc09cb
Merge branch 'master' into nu_Tncdm_v3
nikfilippas Apr 1, 2023
cfeadd8
addressed comments 2: mass_def defaults are name strings etc.
nikfilippas Apr 1, 2023
88dfeb0
deprecate Gaussian & PowerLaw profiles
nikfilippas Apr 1, 2023
4c50da9
bugfix in master: sometimes mass_def_strict=False fails unexpectedly
nikfilippas Apr 1, 2023
091b8d3
typo
nikfilippas Apr 1, 2023
b995fe5
first commit
nikfilippas Apr 4, 2023
574755b
OmNuh2 fix
damonge Apr 4, 2023
3a7c5f9
addressed comments
nikfilippas Apr 4, 2023
51f249a
keep only massive
damonge Apr 4, 2023
1e1f9af
first step
damonge Apr 4, 2023
594c4a1
temp commit
nikfilippas Apr 4, 2023
047db91
debug neutrinos & deprecate Omnuh2
nikfilippas Apr 4, 2023
7fb728b
addressed comments
nikfilippas Apr 4, 2023
c26902e
New feature: Arbitrary function for profile normalization
nikfilippas Apr 5, 2023
de223da
gain efficiency
nikfilippas Apr 5, 2023
58ceb58
comments + deprecate k_min from HMCalculator
nikfilippas Apr 5, 2023
5e3e2f8
ccl_omega_x & ccl_Omeganuh2 consistency
nikfilippas Apr 5, 2023
c48fb75
renamed initialize_from_input --> create_instance
nikfilippas Apr 5, 2023
8d56fa5
brought in CCLNamedClass from docs_v3
nikfilippas Apr 5, 2023
ff884ed
brought in from docs_v3: directly callable HMIngredients
nikfilippas Apr 5, 2023
2e0ed76
prep for Davids input
nikfilippas Apr 5, 2023
43591ce
renamed HMCalculator --> HaloModel
nikfilippas Apr 5, 2023
598c253
fix typo
nikfilippas Apr 5, 2023
23d5adf
Merge branch 'halos_v3' into codata_v3
nikfilippas Apr 6, 2023
4eb9a18
brought in from docs_v3: initialize mass_def from any string (e.g. 400c)
nikfilippas Apr 6, 2023
2fd7cd2
first commit
nikfilippas Apr 6, 2023
c449caf
first commit
nikfilippas Apr 6, 2023
db75d30
Merge branch 'halos_v3' of https://github.com/LSSTDESC/CCL into halos_v3
nikfilippas Apr 6, 2023
590cc0e
Revert "renamed HMCalculator --> HaloModel"
nikfilippas Apr 6, 2023
208f8c1
counterterms func inside of 4pt func
nikfilippas Apr 6, 2023
096cfbd
replace deprecated abstractproperty
nikfilippas Apr 6, 2023
4da0f8f
abstract linked methods for HaloProfile, MassFunc, HaloBias, Concentr…
nikfilippas Apr 6, 2023
1f923a7
fully working implementation
nikfilippas Apr 7, 2023
8e77d88
renamed lM --> log10M etc.
nikfilippas Apr 7, 2023
b471c24
minor cosmetic fix
nikfilippas Apr 7, 2023
693bb67
Neutrinos, parameters, power in v3 (#1047)
damonge Apr 7, 2023
af0ee48
Merge branch 'v3_wip' into CCLObject_eq
nikfilippas Apr 7, 2023
c2a016d
fix tests
nikfilippas Apr 7, 2023
9482791
Merge branch 'halos_v3' into CCLObject_eq
nikfilippas Apr 7, 2023
1314f42
fully merged
nikfilippas Apr 7, 2023
a0b3397
(1) Allow mutation for CCLv2.final; (2) Completely remove cached_prop…
nikfilippas Apr 7, 2023
adddaeb
Merge branch 'v3_wip' into halos_v3
nikfilippas Apr 7, 2023
5dab496
Merge branch 'halos_v3' into eq_v3
nikfilippas Apr 7, 2023
cc2bea6
use the new constants; improvementes; passing tests
nikfilippas Apr 8, 2023
bdcc155
Merge branch 'halos_v3' into codata_v3
nikfilippas Apr 8, 2023
4581151
Merge branch 'eq_v3' into codata_v3
nikfilippas Apr 8, 2023
e8c9fe2
rename function & replace some calls
nikfilippas Apr 8, 2023
640ae7f
remove all this C code!
nikfilippas Apr 8, 2023
8131708
first commit
nikfilippas Apr 13, 2023
8de2ca6
flaked
nikfilippas Apr 13, 2023
f2e64a7
fix typo
nikfilippas Apr 13, 2023
d6e7eba
coverage
nikfilippas Apr 16, 2023
c8b63f1
scale factor
nikfilippas Apr 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[flake8]
ignore = E741,E226,W503,W504
exclude =
per-file-ignores =
*/__init__.py:F401,F403,F405
exclude =
build/,
.eggs/,
benchmarks/data,
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ option(FORCE_OPENMP "Forcibly use OpenMP " NO)
set(CCL_SRC
src/ccl_background.c src/ccl_core.c src/ccl_error.c
src/ccl_bbks.c src/ccl_f1d.c src/ccl_f2d.c src/ccl_f3d.c
src/ccl_power.c src/ccl_bcm.c
src/ccl_power.c
src/ccl_eh.c src/ccl_musigma.c
src/ccl_utils.c src/ccl_cls.c src/ccl_massfunc.c
src/ccl_neutrinos.c
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -11,7 +11,10 @@ STYLE CONVENTION USED
**`type`** or **`structure`**
-->
# CCL
[![Build Status](https://travis-ci.org/LSSTDESC/CCL.svg?branch=master)](https://travis-ci.org/LSSTDESC/CCL) [![Coverage Status](https://coveralls.io/repos/github/LSSTDESC/CCL/badge.svg?branch=master)](https://coveralls.io/github/LSSTDESC/CCL?branch=master) [![Documentation Status](https://readthedocs.org/projects/ccl/badge/?version=latest)](https://ccl.readthedocs.io/en/latest/?badge=latest)
![Build](https://github.com/LSSTDESC/CCL/workflows/continuous-integration/badge.svg?branch=master) 
[![Coverage](https://coveralls.io/repos/github/LSSTDESC/CCL/badge.svg?branch=master)](https://coveralls.io/github/LSSTDESC/CCL?branch=master) 
[![Documentation](https://readthedocs.org/projects/ccl/badge/?version=latest)](https://ccl.readthedocs.io/en/latest/) 
[![DOI](https://img.shields.io/badge/DOI-10.3847%2F1538--4365%2Fab1658-B31B1B.svg)](https://iopscience.iop.org/article/10.3847/1538-4365/ab1658)

The Core Cosmology Library (CCL) is a standardized library of routines to calculate
basic observables used in cosmology. It will be the standard analysis package used by the
@@ -72,7 +75,7 @@ cosmo = ccl.Cosmology(
transfer_function='bbks')

# Define a simple binned galaxy number density curve as a function of redshift
z_n = np.linspace(0., 1., 200)
z_n = np.linspace(0., 1., 500)
n = np.ones(z_n.shape)

# Create objects to represent tracers of the weak lensing signal with this
18 changes: 9 additions & 9 deletions benchmarks/ccl_test_angpow.c
Original file line number Diff line number Diff line change
@@ -4,11 +4,11 @@
#include <math.h>

#define NZ 1024
#define Z0_GC 1.0
#define Z0_GC 1.0
#define SZ_GC 0.02
#define NL 499

#define CLS_PRECISION 3E-3
#define CLS_PRECISION 3E-3

CTEST_DATA(angpow) {
double Omega_c;
@@ -30,7 +30,7 @@ CTEST_DATA(angpow) {



// Set up the cosmological parameters to be used
// Set up the cosmological parameters to be used
CTEST_SETUP(angpow){
data->Omega_c = 0.25;
data->Omega_b = 0.05;
@@ -55,7 +55,7 @@ static void test_angpow_precision(struct angpow_data * data)
{
// Status flag
int status =0;

// Initialize cosmological parameters
ccl_configuration ccl_config=default_config;
ccl_config.transfer_function_method=ccl_boltzmann_class;
@@ -78,7 +78,7 @@ static void test_angpow_precision(struct angpow_data * data)
nz_arr_gc[i]=exp(-0.5*pow((z_arr_gc[i]-Z0_GC)/SZ_GC,2));
bz_arr[i]=1;
}

// Galaxy clustering tracer
CCL_ClTracer *ct_gc_A=ccl_cl_tracer_number_counts(ccl_cosmo,1,1,0,
NZ,z_arr_gc,nz_arr_gc,
@@ -88,7 +88,7 @@ static void test_angpow_precision(struct angpow_data * data)
NZ,z_arr_gc,nz_arr_gc,
NZ,z_arr_gc,bz_arr,
-1,NULL,NULL, &status);

int *ells=malloc(NL*sizeof(int));
double *cells_gg_angpow=malloc(NL*sizeof(double));
for(int ii=0;ii<NL;ii++)
@@ -98,7 +98,7 @@ static void test_angpow_precision(struct angpow_data * data)
// Workspaces
double linstep = 40;
double logstep = 1.15;

// Compute C_ell
ccl_angular_cls_nonlimber(ccl_cosmo,logstep,linstep,
ct_gc_A,ct_gc_A,NULL,
@@ -117,13 +117,13 @@ static void test_angpow_precision(struct angpow_data * data)
fclose(f);
rel_precision /= NL;
ASSERT_TRUE(rel_precision < CLS_PRECISION);

//Free up tracers
ccl_cl_tracer_free(ct_gc_A);
ccl_cl_tracer_free(ct_gc_B);
free(ells);
free(cells_gg_angpow);
ccl_cosmology_free(ccl_cosmo);
ccl_cosmology_free(ccl_cosmo);
}

CTEST2(angpow,precision) {
2 changes: 1 addition & 1 deletion benchmarks/ccl_test_f2d.c
Original file line number Diff line number Diff line change
@@ -289,7 +289,7 @@ CTEST2(f2d,pk) {
config.matter_power_spectrum_method = ccl_linear;
ccl_parameters params = ccl_parameters_create(data->Omega_c,data->Omega_b, 0.0, 3.046, &mnu,
0, -1.0, 0.0, data->h, data->A_s,data->n_s,
-1, -1, -1, 0., 0., 1.0, 1.0, 0.0,
-1, -1, -1, 0., 0., 1.0, 1.0, 0.0,
-1, NULL, NULL, &status);
params.T_CMB=2.7;
params.Omega_k=0;
26 changes: 6 additions & 20 deletions benchmarks/test_bcm.py
Original file line number Diff line number Diff line change
@@ -6,22 +6,6 @@

def test_bcm():
cosmo = ccl.Cosmology(
Omega_c=0.25,
Omega_b=0.05,
h=0.7,
A_s=2.2e-9,
n_s=0.96,
Neff=3.046,
m_nu_type='normal',
m_nu=0.0,
Omega_g=0,
Omega_k=0,
w0=-1,
wa=0,
bcm_log10Mc=14.0,
baryons_power_spectrum='bcm')

cosmo_nobar = ccl.Cosmology(
Omega_c=0.25,
Omega_b=0.05,
h=0.7,
@@ -41,12 +25,14 @@ def test_bcm():
k = data[:, 0] * cosmo['h']
a = 1

fbcm = ccl.bcm_model_fka(cosmo, k, a)
bar = ccl.BaryonsSchneider15(log10Mc=14.)
fbcm = bar.boost_factor(cosmo, k, a)
err = np.abs(data[:, 1]/data_nobar[:, 1]/fbcm - 1)
assert np.allclose(err, 0, atol=BCM_TOLERANCE, rtol=0)

ratio = (
ccl.nonlin_matter_power(cosmo, k, a) /
ccl.nonlin_matter_power(cosmo_nobar, k, a))
cosmo.compute_nonlin_power()
pk_nobar = cosmo.get_nonlin_power()
pk_wbar = bar.include_baryonic_effects(cosmo, pk_nobar)
ratio = pk_wbar.eval(k, a)/pk_nobar.eval(k, a)
err = np.abs(data[:, 1]/data_nobar[:, 1]/ratio - 1)
assert np.allclose(err, 0, atol=BCM_TOLERANCE, rtol=0)
30 changes: 15 additions & 15 deletions benchmarks/test_cls.py → benchmarks/test_cells.py
Original file line number Diff line number Diff line change
@@ -68,21 +68,21 @@ def set_up(request):

# Initialize tracers
trc = {}
trc['g1'] = ccl.NumberCountsTracer(cosmo, False,
(z1, pz1),
(z2, bz))
trc['g2'] = ccl.NumberCountsTracer(cosmo, False,
(z2, pz2),
(z2, bz))
trc['l1'] = ccl.WeakLensingTracer(cosmo, (z1, pz1))
trc['l2'] = ccl.WeakLensingTracer(cosmo, (z2, pz2))
trc['i1'] = ccl.WeakLensingTracer(cosmo, (z1, pz1),
trc['g1'] = ccl.NumberCountsTracer(cosmo, has_rsd=False,
dndz=(z1, pz1),
bias=(z2, bz))
trc['g2'] = ccl.NumberCountsTracer(cosmo, has_rsd=False,
dndz=(z2, pz2),
bias=(z2, bz))
trc['l1'] = ccl.WeakLensingTracer(cosmo, dndz=(z1, pz1))
trc['l2'] = ccl.WeakLensingTracer(cosmo, dndz=(z2, pz2))
trc['i1'] = ccl.WeakLensingTracer(cosmo, dndz=(z1, pz1),
has_shear=False,
ia_bias=(z1, a1))
trc['i2'] = ccl.WeakLensingTracer(cosmo, (z2, pz2),
trc['i2'] = ccl.WeakLensingTracer(cosmo, dndz=(z2, pz2),
has_shear=False,
ia_bias=(z2, a2))
trc['ct'] = ccl.CMBLensingTracer(cosmo, 1100.)
trc['ct'] = ccl.CMBLensingTracer(cosmo, z_source=1100.)

# Read benchmarks
def read_bm(fname):
@@ -193,8 +193,8 @@ def read_bm(fname):
('i2', 'i2', 'ii_22', # IA2-IA2
'll_22', 'll_22', 'll_22', 'll_22',
'fl_ll')])
def test_cls(set_up, t1, t2, bm,
a1b1, a1b2, a2b1, a2b2, fl):
def test_cells(set_up, t1, t2, bm,
a1b1, a1b2, a2b1, a2b2, fl):
cosmo, trcs, lfc, bmk = set_up
cl = ccl.angular_cl(cosmo, trcs[t1], trcs[t2], lfc['ells'],
limber_integration_method='qag_quad') * lfc[fl]
@@ -213,8 +213,8 @@ def test_cls(set_up, t1, t2, bm,
('l2', 'l2', 'll_22', # WL2-WL2
'll_22', 'll_22', 'll_22', 'll_22',
'fl_ll')])
def test_cls_spline(set_up, t1, t2, bm,
a1b1, a1b2, a2b1, a2b2, fl):
def test_cells_spline(set_up, t1, t2, bm,
a1b1, a1b2, a2b1, a2b2, fl):
cosmo, trcs, lfc, bmk = set_up
cl = ccl.angular_cl(cosmo, trcs[t1], trcs[t2], lfc['ells'],
limber_integration_method='spline') * lfc[fl]
2 changes: 1 addition & 1 deletion benchmarks/test_cib.py
Original file line number Diff line number Diff line change
@@ -45,4 +45,4 @@ def test_cibcl():
dl = cl*ls*(ls+1)/(2*np.pi)

# Compare
assert np.all(np.fabs(dl/(bm[31]+bm[32])-1) < 1E-2)
assert np.all(np.fabs(dl/(bm[31]+bm[32])-1) < 1.2E-2)
2 changes: 1 addition & 1 deletion benchmarks/test_concentration_Ishiyama21.py
Original file line number Diff line number Diff line change
@@ -58,5 +58,5 @@ def test_concentration_Ishiyama21(pars):

for i, zz in enumerate(Z):
dat = data[:, i+1]
mod = cm.get_concentration(COSMO, M_use/H100, 1/(1+zz))
mod = cm(COSMO, M_use/H100, 1/(1+zz))
assert np.allclose(mod, dat, rtol=UCHUU_DATA_SCATTER)
22 changes: 11 additions & 11 deletions benchmarks/test_correlation.py
Original file line number Diff line number Diff line change
@@ -71,21 +71,21 @@ def set_up(request):

# Initialize tracers
trc = {}
trc['g1'] = ccl.NumberCountsTracer(cosmo, False,
(z1, pz1),
(z2, bz))
trc['g2'] = ccl.NumberCountsTracer(cosmo, False,
(z2, pz2),
(z2, bz))
trc['l1'] = ccl.WeakLensingTracer(cosmo, (z1, pz1))
trc['l2'] = ccl.WeakLensingTracer(cosmo, (z2, pz2))
trc['i1'] = ccl.WeakLensingTracer(cosmo, (z1, pz1),
trc['g1'] = ccl.NumberCountsTracer(cosmo, has_rsd=False,
dndz=(z1, pz1),
bias=(z2, bz))
trc['g2'] = ccl.NumberCountsTracer(cosmo, has_rsd=False,
dndz=(z2, pz2),
bias=(z2, bz))
trc['l1'] = ccl.WeakLensingTracer(cosmo, dndz=(z1, pz1))
trc['l2'] = ccl.WeakLensingTracer(cosmo, dndz=(z2, pz2))
trc['i1'] = ccl.WeakLensingTracer(cosmo, dndz=(z1, pz1),
has_shear=False,
ia_bias=(z1, a1))
trc['i2'] = ccl.WeakLensingTracer(cosmo, (z2, pz2),
trc['i2'] = ccl.WeakLensingTracer(cosmo, dndz=(z2, pz2),
has_shear=False,
ia_bias=(z2, a2))
trc['ct'] = ccl.CMBLensingTracer(cosmo, 1100.)
trc['ct'] = ccl.CMBLensingTracer(cosmo, z_source=1100.)

# Read benchmarks
def read_bm(fname):
10 changes: 6 additions & 4 deletions benchmarks/test_correlation_MG.py
Original file line number Diff line number Diff line change
@@ -48,10 +48,12 @@ def set_up(request):

# Initialize tracers
trc = {}
trc['g1'] = ccl.NumberCountsTracer(cosmo, False, (z1, pz1), (z1, bz1))
trc['g2'] = ccl.NumberCountsTracer(cosmo, False, (z2, pz2), (z2, bz2))
trc['l1'] = ccl.WeakLensingTracer(cosmo, (z1, pz1))
trc['l2'] = ccl.WeakLensingTracer(cosmo, (z2, pz2))
trc['g1'] = ccl.NumberCountsTracer(cosmo, has_rsd=False,
dndz=(z1, pz1), bias=(z1, bz1))
trc['g2'] = ccl.NumberCountsTracer(cosmo, has_rsd=False,
dndz=(z2, pz2), bias=(z2, bz2))
trc['l1'] = ccl.WeakLensingTracer(cosmo, dndz=(z1, pz1))
trc['l2'] = ccl.WeakLensingTracer(cosmo, dndz=(z2, pz2))

# Read benchmarks
bms = {}
10 changes: 6 additions & 4 deletions benchmarks/test_correlation_MG2.py
Original file line number Diff line number Diff line change
@@ -48,10 +48,12 @@ def set_up(request):

# Initialize tracers
trc = {}
trc['g1'] = ccl.NumberCountsTracer(cosmo, False, (z1, pz1), (z1, bz1))
trc['g2'] = ccl.NumberCountsTracer(cosmo, False, (z2, pz2), (z2, bz2))
trc['l1'] = ccl.WeakLensingTracer(cosmo, (z1, pz1))
trc['l2'] = ccl.WeakLensingTracer(cosmo, (z2, pz2))
trc['g1'] = ccl.NumberCountsTracer(cosmo, has_rsd=False,
dndz=(z1, pz1), bias=(z1, bz1))
trc['g2'] = ccl.NumberCountsTracer(cosmo, has_rsd=False,
dndz=(z2, pz2), bias=(z2, bz2))
trc['l1'] = ccl.WeakLensingTracer(cosmo, dndz=(z1, pz1))
trc['l2'] = ccl.WeakLensingTracer(cosmo, dndz=(z2, pz2))

# Read benchmarks
bms = {}
10 changes: 6 additions & 4 deletions benchmarks/test_correlation_MG3_SD.py
Original file line number Diff line number Diff line change
@@ -50,10 +50,12 @@ def set_up(request):

# Initialize tracers
trc = {}
trc['g1'] = ccl.NumberCountsTracer(cosmo, False, (z1, pz1), (z1, bz1))
trc['g2'] = ccl.NumberCountsTracer(cosmo, False, (z2, pz2), (z2, bz2))
trc['l1'] = ccl.WeakLensingTracer(cosmo, (z1, pz1))
trc['l2'] = ccl.WeakLensingTracer(cosmo, (z2, pz2))
trc['g1'] = ccl.NumberCountsTracer(cosmo, has_rsd=False,
dndz=(z1, pz1), bias=(z1, bz1))
trc['g2'] = ccl.NumberCountsTracer(cosmo, has_rsd=False,
dndz=(z2, pz2), bias=(z2, bz2))
trc['l1'] = ccl.WeakLensingTracer(cosmo, dndz=(z1, pz1))
trc['l2'] = ccl.WeakLensingTracer(cosmo, dndz=(z2, pz2))

# Read benchmarks
bms = {}
10 changes: 5 additions & 5 deletions benchmarks/test_covariances.py
Original file line number Diff line number Diff line change
@@ -42,17 +42,17 @@ def test_ssc_WL():

z, nofz = np.loadtxt(os.path.join(data_dir, "ssc_WL_nofz.txt"),
unpack=True)
WL_tracer = ccl.WeakLensingTracer(cosmo, (z, nofz))
WL_tracer = ccl.WeakLensingTracer(cosmo, dndz=(z, nofz))

ell = np.loadtxt(os.path.join(data_dir, "ssc_WL_ell.txt"))

fsky = 0.05

sigma2_B = ccl.sigma2_B_disc(cosmo, a=a, fsky=fsky)
sigma2_B = ccl.sigma2_B_disc(cosmo, a_arr=a, fsky=fsky)
cov_ssc = ccl.covariances.angular_cl_cov_SSC(cosmo,
cltracer1=WL_tracer,
cltracer2=WL_tracer,
ell=ell, tkka=tk3D,
tracer1=WL_tracer,
tracer2=WL_tracer,
ell=ell, t_of_kk_a=tk3D,
sigma2_B=(a, sigma2_B),
fsky=None)
var_ssc_ccl = np.diag(cov_ssc)
2 changes: 1 addition & 1 deletion benchmarks/test_distances.py
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@
def Neff_from_N_ur_N_ncdm(N_ur, N_ncdm):
"""Calculate N_eff from the number of relativistic
and massive neutrinos."""
Neff = N_ur + N_ncdm * ccl.physical_constants.TNCDM**4 / (4./11.)**(4./3.)
Neff = N_ur + N_ncdm * ccl.core._Defaults.T_ncdm**4 / (4./11.)**(4./3.)
return Neff


8 changes: 4 additions & 4 deletions benchmarks/test_emu.py
Original file line number Diff line number Diff line change
@@ -14,8 +14,8 @@ def test_emu_nu(model):

cosmos = np.loadtxt("./benchmarks/data/emu_nu_cosmologies.txt")

mnu = ccl.nu_masses(
cosmos[model, 7] * cosmos[model, 2]**2, 'equal', T_CMB=2.725)
mnu = ccl.nu_masses(Omega_nu_h2=cosmos[model, 7]*cosmos[model, 2]**2,
mass_split='equal')

cosmo = ccl.Cosmology(
Omega_c=cosmos[model, 0],
@@ -79,8 +79,8 @@ def test_emu(model):
def test_emu_lin(model):
cosmos = np.loadtxt("./benchmarks/data/emu_input_cosmologies.txt")

mnu = ccl.nu_masses(
cosmos[model, 7] * cosmos[model, 2]**2, 'equal', T_CMB=2.725)
mnu = ccl.nu_masses(Omega_nu_h2=cosmos[model, 7]*cosmos[model, 2]**2,
mass_split='equal')

cosmo = ccl.Cosmology(
Omega_c=cosmos[model, 0],
5 changes: 2 additions & 3 deletions benchmarks/test_haloprofile.py
Original file line number Diff line number Diff line change
@@ -58,8 +58,7 @@ def test_profile_Einasto():

mdef = ccl.halos.MassDef(mDelta, 'matter')
c = ccl.halos.ConcentrationConstant(c=concentration, mdef=mdef)
mdef = ccl.halos.MassDef(mDelta, 'matter',
c_m_relation=c)
mdef = ccl.halos.MassDef(mDelta, 'matter', concentration=c)
p = ccl.halos.HaloProfileEinasto(c, truncated=False)

prof = p.real(COSMO, r, halomass, a, mdef)
@@ -118,7 +117,7 @@ def test_haloprofile(model):
projected_analytic=True)
prof = p.projected(COSMO, r, halomass, a, mdef)
elif model == 'einasto':
mdef = ccl.halos.MassDef(halomassdef, 'matter', c_m_relation=c)
mdef = ccl.halos.MassDef(halomassdef, 'matter', concentration=c)
p = ccl.halos.HaloProfileEinasto(c, truncated=False)
prof = p.real(COSMO, r, halomass, a, mdef)
elif model == 'hernquist':
Loading