Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue #1191 #1202

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions pyccl/cosmology.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,16 @@ def __init__(
modified_gravity.MuSigmaMG):
raise NotImplementedError("`mg_parametrization` only supports the "
"mu-Sigma parametrization at this point")
"""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am assuming this commented out section is leftover from during modifications before realising you only want to through the error when c1_mg, c2_mg or lambda_mg is non-zero. Remove commented out section before merging.

if isinstance(
self.mg_parametrization,
modified_gravity.MuSigmaMG) and self.transfer_function_type is not 'boltzmann_isitgr':
raise ValueError("mu-Sigma parametrization is inconsistent with your transfer function choice (required to use isitgr)"
)
"""




# going to save these for later
self._params_init_kwargs = dict(
Expand Down Expand Up @@ -470,6 +480,21 @@ def _build_parameters(
c1_mg = self.mg_parametrization.c1_mg
c2_mg = self.mg_parametrization.c2_mg
lambda_mg = self.mg_parametrization.lambda_mg
gr_flag_scale_dep = 0.


if(c1_mg == 1. and c1_mg == 1.):

gr_flag_scale_dep = 1.

elif(c1_mg == 0. and c2_mg == 0. and lambda_mg == 0.):

gr_flag_scale_dep = 1.

if(gr_flag_scale_dep == 0):

if isinstance(self.mg_parametrization, modified_gravity.MuSigmaMG) and self.transfer_function_type != 'boltzmann_isitgr':
raise ValueError("Your choice of c1_mg, c2_mg, and lambda_mg values is inconsistent with your transfer function choice (you must choose istigr).")

self._fill_params(
m_nu=nu_mass, sum_nu_masses=sum(nu_mass), N_nu_mass=N_nu_mass,
Expand Down
Loading