classy-szfast 0.0.25.post13__tar.gz → 0.0.25.post15__tar.gz
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-0.0.25.post13 → classy_szfast-0.0.25.post15}/PKG-INFO +2 -2
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast/classy_szfast.py +42 -4
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast/cosmopower_jax.py +1 -4
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast.egg-info/PKG-INFO +2 -2
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/pyproject.toml +1 -1
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/README.md +0 -0
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast/__init__.py +0 -0
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast/classy_sz.py +0 -0
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast/config.py +0 -0
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast/cosmopower.py +0 -0
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast/cosmosis_classy_szfast_interface.py +0 -0
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast/custom_bias/__init__.py +0 -0
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast/custom_bias/custom_bias.py +0 -0
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast/custom_profiles/__init__.py +0 -0
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast/custom_profiles/custom_profiles.py +0 -0
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast/emulators_meta_data.py +0 -0
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast/pks_and_sigmas.py +0 -0
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast/restore_nn.py +0 -0
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast/suppress_warnings.py +0 -0
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast/utils.py +0 -0
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast.egg-info/SOURCES.txt +0 -0
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast.egg-info/dependency_links.txt +0 -0
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast.egg-info/requires.txt +0 -0
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast.egg-info/top_level.txt +0 -0
- {classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/setup.cfg +0 -0
@@ -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
|
@@ -173,9 +174,16 @@ class Class_szfast(object):
|
|
173
174
|
self.cp_pkl_fftlog_alphas_imag_nn = cp_pkl_fftlog_alphas_imag_nn
|
174
175
|
|
175
176
|
self.cosmo_model = 'ede-v2'
|
177
|
+
|
176
178
|
self.use_Amod = 0
|
177
179
|
self.Amod = 0
|
178
|
-
|
180
|
+
|
181
|
+
self.use_pk_z_bins = 0
|
182
|
+
self.pk_z_bins_z1 = 0
|
183
|
+
self.pk_z_bins_z2 = 0
|
184
|
+
self.pk_z_bins_A0 = 0
|
185
|
+
self.pk_z_bins_A1 = 0
|
186
|
+
self.pk_z_bins_A2 = 0
|
179
187
|
|
180
188
|
|
181
189
|
if cosmo_model_dict[params_settings['cosmo_model']] == 'ede-v2':
|
@@ -223,6 +231,15 @@ class Class_szfast(object):
|
|
223
231
|
self.use_Amod = v
|
224
232
|
self.Amod = params_settings['Amod']
|
225
233
|
|
234
|
+
if k == 'use_pk_z_bins':
|
235
|
+
self.use_pk_z_bins = v
|
236
|
+
self.pk_z_bins_z1 = params_settings['pk_z_bins_z1']
|
237
|
+
self.pk_z_bins_z2 = params_settings['pk_z_bins_z2']
|
238
|
+
self.pk_z_bins_A0 = params_settings['pk_z_bins_A0']
|
239
|
+
self.pk_z_bins_A1 = params_settings['pk_z_bins_A1']
|
240
|
+
self.pk_z_bins_A2 = params_settings['pk_z_bins_A2']
|
241
|
+
|
242
|
+
|
226
243
|
|
227
244
|
|
228
245
|
if cosmo_model_dict[params_settings['cosmo_model']] == 'ede-v2':
|
@@ -304,6 +321,11 @@ class Class_szfast(object):
|
|
304
321
|
rz = dA*(1.+z)*params_values['h']
|
305
322
|
dVdzdOmega = 2.99792458e8/1.0e5*rz*rz/Ez
|
306
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
|
307
329
|
|
308
330
|
def get_r_delta_of_m_delta_at_z(self,delta,m_delta,z,params_values_dict=None):
|
309
331
|
if params_values_dict:
|
@@ -535,6 +557,19 @@ class Class_szfast(object):
|
|
535
557
|
pk_ae = pkl_p + self.Amod*(pknl_p-pkl_p)
|
536
558
|
predicted_pk_spectrum_z.append(pk_ae)
|
537
559
|
|
560
|
+
elif self.use_pk_z_bins:
|
561
|
+
# print('>>> using pk_z_bins')
|
562
|
+
for zp in z_arr:
|
563
|
+
params_dict_pp = params_dict.copy()
|
564
|
+
params_dict_pp['z_pk_save_nonclass'] = [zp]
|
565
|
+
pkl_p = self.cp_pkl_nn[self.cosmo_model].predictions_np(params_dict_pp)[0]
|
566
|
+
if zp < self.pk_z_bins_z1:
|
567
|
+
pklp = self.pk_z_bins_A0*pkl_p
|
568
|
+
elif zp < self.pk_z_bins_z2:
|
569
|
+
pklp = self.pk_z_bins_A1*pkl_p
|
570
|
+
else:
|
571
|
+
pklp = self.pk_z_bins_A2*pkl_p
|
572
|
+
predicted_pk_spectrum_z.append(pklp)
|
538
573
|
else:
|
539
574
|
|
540
575
|
for zp in z_arr:
|
@@ -663,7 +698,10 @@ class Class_szfast(object):
|
|
663
698
|
if isinstance(params_dict['m_ncdm'][0],str):
|
664
699
|
params_dict['m_ncdm'] = [float(params_dict['m_ncdm'][0].split(',')[0])]
|
665
700
|
|
666
|
-
|
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]
|
667
705
|
self.sigma8 = self.cp_predicted_der[1]
|
668
706
|
self.Neff = self.cp_predicted_der[4]
|
669
707
|
return 0
|
@@ -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':
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast/custom_bias/__init__.py
RENAMED
File without changes
|
{classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast/custom_bias/custom_bias.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast/emulators_meta_data.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast/suppress_warnings.py
RENAMED
File without changes
|
File without changes
|
{classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
{classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast.egg-info/requires.txt
RENAMED
File without changes
|
{classy_szfast-0.0.25.post13 → classy_szfast-0.0.25.post15}/classy_szfast.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|