|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
Public Member Functions | |
| None | __init__ (self) |
| bool | exists (self, str blockname, ParameterType param_type) |
| None | log_all_blocks (self, ParameterType param_type) |
| None | log_block (self, ParameterType param_type, str blockname) |
| BlockContent | get_block (self, ParameterType param_type, str blockname) |
| set[str] | get_all_blocks (self, ParameterType param_type) |
Static Protected Member Functions | |
| int | _to_cpp_param_type (ParameterType param_type) |
Protected Attributes | |
| _cpp_obj | |
Diagnostic and inspection wrapper around the C++ ``BlockProvider``.
This class exposes block-level utilities for HyperISO parameters. It keeps
the original C++ logging methods available while also providing Pythonic
accessors for block names and block contents.
Examples:
>>> logger = BlockLogger()
>>> logger.exists("SMINPUTS", ParameterType.SM)
True
>>> logger.get_all_blocks(ParameterType.SM)
{"SMINPUTS", "MASS", ...}
>>> logger.get_block(ParameterType.SM, "MASS")
{25: 125.1, ...}
Definition at line 20 of file BlockProvider.py.
| None pyhyperiso.core.Core.BlockProvider.BlockLogger.__init__ | ( | self | ) |
Create a block logger for the current C++ parameter storage.
Definition at line 37 of file BlockProvider.py.
|
staticprotected |
Convert a Python ``ParameterType`` enum to its C++ value.
Args:
param_type: Python parameter namespace enum.
Returns:
Integer value expected by the C++ binding.
Raises:
TypeError: If ``param_type`` is not a ``ParameterType`` instance.
Definition at line 42 of file BlockProvider.py.
| bool pyhyperiso.core.Core.BlockProvider.BlockLogger.exists | ( | self, | |
| str | blockname, | ||
| ParameterType | param_type | ||
| ) |
Return whether a block exists in a parameter namespace.
Args:
blockname: LHA-style block name, for example ``"MASS"``.
param_type: Parameter namespace to inspect.
Returns:
``True`` if the block exists, otherwise ``False``.
Definition at line 61 of file BlockProvider.py.
| set[str] pyhyperiso.core.Core.BlockProvider.BlockLogger.get_all_blocks | ( | self, | |
| ParameterType | param_type | ||
| ) |
Return all block names available in a parameter namespace.
Args:
param_type: Parameter namespace to inspect.
Returns:
Set containing all available block names.
Examples:
>>> logger = BlockLogger()
>>> logger.get_all_blocks(ParameterType.SM)
{"SMINPUTS", "MASS", ...}
Definition at line 120 of file BlockProvider.py.
| BlockContent pyhyperiso.core.Core.BlockProvider.BlockLogger.get_block | ( | self, | |
| ParameterType | param_type, | ||
| str | blockname | ||
| ) |
Return the content of one block as a Python dictionary.
Args:
param_type: Parameter namespace containing the block.
blockname: Name of the block to retrieve.
Returns:
Dictionary mapping LHA identifiers to scalar values.
Examples:
>>> logger = BlockLogger()
>>> logger.get_block(ParameterType.SM, "MASS")
{25: 125.1, ...}
Definition at line 98 of file BlockProvider.py.
| None pyhyperiso.core.Core.BlockProvider.BlockLogger.log_all_blocks | ( | self, | |
| ParameterType | param_type | ||
| ) |
Log all blocks from a parameter namespace through the C++ logger.
Args:
param_type: Parameter namespace to log.
Definition at line 78 of file BlockProvider.py.
| None pyhyperiso.core.Core.BlockProvider.BlockLogger.log_block | ( | self, | |
| ParameterType | param_type, | ||
| str | blockname | ||
| ) |
Log one block through the C++ logger.
Args:
param_type: Parameter namespace containing the block.
blockname: Name of the block to log.
Definition at line 86 of file BlockProvider.py.
|
protected |
Definition at line 39 of file BlockProvider.py.