Skip to content

Commit

Permalink
win test (#178)
Browse files Browse the repository at this point in the history
* win test

* workaround

* workaround

* workaround

* workaround

* move deps from conda env to requirements

* add gsl and openmpi to conda env

* move back swig, cmake, fftw to env

* add back mpi4py

* try again with openmpi

* return deps configuration to original

* Add version import (#180)

* add version import

* import on runtime and add test of import

* add write_to

* Fix package name

* Flake fixes

* setuptools_scm defaults?

* remove unnecssary extra arg

---------

Co-authored-by: Giacomo Galloni <[email protected]>

* Add some examples for the f2f (#179)

* added mflike example

* update install instructions

* docs formatting

* win test working

* formatting

* formatting

* formatting

* formatting

---------

Co-authored-by: Ian Harrison <[email protected]>
Co-authored-by: Giacomo Galloni <[email protected]>
  • Loading branch information
3 people authored Jul 31, 2024
1 parent ed7682d commit a53b922
Show file tree
Hide file tree
Showing 13 changed files with 128 additions and 101 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ jobs:
python-version: '3.11'
toxenv: py311-test-latest

- name: Windows latest
os: windows-latest
python-version: '3.11'
toxenv: py311-test-latest
env:
PYTHONIOENCODING: utf-8
PYTHONUTF8: 1

steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ requires-python = ">=3.8, <3.12"
license = {text = "MIT"}
dependencies = [
"requests",
'importlib-metadata; python_version<"3.8"',
"numpy",
"scipy>=1.6",
"pandas", # to remove
Expand Down Expand Up @@ -104,3 +103,8 @@ exclude_lines = [
# Don't complain about IPython completion helper
"def _ipython_key_completions_",
]

[tool.pytest.ini_options]
markers = [
"require_ccl",
]
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ fuzzywuzzy
astropy
getdist
cobaya
pyccl
pyccl >= 3.0; platform_system!='Windows'
sacc
fgspectra>=1.1.0
syslibrary
pyhalomodel
pyhalomodel
2 changes: 1 addition & 1 deletion soliket-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ dependencies:
- mpi4py
- camb
- pip:
- -r requirements.txt
- -r requirements.txt
19 changes: 13 additions & 6 deletions soliket/clusters/clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@

import numpy as np
import pandas as pd
import pyccl as ccl
from scipy.interpolate import interp1d

from soliket.clusters import massfunc as mf
from soliket.poisson import PoissonLikelihood

from .survey import SurveyData
from .sz_utils import szutils
from cobaya import LoggedError

C_KM_S = 2.99792e5

Expand All @@ -54,8 +54,15 @@ def initialize(self):

self.zarr = np.arange(0, 2, 0.05)
self.k = np.logspace(-4, np.log10(5), 200)
# self.mdef = ccl.halos.MassDef(500, 'critical')

# self.mdef = self.ccl.halos.MassDef(500, 'critical')

try:
import pyccl as ccl
except ImportError:
raise LoggedError(self.log, "Could not import ccl. "
"Install pyccl to use ClusterLikelihood.")
else:
self.ccl = ccl
super().initialize()

def get_requirements(self):
Expand All @@ -82,11 +89,11 @@ def get_requirements(self):

def _get_sz_model(self, cosmo):
model = SZModel()
model.hmf = ccl.halos.MassFuncTinker08(cosmo, mass_def=self.mdef)
model.hmb = ccl.halos.HaloBiasTinker10(
model.hmf = self.ccl.halos.MassFuncTinker08(cosmo, mass_def=self.mdef)
model.hmb = self.ccl.halos.HaloBiasTinker10(
cosmo, mass_def=self.mdef, mass_def_strict=False
)
model.hmc = ccl.halos.HMCalculator(cosmo, model.hmf, model.hmb, self.mdef)
model.hmc = self.ccl.halos.HMCalculator(cosmo, model.hmf, model.hmb, self.mdef)
# model.szk = SZTracer(cosmo)
return model

Expand Down
9 changes: 5 additions & 4 deletions soliket/lensing/lensing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
r"""
"""
.. module:: lensing
:Synopsis: Gaussian Likelihood for CMB Lensing for Simons Observatory
Expand All @@ -21,8 +21,8 @@

from soliket.ps import BinnedPSLikelihood

# from cobaya.install import NotInstalledError

# from cobaya.install import NotInstalledError


class LensingLikelihood(BinnedPSLikelihood, InstallableLikelihood):
Expand All @@ -46,6 +46,7 @@ class LensingLikelihood(BinnedPSLikelihood, InstallableLikelihood):
Likelihood install itself at run time. Please see the cobaya documentation for more
information about installable likelihoods.
"""

_url = "https://portal.nersc.gov/project/act/jia_qu/lensing_like/likelihood.tar.gz"
install_options = {"download_url": _url}
data_folder = "LensingLikelihood/"
Expand Down Expand Up @@ -109,7 +110,7 @@ def initialize(self):
Cls = self._get_fiducial_Cls()

# Set the fiducial spectra
self.ls = np.arange(0, self.lmax)
self.ls = np.arange(0, self.lmax, dtype=np.longlong)
self.fcltt = Cls["tt"][0: self.lmax]
self.fclpp = Cls["pp"][0: self.lmax]
self.fclee = Cls["ee"][0: self.lmax]
Expand Down Expand Up @@ -207,7 +208,7 @@ def _get_binning_matrix(self):
return binning_matrix

def _get_theory(self, **params_values):
"""
r"""
Generate binned theory vector of :math:`\kappa \kappa` with correction terms.
:param params_values: Dictionary of cosmological parameters.
Expand Down
6 changes: 3 additions & 3 deletions soliket/mflike/theoryforge_MFLike.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
r"""
.. module:: theoryforge
The ``TheoryForge_MFLike`` class applies the foreground spectra and systematic
Expand Down Expand Up @@ -175,7 +175,7 @@ def get_cmbfg_dict(self):
return self.current_state["cmbfg_dict"]

def get_modified_theory(self, Dls, fg_dict, **params):
"""
r"""
Takes the theory :math:`D_{\ell}`, sums it to the total
foreground power spectrum (possibly computed with bandpass
shift and bandpass integration) and applies calibration,
Expand Down Expand Up @@ -320,7 +320,7 @@ def _init_template_from_file(self):
self.dltempl_from_file = templ_from_file(ell=self.ell)

def _get_template_from_file(self, dls_dict, **nuis_params):
"""
r"""
Adds the systematics template, modulated by ``nuis_params['templ_freq']``
parameters, to the :math:`D_{\ell}`.
Expand Down
9 changes: 9 additions & 0 deletions soliket/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import pytest
import sys


def pytest_collection_modifyitems(config, items):
if sys.platform.startswith('win'):
skip_on_windows = pytest.mark.skip(reason="Skipped on Windows")
for item in items:
if "require_ccl" in item.keywords:
item.add_marker(skip_on_windows)


@pytest.fixture
Expand Down
6 changes: 5 additions & 1 deletion soliket/tests/test_ccl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@
Check that CCL works correctly.
"""
import numpy as np
import pytest
from cobaya.likelihood import Likelihood
from cobaya.model import get_model

pytestmark = pytest.mark.require_ccl


class CheckLike(Likelihood):
"""
This is a mock likelihood that simply forces soliket.CCL to calculate
a CCL object.
"""

def logp(self, **params_values):
ccl = self.provider.get_CCL() # noqa F841
ccl = self.provider.get_CCL() # noqa F841
return -1.0

def get_requirements(self):
Expand Down
22 changes: 11 additions & 11 deletions soliket/tests/test_cluster.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@
{
"data": {
"text/plain": [
"\u001b[0;31mSignature:\u001b[0m \u001b[0mhmf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_mass_function\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcosmo\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mM\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0ma\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmdef_other\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mDocstring:\u001b[0m\n",
"\u001B[0;31mSignature:\u001B[0m \u001B[0mhmf\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0mget_mass_function\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0mcosmo\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mM\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0ma\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mmdef_other\u001B[0m\u001B[0;34m=\u001B[0m\u001B[0;32mNone\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n",
"\u001B[0;31mDocstring:\u001B[0m\n",
"Returns the mass function for input parameters.\n",
"\n",
"Args:\n",
Expand All @@ -162,8 +162,8 @@
"\n",
"Returns:\n",
" float or array_like: mass function :math:`dn/d\\log_{10}M` in units of Mpc^-3.\n",
"\u001b[0;31mFile:\u001b[0m ~/miniconda3/envs/soliket/lib/python3.8/site-packages/pyccl/halos/hmfunc.py\n",
"\u001b[0;31mType:\u001b[0m method\n"
"\u001B[0;31mFile:\u001B[0m ~/miniconda3/envs/soliket/lib/python3.8/site-packages/pyccl/halos/hmfunc.py\n",
"\u001B[0;31mType:\u001B[0m method\n"
]
},
"metadata": {},
Expand Down Expand Up @@ -416,13 +416,13 @@
"evalue": "Could not find anything to use input parameter(s) {'num_massive_neutrinos'}.",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mLoggedError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-8-228cccd52c87>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 43\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mcobaya\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmodel\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mget_model\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 44\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 45\u001b[0;31m \u001b[0mmodel_fiducial\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mget_model\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minfo_fiducial\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 46\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 47\u001b[0m \u001b[0mlnl\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmodel_fiducial\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mloglikes\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m{\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniconda3/envs/soliket/lib/python3.8/site-packages/cobaya/model.py\u001b[0m in \u001b[0;36mget_model\u001b[0;34m(info)\u001b[0m\n\u001b[1;32m 103\u001b[0m yaml_dump(sort_cosmetic(updated_info)))\n\u001b[1;32m 104\u001b[0m \u001b[0;31m# Initialize the parameters and posterior\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 105\u001b[0;31m return Model(updated_info[_params], updated_info[kinds.likelihood],\n\u001b[0m\u001b[1;32m 106\u001b[0m \u001b[0mupdated_info\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_prior\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mupdated_info\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkinds\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtheory\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 107\u001b[0m \u001b[0mpackages_path\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0minfo\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_packages_path\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtiming\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mupdated_info\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_timing\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniconda3/envs/soliket/lib/python3.8/site-packages/cobaya/model.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, info_params, info_likelihood, info_prior, info_theory, packages_path, timing, allow_renames, stop_at_error, post, prior_parameterization)\u001b[0m\n\u001b[1;32m 149\u001b[0m \u001b[0;31m# Assign input/output parameters\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 150\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_assign_params\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minfo_likelihood\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minfo_theory\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 151\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_set_dependencies_and_providers\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 152\u001b[0m \u001b[0;31m# Add to the updated info some values that are only available after initialisation\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 153\u001b[0m self._updated_info = recursive_update(\n",
"\u001b[0;32m~/miniconda3/envs/soliket/lib/python3.8/site-packages/cobaya/model.py\u001b[0m in \u001b[0;36m_set_dependencies_and_providers\u001b[0;34m(self, manual_requirements)\u001b[0m\n\u001b[1;32m 642\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_unassigned_input\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdifference_update\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mdirect_param_dependence\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 643\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_unassigned_input\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 644\u001b[0;31m raise LoggedError(\n\u001b[0m\u001b[1;32m 645\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlog\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"Could not find anything to use input parameter(s) %r.\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 646\u001b[0m self._unassigned_input)\n",
"\u001b[0;31mLoggedError\u001b[0m: Could not find anything to use input parameter(s) {'num_massive_neutrinos'}."
"\u001B[0;31m---------------------------------------------------------------------------\u001B[0m",
"\u001B[0;31mLoggedError\u001B[0m Traceback (most recent call last)",
"\u001B[0;32m<ipython-input-8-228cccd52c87>\u001B[0m in \u001B[0;36m<module>\u001B[0;34m\u001B[0m\n\u001B[1;32m 43\u001B[0m \u001B[0;32mfrom\u001B[0m \u001B[0mcobaya\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0mmodel\u001B[0m \u001B[0;32mimport\u001B[0m \u001B[0mget_model\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m 44\u001B[0m \u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0;32m---> 45\u001B[0;31m \u001B[0mmodel_fiducial\u001B[0m \u001B[0;34m=\u001B[0m \u001B[0mget_model\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0minfo_fiducial\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0m\u001B[1;32m 46\u001B[0m \u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m 47\u001B[0m \u001B[0mlnl\u001B[0m \u001B[0;34m=\u001B[0m \u001B[0mmodel_fiducial\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0mloglikes\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0;34m{\u001B[0m\u001B[0;34m}\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m[\u001B[0m\u001B[0;36m0\u001B[0m\u001B[0;34m]\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n",
"\u001B[0;32m~/miniconda3/envs/soliket/lib/python3.8/site-packages/cobaya/model.py\u001B[0m in \u001B[0;36mget_model\u001B[0;34m(info)\u001B[0m\n\u001B[1;32m 103\u001B[0m yaml_dump(sort_cosmetic(updated_info)))\n\u001B[1;32m 104\u001B[0m \u001B[0;31m# Initialize the parameters and posterior\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0;32m--> 105\u001B[0;31m return Model(updated_info[_params], updated_info[kinds.likelihood],\n\u001B[0m\u001B[1;32m 106\u001B[0m \u001B[0mupdated_info\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0mget\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0m_prior\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mupdated_info\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0mget\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0mkinds\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0mtheory\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m,\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m 107\u001B[0m \u001B[0mpackages_path\u001B[0m\u001B[0;34m=\u001B[0m\u001B[0minfo\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0mget\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0m_packages_path\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mtiming\u001B[0m\u001B[0;34m=\u001B[0m\u001B[0mupdated_info\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0mget\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0m_timing\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m,\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n",
"\u001B[0;32m~/miniconda3/envs/soliket/lib/python3.8/site-packages/cobaya/model.py\u001B[0m in \u001B[0;36m__init__\u001B[0;34m(self, info_params, info_likelihood, info_prior, info_theory, packages_path, timing, allow_renames, stop_at_error, post, prior_parameterization)\u001B[0m\n\u001B[1;32m 149\u001B[0m \u001B[0;31m# Assign input/output parameters\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m 150\u001B[0m \u001B[0mself\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0m_assign_params\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0minfo_likelihood\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0minfo_theory\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0;32m--> 151\u001B[0;31m \u001B[0mself\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0m_set_dependencies_and_providers\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0m\u001B[1;32m 152\u001B[0m \u001B[0;31m# Add to the updated info some values that are only available after initialisation\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m 153\u001B[0m self._updated_info = recursive_update(\n",
"\u001B[0;32m~/miniconda3/envs/soliket/lib/python3.8/site-packages/cobaya/model.py\u001B[0m in \u001B[0;36m_set_dependencies_and_providers\u001B[0;34m(self, manual_requirements)\u001B[0m\n\u001B[1;32m 642\u001B[0m \u001B[0mself\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0m_unassigned_input\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0mdifference_update\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0;34m*\u001B[0m\u001B[0mdirect_param_dependence\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0mvalues\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m 643\u001B[0m \u001B[0;32mif\u001B[0m \u001B[0mself\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0m_unassigned_input\u001B[0m\u001B[0;34m:\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0;32m--> 644\u001B[0;31m raise LoggedError(\n\u001B[0m\u001B[1;32m 645\u001B[0m \u001B[0mself\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0mlog\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0;34m\"Could not find anything to use input parameter(s) %r.\"\u001B[0m\u001B[0;34m,\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m 646\u001B[0m self._unassigned_input)\n",
"\u001B[0;31mLoggedError\u001B[0m: Could not find anything to use input parameter(s) {'num_massive_neutrinos'}."
]
}
],
Expand Down
8 changes: 4 additions & 4 deletions soliket/tests/test_clusters.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import numpy as np
import pytest
from cobaya.model import get_model

pytestmark = pytest.mark.require_ccl

clusters_like_and_theory = {
"likelihood": {"soliket.ClusterLikelihood": {"stop_at_error": True}},
"theory": {
Expand All @@ -20,15 +23,13 @@


def test_clusters_model(evaluate_one_info, test_cosmology_params):

evaluate_one_info["params"] = test_cosmology_params
evaluate_one_info.update(clusters_like_and_theory)

model_fiducial = get_model(evaluate_one_info) # noqa F841
model_fiducial = get_model(evaluate_one_info) # noqa F841


def test_clusters_loglike(evaluate_one_info, test_cosmology_params):

evaluate_one_info["params"] = test_cosmology_params
evaluate_one_info.update(clusters_like_and_theory)

Expand All @@ -40,7 +41,6 @@ def test_clusters_loglike(evaluate_one_info, test_cosmology_params):


def test_clusters_n_expected(evaluate_one_info, test_cosmology_params):

evaluate_one_info["params"] = test_cosmology_params
evaluate_one_info.update(clusters_like_and_theory)

Expand Down
Loading

0 comments on commit a53b922

Please sign in to comment.