Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Dec 3, 2023
1 parent 4166081 commit 12fdb64
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions hierarc/LensPosterior/kin_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(
num_psf_sampling=100,
num_kin_sampling=1000,
multi_observations=False,
cosmo_fiducial=None
cosmo_fiducial=None,
):
"""
Expand Down Expand Up @@ -110,7 +110,7 @@ def __init__(
num_psf_sampling=num_psf_sampling,
num_kin_sampling=num_kin_sampling,
multi_observations=multi_observations,
cosmo_fiducial=cosmo_fiducial
cosmo_fiducial=cosmo_fiducial,
)

def j_kin_draw(self, kwargs_anisotropy, no_error=False):
Expand Down
30 changes: 16 additions & 14 deletions hierarc/LensPosterior/kin_constraints_composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ def __init__(
center_x,
center_y,
) = self._light_profile_analysis.multi_gaussian_decomposition(
kwargs_lens_light,
r_h=r_eff,
**kwargs_mge_light
kwargs_lens_light, r_h=r_eff, **kwargs_mge_light
)

lens_light_model_list = ["MULTI_GAUSSIAN"]
Expand Down Expand Up @@ -117,7 +115,7 @@ def __init__(
kwargs_lens_light=kwargs_lens_light,
lens_light_model_list=lens_light_model_list,
lens_model_list=lens_model_list,
MGE_light=False, # set False, as MGE is already done as default
MGE_light=False, # set False, as MGE is already done as default
kwargs_mge_light=None,
hernquist_approx=False,
sampling_number=sampling_number,
Expand Down Expand Up @@ -184,10 +182,12 @@ def model_marginalization(self, num_sample_model=20):
(num_sample_model, num_data)
) # matrix that contains the sampled J() distribution
for i in range(num_sample_model):
j_kin = self.j_kin_draw_composite(self.kwargs_anisotropy_base,
np.mean(self.gamma_in_array),
np.mean(self.m2l_array),
no_error=False)
j_kin = self.j_kin_draw_composite(
self.kwargs_anisotropy_base,
np.mean(self.gamma_in_array),
np.mean(self.m2l_array),
no_error=False,
)
j_kin_matrix[i, :] = j_kin

error_cov_j_sqrt = np.cov(np.sqrt(j_kin_matrix.T))
Expand Down Expand Up @@ -244,8 +244,8 @@ def j_kin_draw_composite(self, kwargs_anisotropy, gamma_in, m2l, no_error=False)
kwargs_lens_light=kwargs_light,
kwargs_anisotropy=kwargs_anisotropy,
r_eff=r_eff_draw,
theta_E=self._theta_E, # send this to avoid unnecessary recomputation
gamma=self._gamma, # send this to avoid unnecessary recomputation
theta_E=self._theta_E, # send this to avoid unnecessary recomputation
gamma=self._gamma, # send this to avoid unnecessary recomputation
)
return j_kin

Expand Down Expand Up @@ -287,10 +287,12 @@ def anisotropy_scaling(self):
:return: anisotropy scaling grid along the axes defined by ani_param_array
"""
j_ani_0 = self.j_kin_draw_composite(self.kwargs_anisotropy_base,
np.mean(self.gamma_in_array),
np.mean(self.m2l_array),
no_error=True)
j_ani_0 = self.j_kin_draw_composite(
self.kwargs_anisotropy_base,
np.mean(self.gamma_in_array),
np.mean(self.m2l_array),
no_error=True,
)
return self._anisotropy_scaling_relative(j_ani_0)

def _anisotropy_scaling_relative(self, j_ani_0):
Expand Down

0 comments on commit 12fdb64

Please sign in to comment.