classy-szfast 0.0.25.post14__py3-none-any.whl → 0.0.25.post16__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- classy_szfast/classy_sz.py +15 -0
- classy_szfast/classy_szfast.py +12 -3
- classy_szfast/cosmopower_jax.py +1 -4
- {classy_szfast-0.0.25.post14.dist-info → classy_szfast-0.0.25.post16.dist-info}/METADATA +1 -1
- {classy_szfast-0.0.25.post14.dist-info → classy_szfast-0.0.25.post16.dist-info}/RECORD +7 -7
- {classy_szfast-0.0.25.post14.dist-info → classy_szfast-0.0.25.post16.dist-info}/WHEEL +0 -0
- {classy_szfast-0.0.25.post14.dist-info → classy_szfast-0.0.25.post16.dist-info}/top_level.txt +0 -0
classy_szfast/classy_sz.py
CHANGED
@@ -254,6 +254,16 @@ class classy_sz(classy):
|
|
254
254
|
method="cl_galn_IA", # name of the method in classy.pyx
|
255
255
|
args_names=[],
|
256
256
|
args=[])
|
257
|
+
|
258
|
+
if "cl_lens_lens" in requirements:
|
259
|
+
# make sure cobaya still runs as it does for standard classy
|
260
|
+
requirements.pop("cl_lens_lens")
|
261
|
+
# specify the method to collect the new observable
|
262
|
+
self.collectors["cl_lens_lens"] = Collector(
|
263
|
+
method="cl_kk", # name of the method in classy.pyx
|
264
|
+
args_names=[],
|
265
|
+
args=[])
|
266
|
+
|
257
267
|
super().must_provide(**requirements)
|
258
268
|
|
259
269
|
|
@@ -390,6 +400,11 @@ class classy_sz(classy):
|
|
390
400
|
cls = deepcopy(self._current_state["cl_cib_kappa"])
|
391
401
|
return cls
|
392
402
|
|
403
|
+
def get_cl_lens_lens(self):
|
404
|
+
cls = {}
|
405
|
+
cls = deepcopy(self._current_state["cl_lens_lens"])
|
406
|
+
return cls
|
407
|
+
|
393
408
|
# IMPORTANT: this method is imported from cobaya and modified to accomodate the emulators
|
394
409
|
def calculate(self, state, want_derived=True, **params_values_dict):
|
395
410
|
|
classy_szfast/classy_szfast.py
CHANGED
@@ -88,7 +88,7 @@ class Class_szfast(object):
|
|
88
88
|
self.cp_ee_nn = cp_ee_nn
|
89
89
|
self.cp_pp_nn = cp_pp_nn
|
90
90
|
self.cp_pknl_nn = cp_pknl_nn
|
91
|
-
|
91
|
+
|
92
92
|
|
93
93
|
self.cp_lmax = cp_l_max_scalars
|
94
94
|
|
@@ -120,6 +120,7 @@ class Class_szfast(object):
|
|
120
120
|
self.cp_h_nn = cp_h_nn_jax
|
121
121
|
self.cp_da_nn = cp_da_nn_jax
|
122
122
|
self.cp_pkl_nn = cp_pkl_nn_jax
|
123
|
+
self.cp_der_nn = cp_der_nn_jax
|
123
124
|
|
124
125
|
self.pi = jnp.pi
|
125
126
|
self.transpose = jnp.transpose
|
@@ -140,7 +141,7 @@ class Class_szfast(object):
|
|
140
141
|
self.cp_h_nn = cp_h_nn
|
141
142
|
self.cp_da_nn = cp_da_nn
|
142
143
|
self.cp_pkl_nn = cp_pkl_nn
|
143
|
-
|
144
|
+
self.cp_der_nn = cp_der_nn
|
144
145
|
self.pi = np.pi
|
145
146
|
self.transpose = np.transpose
|
146
147
|
self.pow = np.power
|
@@ -320,6 +321,11 @@ class Class_szfast(object):
|
|
320
321
|
rz = dA*(1.+z)*params_values['h']
|
321
322
|
dVdzdOmega = 2.99792458e8/1.0e5*rz*rz/Ez
|
322
323
|
return dVdzdOmega
|
324
|
+
|
325
|
+
def get_sigma8_and_der(self,params_values_dict=None):
|
326
|
+
params_values = self.get_all_relevant_params(params_values_dict)
|
327
|
+
self.calculate_sigma8_and_der(**params_values)
|
328
|
+
return self.cp_predicted_der
|
323
329
|
|
324
330
|
def get_r_delta_of_m_delta_at_z(self,delta,m_delta,z,params_values_dict=None):
|
325
331
|
if params_values_dict:
|
@@ -692,7 +698,10 @@ class Class_szfast(object):
|
|
692
698
|
if isinstance(params_dict['m_ncdm'][0],str):
|
693
699
|
params_dict['m_ncdm'] = [float(params_dict['m_ncdm'][0].split(',')[0])]
|
694
700
|
|
695
|
-
|
701
|
+
if self.jax_mode:
|
702
|
+
self.cp_predicted_der = self.cp_der_nn[self.cosmo_model].predict(params_dict)
|
703
|
+
else:
|
704
|
+
self.cp_predicted_der = self.cp_der_nn[self.cosmo_model].ten_to_predictions_np(params_dict)[0]
|
696
705
|
self.sigma8 = self.cp_predicted_der[1]
|
697
706
|
self.Neff = self.cp_predicted_der[4]
|
698
707
|
return 0
|
classy_szfast/cosmopower_jax.py
CHANGED
@@ -135,10 +135,7 @@ for mp in cosmo_model_list:
|
|
135
135
|
cp_pkl_nn_jax[mp] = CosmoPowerJAX_custom(probe='custom_log',filepath=path_to_emulators +'PK/' + emulator_dict[mp]['PKL'] + '.npz')
|
136
136
|
cp_pkl_nn_jax[mp].ten_to_predictions = False
|
137
137
|
|
138
|
-
cp_der_nn_jax[mp] =
|
139
|
-
|
140
|
-
# cp_da_nn_jax[mp] = Restore_NN(restore_filename=path_to_emulators + 'growth-and-distances/' + emulator_dict[mp]['DAZ'])
|
141
|
-
|
138
|
+
cp_der_nn_jax[mp] = CosmoPowerJAX_custom(probe='custom_log',filepath=path_to_emulators + 'derived-parameters/' + emulator_dict[mp]['DER'] + '.npz')
|
142
139
|
|
143
140
|
cp_da_nn_jax[mp] = CosmoPowerJAX_custom(probe='custom_log',filepath=path_to_emulators + 'growth-and-distances/' + emulator_dict[mp]['DAZ'] + '.npz')
|
144
141
|
if mp != 'ede-v2':
|
@@ -1,9 +1,9 @@
|
|
1
1
|
classy_szfast/__init__.py,sha256=E2thrL0Z9oXFfdzwcsu-xbOytudLFTlRlPqVFGlPPPg,279
|
2
|
-
classy_szfast/classy_sz.py,sha256=
|
3
|
-
classy_szfast/classy_szfast.py,sha256=
|
2
|
+
classy_szfast/classy_sz.py,sha256=uUQtksZ5GZJTi01bowLaM1EUEXaQad8cMiNK_iXnFpI,22839
|
3
|
+
classy_szfast/classy_szfast.py,sha256=PFb4Mqy3ACTRwEDAgN3m_-2batQhIZ1z2prT8zSGu5U,44556
|
4
4
|
classy_szfast/config.py,sha256=v6DGcBHmfn5JtuO48dKyXCh-Dmn0uwOF_izvVOJFnqw,279
|
5
5
|
classy_szfast/cosmopower.py,sha256=ooYK2BDOZSo3XtGHfPtjXHxr5UW-yVngLPkb5gpvTx8,2351
|
6
|
-
classy_szfast/cosmopower_jax.py,sha256=
|
6
|
+
classy_szfast/cosmopower_jax.py,sha256=Xn8-fUvlE_GoJ-AQVB_wCJ1k9D0pzQMgdlzSE3OZbwI,6440
|
7
7
|
classy_szfast/cosmosis_classy_szfast_interface.py,sha256=zAnxvFtn73a5yS7jgs59zpWFEYKCIQyraYPs5hQ4Le8,11483
|
8
8
|
classy_szfast/emulators_meta_data.py,sha256=mXG5LQuJw9QBNE_kxXW8Kx0AUCWpbV6uRO9BaBbIfHo,10732
|
9
9
|
classy_szfast/pks_and_sigmas.py,sha256=drtuujE1HhlrYY1hY92DyY5lXlYS1uE15MSuVI4uo6k,6625
|
@@ -14,7 +14,7 @@ classy_szfast/custom_bias/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
|
|
14
14
|
classy_szfast/custom_bias/custom_bias.py,sha256=aR2t5RTIwv7P0m2bsEU0Eq6BTkj4pG10AebH6QpG4qM,486
|
15
15
|
classy_szfast/custom_profiles/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
16
|
classy_szfast/custom_profiles/custom_profiles.py,sha256=4LZwb2XoqwCyWNmW2s24Z7AJdmgVdaRG7yYaBYe-d9Q,1188
|
17
|
-
classy_szfast-0.0.25.
|
18
|
-
classy_szfast-0.0.25.
|
19
|
-
classy_szfast-0.0.25.
|
20
|
-
classy_szfast-0.0.25.
|
17
|
+
classy_szfast-0.0.25.post16.dist-info/METADATA,sha256=HK53ITw__TpeiD5IBctJ1PwOUM8HPiCNbVWQvZs40D0,572
|
18
|
+
classy_szfast-0.0.25.post16.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
19
|
+
classy_szfast-0.0.25.post16.dist-info/top_level.txt,sha256=hRgqpilUck4lx2KkaWI2y9aCDKqF6pFfGHfNaoPFxv0,14
|
20
|
+
classy_szfast-0.0.25.post16.dist-info/RECORD,,
|
File without changes
|
{classy_szfast-0.0.25.post14.dist-info → classy_szfast-0.0.25.post16.dist-info}/top_level.txt
RENAMED
File without changes
|