From 64f19c54fd97d6d20f2dacc921cece2f45ae4581 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 27 Aug 2023 01:33:25 +0800 Subject: [PATCH] Fix docstrings --- clmm/theory/ccl.py | 4 ++-- clmm/theory/cluster_toolkit.py | 6 +++--- clmm/theory/func_layer.py | 22 +++++++++++----------- clmm/theory/generic.py | 14 +++++++------- clmm/theory/numcosmo.py | 4 ++-- clmm/theory/parent_class.py | 8 ++++---- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/clmm/theory/ccl.py b/clmm/theory/ccl.py index 2f610ba28..e95271031 100644 --- a/clmm/theory/ccl.py +++ b/clmm/theory/ccl.py @@ -30,11 +30,11 @@ class CCLCLMModeling(CLMModeling): backend: str Name of the backend being used massdef : str - Profile mass definition (`mean`, `critical`, `virial` - letter case independent) + Profile mass definition ("mean", "critical", "virial" - letter case independent) delta_mdef : int Mass overdensity definition. halo_profile_model : str - Profile model parameterization (`nfw`, `einasto`, `hernquist` - letter case independent) + Profile model parameterization ("nfw", "einasto", "hernquist" - letter case independent) cosmo: Cosmology Cosmology object hdpm: Object diff --git a/clmm/theory/cluster_toolkit.py b/clmm/theory/cluster_toolkit.py index c735df505..d383be2db 100644 --- a/clmm/theory/cluster_toolkit.py +++ b/clmm/theory/cluster_toolkit.py @@ -41,11 +41,11 @@ class CTCLMModeling(CLMModeling): backend: str Name of the backend being used massdef : str - Profile mass definition (`mean`, `critical` - letter case independent) + Profile mass definition ("mean", "critical" - letter case independent) delta_mdef : int Mass overdensity definition. halo_profile_model : str - Profile model parameterization (`nfw`, `einasto`, `hernquist` - letter case independent) + Profile model parameterization ("nfw", "einasto", "hernquist" - letter case independent) cosmo: Cosmology Cosmology object hdpm: Object @@ -144,7 +144,7 @@ def _eval_surface_density(self, r_proj, z_cl): ) # pc**-2 to Mpc**-2 def _eval_mean_surface_density(self, r_proj, z_cl): - r"""Computes the mean value of surface density inside radius r_proj + r"""Computes the mean value of surface density inside radius `r_proj` Parameters ---------- diff --git a/clmm/theory/func_layer.py b/clmm/theory/func_layer.py index 3cb56cf21..0eb2d50c5 100644 --- a/clmm/theory/func_layer.py +++ b/clmm/theory/func_layer.py @@ -5,7 +5,7 @@ # pylint: disable=invalid-name # Thin functonal layer on top of the class implementation of CLMModeling . # The functions expect a global instance of the actual CLMModeling named -# `_modeling_object'. +# "_modeling_object". import numpy as np @@ -365,7 +365,7 @@ def compute_excess_surface_density_2h( .. math:: \Delta\Sigma_{\text{2h}}(R) = \frac{\rho_m(z)b(M)}{(1 + z)^3D_A(z)^2} - \int\frac{ldl}{(2\pi)} P_{\rm mm}(k_l, z)J_2(l\theta) + \int\frac{ldl}{(2\pi)} P_{\text{mm}}(k_l, z)J_2(l\theta) where @@ -431,13 +431,13 @@ def compute_surface_density_2h( r"""Computes the 2-halo term surface density from eq.(13) of Oguri & Hamana (2011) .. math:: - \Sigma_{\rm 2h}(R) = \frac{\rho_m(z)b(M)}{(1 + z)^3D_A(z)^2} \int\frac{ldl}{(2\pi)} - P_{\rm mm}(k_l, z)J_0(l\theta) + \Sigma_{\text{2h}}(R) = \frac{\rho_\text{m}(z)b(M)}{(1 + z)^3D_A(z)^2} + \int\frac{ldl}{(2\pi)}P_{\text{mm}}(k_l, z)J_0(l\theta) where .. math:: - k_l = \frac{l}{D_A(z)(1 +z)} + k_l = \frac{l}{D_A(z)(1 + z)} and :math:`b(M)` is the halo bias @@ -488,14 +488,14 @@ def compute_critical_surface_density_eff(cosmo, z_cluster, pzbins, pzpdf, valida r"""Computes the 'effective critical surface density' .. math:: - \langle \Sigma_{\rm crit}^{-1}\rangle^{-1} = \left(\int \frac{1}{\Sigma_{\rm crit}(z)} - p(z) dz\right)^{-1} + \langle \Sigma_{\text{crit}}^{-1}\rangle^{-1} = + \left(\int \frac{1}{\Sigma_{\text{crit}}(z)}p(z) \mathrm{d}z\right)^{-1} where :math:`p(z)` is the source photoz probability density function. This comes from the maximum likelihood estimator for evaluating a :math:`\Delta\Sigma` profile. - For the standard :math:`\Sigma_{\rm crit}(z)` definition, use the `eval_sigma_crit` method of + For the standard :math:`\Sigma_{\text{crit}}(z)` definition, use the `eval_sigma_crit` method of the CLMM cosmology object. Parameters @@ -848,9 +848,9 @@ def compute_reduced_tangential_shear( massdef : str, optional Profile mass definition, with the following supported options (letter case independent): - * `mean` (default); - * `critical` - not in cluster_toolkit; - * `virial` - not in cluster_toolkit; + * 'mean' (default); + * 'critical' - not in cluster_toolkit; + * 'virial' - not in cluster_toolkit; alpha_ein : float, None, optional If `halo_profile_model=='einasto'`, set the value of the Einasto slope. diff --git a/clmm/theory/generic.py b/clmm/theory/generic.py index 4e6a68c4a..e28754d7c 100644 --- a/clmm/theory/generic.py +++ b/clmm/theory/generic.py @@ -85,7 +85,7 @@ def compute_rdelta(mdelta, redshift, cosmo, massdef="mean", delta_mdef=200): cosmo : clmm.Cosmology Cosmology object massdef : str, None - Profile mass definition (`mean`, `critical`, `virial`). + Profile mass definition ("mean", "critical", "virial"). delta_mdef : int, None Mass overdensity definition. @@ -151,11 +151,11 @@ def compute_profile_mass_in_radius( cdelta : float Concentration of the profile. massdef : str, None - Profile mass definition (`mean`, `critical`, `virial`). + Profile mass definition ("mean", "critical", "virial"). delta_mdef : int, None Mass overdensity definition. halo_profile_model : str - Profile model parameterization (`nfw`, `einasto`, `hernquist`). + Profile model parameterization ("nfw", "einasto", "hernquist"). alpha : float, None Einasto slope, required when `halo_profile_model='einasto'`. @@ -209,19 +209,19 @@ def convert_profile_mass_concentration( cosmo : clmm.Cosmology Cosmology object massdef : str, None - Input profile mass definition (`mean`, `critical`, `virial`). + Input profile mass definition ("mean", "critical", "virial"). delta_mdef : int, None Input mass overdensity definition. halo_profile_model : str, None - Input profile model parameterization (`nfw`, `einasto`, `hernquist`). + Input profile model parameterization ("nfw", "einasto", "hernquist"). massdef2 : str, None - Profile mass definition to convert to (`mean`, `critical`, `virial`). + Profile mass definition to convert to ("mean", "critical", "virial"). If None, `massdef2=massdef`. delta_mdef2 : int, None Mass overdensity definition to convert to. If None, `delta_mdef2=delta_mdef`. halo_profile_model2 : str, None - Profile model parameterization to convert to (`nfw`, `einasto`, `hernquist`). + Profile model parameterization to convert to ("nfw", "einasto", "hernquist"). If None, `halo_profile_model2=halo_profile_model`. alpha : float, None Input Einasto slope when `halo_profile_model='einasto'`. diff --git a/clmm/theory/numcosmo.py b/clmm/theory/numcosmo.py index 556c22bd5..8902abee4 100644 --- a/clmm/theory/numcosmo.py +++ b/clmm/theory/numcosmo.py @@ -23,11 +23,11 @@ class NumCosmoCLMModeling(CLMModeling): backend: str Name of the backend being used massdef : str - Profile mass definition (`mean`, `critical`, `virial` - letter case independent) + Profile mass definition ("mean", "critical", "virial" - letter case independent) delta_mdef : int Mass overdensity definition. halo_profile_model : str - Profile model parameterization (`nfw`, `einasto`, `hernquist` - letter case independent) + Profile model parameterization ("nfw", "einasto", "hernquist" - letter case independent) cosmo: Cosmology Cosmology object hdpm: Object diff --git a/clmm/theory/parent_class.py b/clmm/theory/parent_class.py index 91c50892f..d27b8f7c6 100644 --- a/clmm/theory/parent_class.py +++ b/clmm/theory/parent_class.py @@ -45,11 +45,11 @@ class CLMModeling: cdelta: float Concentration of the profile massdef : str - Profile mass definition (`mean`, `critical`, `virial` - letter case independent) + Profile mass definition ("mean", "critical", "virial" - letter case independent) delta_mdef : int Mass overdensity definition. halo_profile_model : str - Profile model parameterization (`nfw`, `einasto`, `hernquist` - letter case independent) + Profile model parameterization ("nfw", "einasto", "hernquist" - letter case independent) cosmo: Cosmology Cosmology object hdpm: Object @@ -1714,13 +1714,13 @@ def convert_mass_concentration( z_cl: float Redshift of the cluster massdef : str, None - Profile mass definition to convert to (`mean`, `critical`, `virial`). + Profile mass definition to convert to ("mean", "critical", "virial"). If None, same value of current model is used. delta_mdef : int, None Mass overdensity definition to convert to. If None, same value of current model is used. halo_profile_model : str, None - Profile model parameterization to convert to (`nfw`, `einasto`, `hernquist`). + Profile model parameterization to convert to ("nfw", "einasto", "hernquist"). If None, same value of current model is used. alpha : float, None Einasto slope to convert to when `halo_profile_model='einasto'`.