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

Public Member Functions

None __init__ (self, Optional[ParameterType] param_type=None)
 
Scalar get_by_pid (self, ParamId pid, DataType dtype=DataType.VALUE)
 
Scalar get_by_block (self, str block, Union[int, str, list, LhaID] code, DataType dtype=DataType.VALUE)
 
bool exists_by_pid (self, ParamId pid)
 
bool exists_by_block (self, str block, Union[int, str, list, LhaID] code)
 
Parameter get_parameter (self, ParamId pid)
 
ParameterType get_type (self)
 
str __repr__ (self)
 

Protected Attributes

 _type
 
 _cpp_obj
 

Detailed Description

Read parameter values and metadata from a C++ parameter namespace.

A provider can be bound to a specific :class:`ParameterType`, or left
unfiltered to use the C++ provider default. Parameters can be addressed by
a full ``ParamId`` or by the pair ``(block, code)``.

Examples:
    >>> provider = ParameterProvider(ParameterType.SM)
    >>> pid = ParamId(type=ParameterType.SM, block="MASS", code=24)
    >>> provider.exists_by_pid(pid)
    True
    >>> provider.get_by_block("MASS", 24)
    80.379

Definition at line 18 of file ParameterProvider.py.

Constructor & Destructor Documentation

◆ __init__()

None pyhyperiso.core.Core.ParameterProvider.ParameterProvider.__init__ (   self,
Optional[ParameterType]   param_type = None 
)
Create a provider.

Args:
    param_type: Optional parameter namespace. When omitted, the C++
        default provider constructor is used.

Definition at line 34 of file ParameterProvider.py.

Member Function Documentation

◆ __repr__()

str pyhyperiso.core.Core.ParameterProvider.ParameterProvider.__repr__ (   self)
Return a compact representation including the provider type.

Definition at line 106 of file ParameterProvider.py.

◆ exists_by_block()

bool pyhyperiso.core.Core.ParameterProvider.ParameterProvider.exists_by_block (   self,
str  block,
Union[int, str, list, LhaID code 
)
Return whether a parameter exists for ``(block, code)``.

Definition at line 84 of file ParameterProvider.py.

◆ exists_by_pid()

bool pyhyperiso.core.Core.ParameterProvider.ParameterProvider.exists_by_pid (   self,
ParamId  pid 
)
Return whether a parameter exists for a full ``ParamId``.

Definition at line 80 of file ParameterProvider.py.

◆ get_by_block()

Scalar pyhyperiso.core.Core.ParameterProvider.ParameterProvider.get_by_block (   self,
str  block,
Union[int, str, list, LhaID code,
DataType   dtype = DataType.VALUE 
)
Return a parameter component addressed by block and LHA code.

Args:
    block: LHA-style block name.
    code: LHA code. Integers, strings, lists and ``LhaID`` are accepted.
    dtype: Component to read.

Returns:
    Requested parameter component as a Scalar (real,complex).

Definition at line 60 of file ParameterProvider.py.

◆ get_by_pid()

Scalar pyhyperiso.core.Core.ParameterProvider.ParameterProvider.get_by_pid (   self,
ParamId  pid,
DataType   dtype = DataType.VALUE 
)
Return a parameter component addressed by ``ParamId``.

Args:
    pid: Parameter identifier.
    dtype: Component to read, for example central value or uncertainty.

Returns:
    Requested parameter component as a Scalar (real,complex).

Definition at line 48 of file ParameterProvider.py.

◆ get_parameter()

Parameter pyhyperiso.core.Core.ParameterProvider.ParameterProvider.get_parameter (   self,
ParamId  pid 
)
Return the full parameter object for ``pid``.

Args:
    pid: Parameter identifier to retrieve.

Returns:
    Python ``Parameter`` wrapper around the bound C++ object.

Definition at line 90 of file ParameterProvider.py.

◆ get_type()

ParameterType pyhyperiso.core.Core.ParameterProvider.ParameterProvider.get_type (   self)
Return the namespace served by this provider.

Definition at line 102 of file ParameterProvider.py.

Member Data Documentation

◆ _cpp_obj

pyhyperiso.core.Core.ParameterProvider.ParameterProvider._cpp_obj
protected

Definition at line 42 of file ParameterProvider.py.

◆ _type

pyhyperiso.core.Core.ParameterProvider.ParameterProvider._type
protected

Definition at line 41 of file ParameterProvider.py.


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