Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
pyhyperiso.core.Core.APIAdapter.APIAdapter Class Reference

Public Member Functions

None __init__ (self)
 
bool check_flag (self, ExternalFlag ext_flag)
 
str get_path (self, APIPath path_type)
 
Set[BlockNameget_all_blocks (self)
 
Set[BlockNameget_blocks_list (self, ParameterType param_type=ParameterType.SM)
 
dict[LhaID, Scalar] get_block_infos (self, str block_name, ParameterType param_type=ParameterType.SM)
 
list[ParameterTypeget_type_of_block (self, str block_name)
 

Protected Attributes

 _cpp_obj
 

Detailed Description

Inspection wrapper around the C++ ``APIAdapter``.

The adapter reads process-wide state managed by the C++ core. It should
normally be used after ``HyperisoMaster.init(...)`` has loaded a model and
an LHA input file.

Examples:
    >>> from pyhyperiso.core.Core.HyperisoMaster import HyperisoMaster
    >>> from pyhyperiso.core.Core.HyperisoConfig import HyperisoConfig
    >>> hyp = HyperisoMaster()
    >>> hyp.init("lha/si_input.flha", HyperisoConfig())
    >>> api = APIAdapter()
    >>> api.check_flag(ExternalFlag.IS_LHA_SPECTRUM)
    False
    >>> api.get_path(APIPath.USER_SM_PARAMS)
    '/path/to/user_sm_params.yaml'
    >>> "MASS" in {str(b) for b in api.get_blocks_list(ParameterType.SM)}
    True

Definition at line 58 of file APIAdapter.py.

Constructor & Destructor Documentation

◆ __init__()

None pyhyperiso.core.Core.APIAdapter.APIAdapter.__init__ (   self)
Create an adapter bound to the current C++ runtime state.

Definition at line 79 of file APIAdapter.py.

Member Function Documentation

◆ check_flag()

bool pyhyperiso.core.Core.APIAdapter.APIAdapter.check_flag (   self,
ExternalFlag  ext_flag 
)
Return whether an external initialization flag is enabled.

Args:
    ext_flag: Python wrapper for a C++ ``ExternalFlag`` value.

Returns:
    ``True`` if the flag is active in the current Hyperiso session,
    otherwise ``False``.

Definition at line 83 of file APIAdapter.py.

◆ get_all_blocks()

Set[BlockName] pyhyperiso.core.Core.APIAdapter.APIAdapter.get_all_blocks (   self)
Return all known block names across parameter namespaces.

Returns:
    Set of Python ``BlockName`` wrappers.

Definition at line 108 of file APIAdapter.py.

◆ get_block_infos()

dict[LhaID, Scalar] pyhyperiso.core.Core.APIAdapter.APIAdapter.get_block_infos (   self,
str  block_name,
ParameterType   param_type = ParameterType.SM 
)
Return all entries stored in a parameter block.

Args:
    block_name: Name of the LHA-style block, such as ``"MASS"`` or
        ``"SMINPUTS"``.
    param_type: Parameter namespace containing the block.

Returns:
    Mapping from LHA code to scalar value.

Definition at line 131 of file APIAdapter.py.

◆ get_blocks_list()

Set[BlockName] pyhyperiso.core.Core.APIAdapter.APIAdapter.get_blocks_list (   self,
ParameterType   param_type = ParameterType.SM 
)
Return the block names available in one parameter namespace.

Args:
    param_type: Parameter namespace to inspect. For example,
        ``ParameterType.SM`` reads Standard Model input blocks, while
        ``ParameterType.WILSON`` reads Wilson-coefficient blocks.

Returns:
    Set of available block names.

Definition at line 117 of file APIAdapter.py.

◆ get_path()

str pyhyperiso.core.Core.APIAdapter.APIAdapter.get_path (   self,
APIPath  path_type 
)
Return a configured path from the C++ runtime.

Args:
    path_type: Path key to query.

Returns:
    Path string associated with ``path_type``. Provider-backed paths
    reflect any valid pre-init override registered through
    ``HyperisoMaster.pre_init_set_paths(...)``.

Definition at line 95 of file APIAdapter.py.

◆ get_type_of_block()

list[ParameterType] pyhyperiso.core.Core.APIAdapter.APIAdapter.get_type_of_block (   self,
str  block_name 
)
Return namespaces in which a block name exists.

Args:
    block_name: Name of the block to locate.

Returns:
    List of ``ParameterType`` values containing ``block_name``.

Definition at line 152 of file APIAdapter.py.

Member Data Documentation

◆ _cpp_obj

pyhyperiso.core.Core.APIAdapter.APIAdapter._cpp_obj
protected

Definition at line 81 of file APIAdapter.py.


The documentation for this class was generated from the following file: