Skip to content

Commit

Permalink
fully implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
damonge committed Nov 19, 2024
1 parent 0009530 commit 58cfa69
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyccl/ccl.i
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ from .errors import CCLError
%init %{
import_array();
// Tell CCL to not print to stdout/stderr for debugging.
ccl_set_debug_policy(CCL_DEBUG_MODE_ON);
ccl_set_debug_policy(CCL_DEBUG_MODE_OFF);
%}

// Automatically document arguments and output types of all functions
Expand Down
4 changes: 2 additions & 2 deletions pyccl/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ def angular_cl(
the kernels are defined will be used (capped to 1E-6 Mpc if this
value is zero). Users are encouraged to experiment with this parameter
and ``fkem_Nchi`` to ensure the robustness of the output
:math:`C_\\ell`s.
:math:`C_\\ell` s.
fkem_Nchi: Number of values of the comoving distance over which `FKEM`
will interpolate the radial kernels. If ``None`` the smallest number
over which the kernels are currently sampled will be used. Note that
`FKEM` will use a logarithmic sampling for distances between
``fkem_chi_min`` and the maximum distance over which the tracers
are defined. Users are encouraged to experiment with this parameter
and ``fkem_chi_min`` to ensure the robustness of the output
:math:`C_\\ell`s.
:math:`C_\\ell` s.
p_of_k_a_lin (:class:`~pyccl.pk2d.Pk2D`, :obj:`str` or :obj:`None`):
3D linear Power spectrum to project, for special use in
PT calculations using the FKEM non-limber integration technique.
Expand Down
12 changes: 11 additions & 1 deletion pyccl/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ def update_warning_verbosity(verbosity):
""" Update the level of verbosity of the CCL warnings. Available
levels are "none", "low", and "high". More warning messages will
be output for higher verbosity levels. If "none", no CCL-level
warnings will be shown.
warnings will be shown. The default verbosity is "low". Note that
unless the verbosity level is "high", all C-level warnings will
be omitted.
Args:
verbosity (str): one of ``'none'``, ``'low'`` or ``'high'``.
Expand All @@ -36,6 +38,14 @@ def update_warning_verbosity(verbosity):
raise KeyError("`verbosity` must be one of {'none', 'low', 'high'}")
warnings._CCL_WARN_THRESHOLD = _verbosity_thresholds[verbosity]

# Remove C-level warnings
from . import debug_mode

if verbosity == 'high':
debug_mode(True)
else:
debug_mode(False)


class CCLError(RuntimeError):
"""A CCL-specific RuntimeError"""
Expand Down
7 changes: 7 additions & 0 deletions readthedocs/api/pyccl.halos.hmfunc.nishimichi19.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pyccl.halos.hmfunc.nishimichi19 module
======================================

.. automodule:: pyccl.halos.hmfunc.nishimichi19
:members:
:undoc-members:
:show-inheritance:
1 change: 1 addition & 0 deletions readthedocs/api/pyccl.halos.hmfunc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Submodules
pyccl.halos.hmfunc.bocquet20
pyccl.halos.hmfunc.despali16
pyccl.halos.hmfunc.jenkins01
pyccl.halos.hmfunc.nishimichi19
pyccl.halos.hmfunc.press74
pyccl.halos.hmfunc.sheth99
pyccl.halos.hmfunc.tinker08
Expand Down
2 changes: 1 addition & 1 deletion src/ccl_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

// Debug mode policy: whether to print error messages as they are raised.
// Defualt is ON.
static CCLDebugModePolicy _ccl_debug_mode_policy = CCL_DEBUG_MODE_ON;
static CCLDebugModePolicy _ccl_debug_mode_policy = CCL_DEBUG_MODE_OFF;

// Set debug mode policy
void ccl_set_debug_policy(CCLDebugModePolicy debug_policy) {
Expand Down

0 comments on commit 58cfa69

Please sign in to comment.