Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/gamma_pl_sampling' into gamma_pl…
Browse files Browse the repository at this point in the history
…_sampling
  • Loading branch information
sibirrer committed Jul 5, 2024
2 parents d5f7faf + f637d52 commit 9b7f176
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
1 change: 0 additions & 1 deletion hierarc/LensPosterior/ddt_kin_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,4 @@ def hierarchy_configuration(self, num_sample_model=20):
# if "gamma_pl" in self._param_name_list:
# kwargs_likelihood["gamma_pl_sampling"] = True


return kwargs_likelihood
4 changes: 3 additions & 1 deletion hierarc/Likelihood/cosmo_likelihood.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ def __init__(
kwargs_global_model=kwargs_model,
)
gamma_pl_num = self._likelihoodLensSample.gamma_pl_num
self.param = ParamManager(cosmology, gamma_pl_num=gamma_pl_num, **kwargs_model, **kwargs_bounds)
self.param = ParamManager(
cosmology, gamma_pl_num=gamma_pl_num, **kwargs_model, **kwargs_bounds
)
self._lower_limit, self._upper_limit = self.param.param_bounds
self._prior_add = False
if custom_prior is not None:
Expand Down
11 changes: 7 additions & 4 deletions hierarc/Likelihood/lens_sample_likelihood.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ def __init__(self, kwargs_lens_list, normalized=False, kwargs_global_model=None)
kwargs_lens_ = self._merge_global2local_settings(
kwargs_global_model=kwargs_global_model, kwargs_lens=kwargs_lens
)
self._lens_list.append(LensLikelihood(gamma_pl_index=gamma_pl_index_, **kwargs_lens_))
self._lens_list.append(
LensLikelihood(gamma_pl_index=gamma_pl_index_, **kwargs_lens_)
)

def log_likelihood(
self,
Expand Down Expand Up @@ -84,10 +86,11 @@ def num_data(self):

@property
def gamma_pl_num(self):
"""
number of power-law density slope parameters being sampled on individual lenses
"""Number of power-law density slope parameters being sampled on individual
lenses.
:return: number of power-law density slope parameters being sampled on individual lenses
:return: number of power-law density slope parameters being sampled on
individual lenses
"""
return self._gamma_pl_num

Expand Down
4 changes: 2 additions & 2 deletions test/test_Sampling/test_ParamManager/test_lens_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ def test_args2kwargs(self):
"gamma_pl_list": [2, 2.5],
}
args = self._param.kwargs2args(kwargs)
print(args, 'test args')
print(args, "test args")
kwargs_new, i = self._param.args2kwargs(args, i=0)
print(kwargs_new, 'test kwargs_new')
print(kwargs_new, "test kwargs_new")
args_new = self._param.kwargs2args(kwargs_new)
npt.assert_almost_equal(args_new, args)

Expand Down

0 comments on commit 9b7f176

Please sign in to comment.