|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|

Public Member Functions | |
| __post_init__ (self) | |
| set_parameter_type (self, ParameterType param_type) | |
| to_dict (self) | |
| "ParamId" | from_cpp (cls, common.ParamId cpp_obj) |
| to_cpp (self) | |
| __repr__ (self) | |
| __eq__ (self, other) | |
| __hash__ (self) | |
Public Attributes | |
| code | |
| block | |
| type | |
Static Public Attributes | |
| Optional | type = None |
| str | block = "NULL" |
| Union | code = field(default_factory=lambda: LhaID(0)) |
Protected Attributes | |
| _cpp_obj | |
Static Protected Attributes | |
| common | _cpp_obj = field(init=False, repr=False) |
Python wrapper around the C++ ``ParamId`` composite identifier.
A ``ParamId`` uniquely identifies a parameter in LHA/SLHA-like structures by:
- an optional semantic parameter type (``ParameterType``),
- a block name (``BlockName`` with alias support),
- an index or multi-index within that block (``LhaID``).
This mirrors the C++ struct:
- ``type`` is optional (can be unset / ``None``),
- ``block`` is a block identifier with aliases,
- ``code`` is an ``LhaID`` (single-part or multi-part).
Attributes:
type (Optional[ParameterType]): Optional high-level parameter category.
``None`` means "unset" (equivalent to ``std::nullopt`` in C++).
block (Union[str, BlockName]): Block identifier. The dataclass field is
declared as ``str`` for convenience, but after initialization it is
normalized to a ``BlockName`` instance.
code (Union[LhaID, int, str, List[int]]): Parameter index / multi-index.
After initialization it is normalized to a ``LhaID`` instance.
Notes:
- The default/null ``ParamId`` corresponds to:
``type=None``, ``block="NULL"``, ``code=0``.
- This class keeps an underlying C++ object in ``_cpp_obj``.
Definition at line 12 of file ParamId.py.
| pyhyperiso.core.Common.ParamId.ParamId.__eq__ | ( | self, | |
| other | |||
| ) |
Definition at line 141 of file ParamId.py.
| pyhyperiso.core.Common.ParamId.ParamId.__hash__ | ( | self | ) |
Definition at line 154 of file ParamId.py.
| pyhyperiso.core.Common.ParamId.ParamId.__post_init__ | ( | self | ) |
Build and normalize the underlying C++ ``ParamId`` after init.
This method:
1) Normalizes ``code`` to ``PyLhaID`` if needed.
2) Normalizes ``block`` to ``PyBlockName`` if needed.
3) Constructs the C++ ``ParamId`` depending on whether ``type`` is set
and whether the (block, code) pair corresponds to the default/null
sentinel.
Raises:
TypeError: If ``block`` or ``code`` cannot be converted to the expected
wrapper types.
Definition at line 46 of file ParamId.py.
| pyhyperiso.core.Common.ParamId.ParamId.__repr__ | ( | self | ) |
Return a debug representation.
Returns:
str: Debug-style string including type, block and code.
Definition at line 133 of file ParamId.py.
| "ParamId" pyhyperiso.core.Common.ParamId.ParamId.from_cpp | ( | cls, | |
| common.ParamId | cpp_obj | ||
| ) |
Wrap an existing bound C++ ``ParamId`` instance.
Args:
cpp_obj (common.ParamId): C++ object coming from pybind.
Returns:
PyParamId: A Python wrapper around the provided C++ object.
Definition at line 109 of file ParamId.py.
| pyhyperiso.core.Common.ParamId.ParamId.set_parameter_type | ( | self, | |
| ParameterType | param_type | ||
| ) |
Set or overwrite the parameter type.
Args:
param_type (ParameterType): New parameter type to assign.
Definition at line 78 of file ParamId.py.
| pyhyperiso.core.Common.ParamId.ParamId.to_cpp | ( | self | ) |
Return the underlying bound C++ object.
Returns:
common.ParamId: The wrapped pybind11 C++ instance.
Definition at line 125 of file ParamId.py.
| pyhyperiso.core.Common.ParamId.ParamId.to_dict | ( | self | ) |
Serialize this identifier into a Python dictionary.
The output is intended for logging/debugging and lightweight serialization.
Returns:
dict: A mapping with keys:
- ``"type"``: type name as ``str`` or ``None`` if unset,
- ``"block"``: the current ``PyBlockName`` object,
- ``"code"``: canonical string representation of the ``LhaID``.
Notes:
If you need a JSON-serializable dict, you may want:
``{"block": str(self.block)}`` instead of returning the object.
Definition at line 87 of file ParamId.py.
|
staticprotected |
Definition at line 44 of file ParamId.py.
|
protected |
Definition at line 67 of file ParamId.py.
|
static |
Definition at line 42 of file ParamId.py.
| pyhyperiso.core.Common.ParamId.ParamId.block |
Definition at line 63 of file ParamId.py.
|
static |
Definition at line 43 of file ParamId.py.
| pyhyperiso.core.Common.ParamId.ParamId.code |
Definition at line 60 of file ParamId.py.
|
static |
Definition at line 41 of file ParamId.py.
| pyhyperiso.core.Common.ParamId.ParamId.type |
Definition at line 74 of file ParamId.py.