emantis 1.2.0__tar.gz → 1.2.2__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 (46) hide show
  1. {emantis-1.2.0 → emantis-1.2.2}/PKG-INFO +6 -6
  2. {emantis-1.2.0 → emantis-1.2.2}/README.rst +3 -3
  3. {emantis-1.2.0 → emantis-1.2.2}/pyproject.toml +4 -3
  4. emantis-1.2.2/src/emantis/__init__.py +34 -0
  5. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/_cli.py +10 -12
  6. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/_gp_emulation.py +493 -275
  7. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/_read_data.py +11 -33
  8. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/_transformers.py +59 -33
  9. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/_types.py +1 -1
  10. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/_utils.py +16 -13
  11. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/_utils_inputs.py +25 -7
  12. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/exceptions.py +4 -1
  13. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/halo_mass_function.py +94 -50
  14. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/matter_power_spectrum.py +163 -82
  15. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/powerspectrum_matter.py +186 -101
  16. {emantis-1.2.0 → emantis-1.2.2}/tests/test_halo_mass_function.py +69 -5
  17. {emantis-1.2.0 → emantis-1.2.2}/tests/test_matter_power_spectrum.py +166 -64
  18. emantis-1.2.0/src/emantis/__init__.py +0 -6
  19. {emantis-1.2.0 → emantis-1.2.2}/COPYING +0 -0
  20. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/cosmo_params_fR_emu_v1.txt +0 -0
  21. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/cosmo_params_fR_emu_v1_config.toml +0 -0
  22. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/cosmo_params_fR_emu_v2.txt +0 -0
  23. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/cosmo_params_fR_emu_v2_config.toml +0 -0
  24. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/cosmo_params_wCDM_emu_v2.txt +0 -0
  25. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/cosmo_params_wCDM_emu_v2_config.toml +0 -0
  26. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/fofr_matter_power_boost/cosmo_params.txt +0 -0
  27. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/fofr_matter_power_boost/kbins.h5 +0 -0
  28. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/fofr_matter_power_boost/power_boosts_train.h5 +0 -0
  29. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/halo_mass_function/halo_mass_function_fR_emu_v2_data.h5 +0 -0
  30. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/halo_mass_function/halo_mass_function_fR_emu_v2_emulation_config.toml +0 -0
  31. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/halo_mass_function/halo_mass_function_wCDM_emu_v2_data.h5 +0 -0
  32. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/halo_mass_function/halo_mass_function_wCDM_emu_v2_emulation_config.toml +0 -0
  33. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/matter_power_spectrum_nl_boost/matter_power_spectrum_nl_boost_wCDM_emu_v2_data.h5 +0 -0
  34. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/matter_power_spectrum_nl_boost/matter_power_spectrum_nl_boost_wCDM_emu_v2_emulation_config.toml +0 -0
  35. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/matter_power_spectrum_nl_mg_boost/matter_power_spectrum_nl_mg_boost_fR_emu_v1_data.h5 +0 -0
  36. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/matter_power_spectrum_nl_mg_boost/matter_power_spectrum_nl_mg_boost_fR_emu_v1_emulation_config.toml +0 -0
  37. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/matter_power_spectrum_nl_mg_boost/matter_power_spectrum_nl_mg_boost_fR_emu_v2_data.h5 +0 -0
  38. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/matter_power_spectrum_nl_mg_boost/matter_power_spectrum_nl_mg_boost_fR_emu_v2_emulation_config.toml +0 -0
  39. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/sigma8/cosmo_params_LCDM.txt +0 -0
  40. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/sigma8/cosmo_params_LCDM_config.toml +0 -0
  41. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/sigma8/cosmo_params_wCDM.txt +0 -0
  42. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/sigma8/cosmo_params_wCDM_config.toml +0 -0
  43. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/sigma8/sigma8_LCDM_data.txt +0 -0
  44. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/sigma8/sigma8_LCDM_emulation_config.toml +0 -0
  45. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/sigma8/sigma8_wCDM_data.txt +0 -0
  46. {emantis-1.2.0 → emantis-1.2.2}/src/emantis/data/sigma8/sigma8_wCDM_emulation_config.toml +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: emantis
3
- Version: 1.2.0
4
- Summary: A cosmological emulator for non-linear large-scale structure formation studies in alternative dark energy and gravity theories.
3
+ Version: 1.2.2
4
+ Summary: A cosmological emulator for nonlinear large-scale structure formation studies in alternative dark energy and gravity theories.
5
5
  Keywords: cosmology,emulator,large-scale structure,dark energy,modified gravity
6
6
  Author-Email: =?utf-8?q?I=C3=B1igo_S=C3=A1ez_Casares?= <inigo.saez-casares@obspm.fr>
