classy-szfast 0.0.25.post14__tar.gz → 0.0.25.post16__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.
Files changed (25) hide show
  1. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/PKG-INFO +1 -1
  2. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/classy_szfast/classy_sz.py +15 -0
  3. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/classy_szfast/classy_szfast.py +12 -3
  4. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/classy_szfast/cosmopower_jax.py +1 -4
  5. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/classy_szfast.egg-info/PKG-INFO +1 -1
  6. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/pyproject.toml +1 -1
  7. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/README.md +0 -0
  8. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/classy_szfast/__init__.py +0 -0
  9. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/classy_szfast/config.py +0 -0
  10. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/classy_szfast/cosmopower.py +0 -0
  11. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/classy_szfast/cosmosis_classy_szfast_interface.py +0 -0
  12. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/classy_szfast/custom_bias/__init__.py +0 -0
  13. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/classy_szfast/custom_bias/custom_bias.py +0 -0
  14. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/classy_szfast/custom_profiles/__init__.py +0 -0
  15. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/classy_szfast/custom_profiles/custom_profiles.py +0 -0
  16. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/classy_szfast/emulators_meta_data.py +0 -0
  17. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/classy_szfast/pks_and_sigmas.py +0 -0
  18. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/classy_szfast/restore_nn.py +0 -0
  19. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/classy_szfast/suppress_warnings.py +0 -0
  20. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/classy_szfast/utils.py +0 -0
  21. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/classy_szfast.egg-info/SOURCES.txt +0 -0
  22. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/classy_szfast.egg-info/dependency_links.txt +0 -0
  23. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/classy_szfast.egg-info/requires.txt +0 -0
  24. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/classy_szfast.egg-info/top_level.txt +0 -0
  25. {classy_szfast-0.0.25.post14 → classy_szfast-0.0.25.post16}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: classy_szfast
3
- Version: 0.0.25.post14
3
+ Version: 0.0.25.post16
4
4
  Summary: The accelerator of the class_sz code from https://github.com/CLASS-SZ
5
5
  Maintainer-email: Boris Bolliet <bb667@cam.ac.uk>
6
6
  License: MIT
@@ -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
 
@@ -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
- self.cp_der_nn = cp_der_nn
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
- self.cp_predicted_der = self.cp_der_nn[self.cosmo_model].ten_to_predictions_np(params_dict)[0]
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
@@ -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] = Restore_NN(restore_filename=path_to_emulators + 'derived-parameters/' + emulator_dict[mp]['DER'])
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,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: classy_szfast
3
- Version: 0.0.25.post14
3
+ Version: 0.0.25.post16
4
4
  Summary: The accelerator of the class_sz code from https://github.com/CLASS-SZ
5
5
  Maintainer-email: Boris Bolliet <bb667@cam.ac.uk>
6
6
  License: MIT
@@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
- version = "0.0.25.post14"
6
+ version = "0.0.25.post16"
7
7
  license = { text = "MIT" }
8
8
  name = "classy_szfast"
9
9
  maintainers = [{name = "Boris Bolliet",email="bb667@cam.ac.uk"}]