Skip to content

Commit

Permalink
Rename functions for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
hsinfan1996 committed Jul 17, 2024
1 parent 02160ed commit 7a7f8bb
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions clmm/theory/parent_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def _set_cosmo(self, cosmo):
r"""Sets the cosmology to the internal cosmology object"""
self.cosmo = cosmo if cosmo is not None else self.cosmo_class()

def _eval_miscentered_surface_density(self, r_proj, z_cl, r_mis):
def _eval_surface_density_miscentered(self, r_proj, z_cl, r_mis):
# pylint: disable=invalid-name, possibly-used-before-assignment
c = self.cdelta
rho_def = self.cosmo.get_rho_m(z_cl)
Expand Down Expand Up @@ -284,7 +284,7 @@ def f2(x):

return np.piecewise(x, [x<1, x>1], [f1, f2, 4./15.])

def _eval_miscentered_mean_surface_density(self, r_proj, z_cl, r_mis):
def _eval_mean_surface_density_miscentered(self, r_proj, z_cl, r_mis):
res = np.zeros_like(r_proj)
# pylint: disable=invalid-name
for i, R in enumerate(r_proj):
Expand All @@ -296,11 +296,11 @@ def _eval_miscentered_mean_surface_density(self, r_proj, z_cl, r_mis):

def _integrand_mean_surface_density_mis(self, R, z_cl, r_mis):
# pylint: disable=invalid-name
return R * self._eval_miscentered_surface_density(R, z_cl, r_mis)
return R * self._eval_surface_density_miscentered(R, z_cl, r_mis)

def _eval_miscentered_excess_surface_density(self, r_proj, z_cl, r_mis):
return (self._eval_miscentered_surface_density(r_proj, z_cl, r_mis)
- self._eval_miscentered_mean_surface_density(r_proj, z_cl, r_mis))
def _eval_excess_surface_density_miscentered(self, r_proj, z_cl, r_mis):
return (self._eval_surface_density_miscentered(r_proj, z_cl, r_mis)
- self._eval_mean_surface_density_miscentered(r_proj, z_cl, r_mis))

def _eval_2halo_term_generic(
self,
Expand Down Expand Up @@ -654,7 +654,7 @@ def eval_surface_density(self, r_proj, z_cl, r_mis=None, verbose=False):
print(f"Einasto alpha = {self._get_einasto_alpha(z_cl=z_cl)}")

if r_mis is not None:
return self._eval_miscentered_surface_density(r_proj=r_proj, z_cl=z_cl, r_mis=r_mis)
return self._eval_surface_density_miscentered(r_proj=r_proj, z_cl=z_cl, r_mis=r_mis)
return self._eval_surface_density(r_proj=r_proj, z_cl=z_cl)

def eval_mean_surface_density(self, r_proj, z_cl, r_mis=None, verbose=False):
Expand Down Expand Up @@ -684,7 +684,7 @@ def eval_mean_surface_density(self, r_proj, z_cl, r_mis=None, verbose=False):
print(f"Einasto alpha = {self._get_einasto_alpha(z_cl=z_cl)}")

if r_mis is not None:
return self._eval_miscentered_mean_surface_density(r_proj=r_proj, z_cl=z_cl,
return self._eval_mean_surface_density_miscentered(r_proj=r_proj, z_cl=z_cl,
r_mis=r_mis)

return self._eval_mean_surface_density(r_proj=r_proj, z_cl=z_cl)
Expand Down Expand Up @@ -716,7 +716,7 @@ def eval_excess_surface_density(self, r_proj, z_cl, r_mis=None, verbose=False):
print(f"Einasto alpha = {self._get_einasto_alpha(z_cl=z_cl)}")

if r_mis is not None:
return self._eval_miscentered_excess_surface_density(r_proj=r_proj, z_cl=z_cl,
return self._eval_excess_surface_density_miscentered(r_proj=r_proj, z_cl=z_cl,
r_mis=r_mis)
return self._eval_excess_surface_density(r_proj=r_proj, z_cl=z_cl)

Expand Down

0 comments on commit 7a7f8bb

Please sign in to comment.