7
7
  License: GPL-3.0-or-later
@@ -12,7 +12,7 @@ Classifier: Intended Audience :: Science/Research
12
12
  Classifier: Topic :: Scientific/Engineering :: Physics
13
13
  Project-URL: repository, https://gitlab.obspm.fr/e-mantis/e-mantis.git
14
14
  Project-URL: documentation, https://e-mantis.pages.obspm.fr/e-mantis/index.html
15
- Requires-Python: <4.0,>=3.10
15
+ Requires-Python: <3.15,>=3.10
16
16
  Requires-Dist: h5py<4.0,>=3.8
17
17
  Requires-Dist: scikit-learn<2,>=1
18
18
  Requires-Dist: numpy<3.0,>=1.24
@@ -44,13 +44,13 @@ e-MANTIS: Emulator for Multiple observable ANalysis in extended cosmological The
44
44
  Description
45
45
  -----------
46
46
 
47
- e-MANTIS is a python package containing emulators providing theoretical predictions for the non-linear large-scale structure formation in the context of alternative dark energy and gravity theories.
47
+ e-MANTIS is a python package containing emulators providing theoretical predictions for the nonlinear large-scale structure formation in the context of alternative dark energy and gravity theories.
48
48
  It uses Gaussian processes to perform a fast and accurate interpolation between the outputs of high resolution cosmological :math:`N`-body simulations.
49
49
  The emulator supports multiple cosmological models and observables.
50
50
  It is divided in multiple modules, each one focusing on a particular type of observable.
51
51
  Currently, e-MANTIS provides emulators for the following quantities:
52
52
 
53
- * Matter power spectrum boost in f(R) gravity, described in: `The e-MANTIS emulator: fast predictions of the non-linear matter power spectrum in f(R)CDM cosmology <https://arxiv.org/abs/2303.08899>`_.
53
+ * Matter power spectrum boost in f(R) gravity, described in: `The e-MANTIS emulator: fast predictions of the nonlinear matter power spectrum in f(R)CDM cosmology <https://arxiv.org/abs/2303.08899>`_.
54
54
 
55
55
  * Halo mass function in f(R)CDM and wCDM cosmologies, described in: `The e-MANTIS emulator: fast and accurate predictions of the halo mass function in f(R)CDM and wCDM cosmologies <https://arxiv.org/pdf/2410.05226>`_.
56
56
 
@@ -94,7 +94,7 @@ You can also retrain them manually using the CLI utility.
94
94
  Documentation and usage
95
95
  -----------------------
96
96
 
97
- The up-to-date documentation for this project (with code examples and a detailed API) is available `here <https://e-mantis.pages.obspm.fr/e-mantis/index.html>`_.
97
+ The up-to-date documentation for this project (with code examples and a detailed API) is available `here <https://e-mantis.pages.obspm.fr/e-mantis>`_.
98
98
 
99
99
  Licence
100
100
  -------
@@ -21,13 +21,13 @@ e-MANTIS: Emulator for Multiple observable ANalysis in extended cosmological The
21
21
  Description
22
22
  -----------
23
23
 
24
- e-MANTIS is a python package containing emulators providing theoretical predictions for the non-linear large-scale structure formation in the context of alternative dark energy and gravity theories.
24
+ e-MANTIS is a python package containing emulators providing theoretical predictions for the nonlinear large-scale structure formation in the context of alternative dark energy and gravity theories.
25
25
  It uses Gaussian processes to perform a fast and accurate interpolation between the outputs of high resolution cosmological :math:`N`-body simulations.
26
26
  The emulator supports multiple cosmological models and observables.
27
27
  It is divided in multiple modules, each one focusing on a particular type of observable.
28
28
  Currently, e-MANTIS provides emulators for the following quantities:
29
29
 
30
- * Matter power spectrum boost in f(R) gravity, described in: `The e-MANTIS emulator: fast predictions of the non-linear matter power spectrum in f(R)CDM cosmology <https://arxiv.org/abs/2303.08899>`_.
30
+ * Matter power spectrum boost in f(R) gravity, described in: `The e-MANTIS emulator: fast predictions of the nonlinear matter power spectrum in f(R)CDM cosmology <https://arxiv.org/abs/2303.08899>`_.
31
31
 
32
32
  * Halo mass function in f(R)CDM and wCDM cosmologies, described in: `The e-MANTIS emulator: fast and accurate predictions of the halo mass function in f(R)CDM and wCDM cosmologies <https://arxiv.org/pdf/2410.05226>`_.
33
33
 
@@ -71,7 +71,7 @@ You can also retrain them manually using the CLI utility.
71
71
  Documentation and usage
72
72
  -----------------------
73
73
 
