Skip to content

Commit

Permalink
classy: update (fixes #305)
Browse files Browse the repository at this point in the history
  • Loading branch information
JesusTorrado committed Oct 12, 2023
1 parent 127f66c commit 3cc21da
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 17 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ before_install:
python -m pip install --upgrade pip setuptools wheel;
pip install mpi4py pytest-forked pytest-cov flaky matplotlib dill coverage flake8;
fi
- pip install "Cython<3"
- python --version

script:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 3.4.X – YYYY-MM-DD

### Cosmology

#### CLASS

- Min version update to 3.2.1 (solves #305; thanks to the CLASS developers)

## 3.4 – 2023-10-11

### General
Expand Down
5 changes: 1 addition & 4 deletions cobaya/cosmo_input/input_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,7 @@
'ref': {'dist': 'norm', 'loc': 1.0416,
'scale': 0.0004},
'proposal': 0.0002,
'latex': '100\\theta_\\mathrm{s}',
'drop': True}, '100*theta_s': {
'value': 'lambda theta_s_100: theta_s_100',
'derived': False},
'latex': '100\\theta_\\mathrm{s}'},
'H0': {'latex': 'H_0'}}}}},
'sound_horizon_lensonly': {
'desc': 'Angular size of the sound horizon (h>0.4; approximate, if using CAMB)',
Expand Down
14 changes: 6 additions & 8 deletions cobaya/theories/classy/classy.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,11 @@
.. code:: bash
$ python -m pip install 'cython<3'
$ python -m pip install 'cython'
In particular the version restriction is due to `this issue
<https://github.com/lesgourg/class_public/issues/531>`_.
In particular, if working with a modified CLASS version based on a version previous
to v3.2.1, you need to change above ``'cython'`` by ``'cython<3'`` (see `this issue
<https://github.com/lesgourg/class_public/issues/531>`_).
To download and install CLASS manually in a folder called ``CLASS`` under
``/path/to/cosmo``, simply do:
Expand Down Expand Up @@ -251,7 +252,7 @@ class classy(BoltzmannBase):

# Name of the Class repo/folder and version to download
_classy_repo_name = "lesgourg/class_public"
_min_classy_version = "v3.2.0"
_min_classy_version = "v3.2.1"
_classy_min_gcc_version = "6.4" # Lower ones are possible atm, but leak memory!
_classy_repo_version = os.environ.get('CLASSY_REPO_VERSION', _min_classy_version)

Expand Down Expand Up @@ -638,9 +639,6 @@ def _get_derived_all(self, derived_requested=True):
requested_and_extra["Omega_nu"] = self.classy.Omega_nu
if "T_cmb" in requested_and_extra:
requested_and_extra["T_cmb"] = self.classy.T_cmb()
if "theta_s_100" in requested_and_extra:
requested_and_extra["theta_s_100"] = \
self.classy.get_current_derived_parameters(["100*theta_s"])["100*theta_s"]
# Get the rest using the general derived param getter
# No need for error control: classy.get_current_derived_parameters is passed
# every derived parameter not excluded before, and cause an error, indicating
Expand Down Expand Up @@ -770,7 +768,7 @@ def install(cls, path=None, code=True, no_progress_bars=False, **_kwargs):
log.info("Installing pre-requisites...")
# TODO: remove version restriction below when this issue is fixed:
# https://github.com/lesgourg/class_public/issues/531
exit_status = pip_install("cython<3")
exit_status = pip_install("cython")
if exit_status:
log.error("Could not install pre-requisite: cython")
return False
Expand Down
4 changes: 0 additions & 4 deletions docs/src_examples/cosmo_basic/basic_classy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ params:
scale: 0.0004
proposal: 0.0002
latex: 100\theta_\mathrm{s}
drop: true
100*theta_s:
value: 'lambda theta_s_100: theta_s_100'
derived: false
H0:
latex: H_0
omega_b:
Expand Down

0 comments on commit 3cc21da

Please sign in to comment.