74
- The up-to-date documentation for this project (with code examples and a detailed API) is available `here <https://e-mantis.pages.obspm.fr/e-mantis/index.html>`_.
74
+ The up-to-date documentation for this project (with code examples and a detailed API) is available `here <https://e-mantis.pages.obspm.fr/e-mantis>`_.
75
75
 
76
76
  Licence
77
77
  -------
@@ -2,7 +2,7 @@
2
2
  authors = [
3
3
  { name = "Iñigo Sáez Casares", email = "inigo.saez-casares@obspm.fr" },
4
4
  ]
5
- requires-python = "<4.0,>=3.10"
5
+ requires-python = "<3.15,>=3.10"
6
6
  dependencies = [
7
7
  "h5py <4.0,>=3.8",
8
8
  "scikit-learn <2,>=1",
@@ -12,8 +12,8 @@ dependencies = [
12
12
  "joblib <2.0.0,>=1.3.2",
13
13
  ]
14
14
  name = "emantis"
15
- version = "1.2.0"
16
- description = "A cosmological emulator for non-linear large-scale structure formation studies in alternative dark energy and gravity theories."
15
+ version = "1.2.2"
16
+ description = "A cosmological emulator for nonlinear large-scale structure formation studies in alternative dark energy and gravity theories."
17
17
  readme = "README.rst"
18
18
  classifiers = [
19
19
  "Programming Language :: Python :: 3",
@@ -72,6 +72,7 @@ dev = [
72
72
  "pytest>=8.4.1",
73
73
  "pytest-cov>=6",
74
74
  "pytest-pydocstyle>=2.4.0",
75
+ "pre-commit>=4.5.0",
75
76
  ]
76
77
  docs = [
77
78
  "sphinx",
@@ -0,0 +1,34 @@
1
+ """
2
+ e-MANTIS
3
+ ========
4
+
5
+ e-MANTIS is a python package containing emulators providing theoretical predictions
6
+ for the nonlinear large-scale structure formation in the context of alternative
7
+ dark energy and gravity theories.
8
+ It uses Gaussian processes to perform a fast and accurate interpolation
9
+ between the outputs of high resolution cosmological N-body simulations.
10
+ The emulator supports multiple cosmological models and observables.
11
+ It is divided in multiple modules, each one focusing on a particular type of observable.
12
+
13
+ Available modules
14
+ -----------------
15
+
16
+ matter_power_spectrum
17
+ Emulators for the matter power spectrum.
18
+ halo_mass_function
19
+ Emulator for the halo mass function.
20
+ powerspectrum_matter
21
+ Emulators for the matter power spectrum.
22
+ Deprecated, use matter_power_spectrum instead.
23
+
24
+ """ # noqa: D400, D205
25
+
26
+ import logging
27
+
28
+ from . import halo_mass_function, matter_power_spectrum
29
+ from .powerspectrum_matter import FofrBoost
30
+
31
+ # Capture warnings by the logging system.
32
+ logging.captureWarnings(True)
33
+
34
+ __all__ = ["FofrBoost", "matter_power_spectrum", "halo_mass_function"]
@@ -22,20 +22,19 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
22
22
 
23
23
  import joblib
24
24
 
25
- from emantis.matter_power_spectrum import (
26
- Sigma8Emulator,
27
- NonLinearBoostEmulator,
28
- NonLinearMGBoostEmulator,
29
- _SIGMA8_MODELS,
30
- _NL_BOOST_MODELS,
31
- _NL_MG_BOOST_MODELS,
32
- )
33
-
34
25
  from emantis.halo_mass_function import (
35
- HMFEmulator,
36
- _HMF_MODELS,
37
26
  _FOF_B_VALUES,
27
+ _HMF_MODELS,
38
28
  _SO_DELTAC_VALUES,
29
+ HMFEmulator,
30
+ )
31
+ from emantis.matter_power_spectrum import (
32
+ _NL_BOOST_MODELS,
33
+ _NL_MG_BOOST_MODELS,
34
+ _SIGMA8_MODELS,
35
+ NonLinearBoostEmulator,
36
+ NonLinearMGBoostEmulator,
37
+ Sigma8Emulator,
39
38
  )
40
39
 
41
40
  n_jobs_max = 6
@@ -47,7 +46,6 @@ n_jobs = min(joblib.cpu_count(), n_jobs_max)
47
46
  # - type of emulators to train
48
47
  # Use typer package, see: https://packaging.python.org/en/latest/guides/creating-command-line-tools/
49
48
  def train_all_emulators():
50
-
51
49
  print(f"Will train all emulators using {n_jobs} processes.\n")
52
50
 
53
51
  print("----- Train matter_power_spectrum emulators -----\n")