Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
pyhyperiso.core.Common.BinnedObservableId.BinnedObservableId Class Reference
Collaboration diagram for pyhyperiso.core.Common.BinnedObservableId.BinnedObservableId:

Public Member Functions

None __post_init__ (self)
 
 flha (self)
 
"BinnedObservableId" from_flha (cls, Any lhaid)
 
"BinnedObservableId" from_cpp (cls, common.BinnedObservableId cpp_obj)
 
common.BinnedObservableId to_cpp (self)
 
dict to_dict (self)
 
str __repr__ (self)
 
str __str__ (self)
 
bool __eq__ (self, object other)
 
bool __lt__ (self, "BinnedObservableId" other)
 
int __hash__ (self)
 

Public Attributes

 s
 
 p
 

Static Public Attributes

Union s = field(default_factory=lambda: ObservableId("NULL"))
 
tuple p = (0.0, 0.0)
 

Protected Attributes

 _cpp_obj
 

Static Protected Attributes

common _cpp_obj = field(init=False, repr=False)
 

Detailed Description

Python wrapper around the C++ ``BinnedObservableId`` composite identifier.

A ``BinnedObservableId`` uniquely identifies a *binned* observable by:
  - an unbinned observable id (``ObservableId``),
  - a bin range ``(low, high)`` stored as a pair of doubles.

This mirrors the C++ struct::

    struct BinnedObservableId {
        ObservableId s;
        std::pair<double,double> p;
        ...
    };

Args:
    s (Union[ObservableId, str]): Unbinned observable identifier.
        - If a ``str`` is provided, it is converted to ``ObservableId(str)``.
    p (Tuple[float, float]): Bin range (low, high). Defaults to (0.0, 0.0).

Attributes:
    s (ObservableId): Unbinned observable identifier (Python wrapper).
    p (Tuple[float, float]): Bin range.
    _cpp_obj (common.BinnedObservableId): Underlying bound C++ object.

Notes:
    - ``flha()`` returns a bound C++ ``LhaID``.
    - ``from_flha()`` reconstructs a binned id from such an ``LhaID``.
    - Equality/ordering are implemented in C++ (== and <). This wrapper forwards them.

Definition at line 13 of file BinnedObservableId.py.

Member Function Documentation

◆ __eq__()

bool pyhyperiso.core.Common.BinnedObservableId.BinnedObservableId.__eq__ (   self,
object  other 
)
Value equality using the underlying C++ implementation.

Definition at line 141 of file BinnedObservableId.py.

◆ __hash__()

int pyhyperiso.core.Common.BinnedObservableId.BinnedObservableId.__hash__ (   self)
Hash using the underlying C++ hash (bound __hash__) if available.

Falls back to hashing (s, p) in Python if needed.

Definition at line 153 of file BinnedObservableId.py.

◆ __lt__()

bool pyhyperiso.core.Common.BinnedObservableId.BinnedObservableId.__lt__ (   self,
"BinnedObservableId"  other 
)
Strict ordering using the underlying C++ implementation.

Definition at line 147 of file BinnedObservableId.py.

◆ __post_init__()

None pyhyperiso.core.Common.BinnedObservableId.BinnedObservableId.__post_init__ (   self)
Normalize inputs and construct the underlying C++ object.

Raises:
    TypeError: If ``p`` is not a pair (low, high).

Definition at line 48 of file BinnedObservableId.py.

◆ __repr__()

str pyhyperiso.core.Common.BinnedObservableId.BinnedObservableId.__repr__ (   self)
Return a debug representation.

Definition at line 133 of file BinnedObservableId.py.

◆ __str__()

str pyhyperiso.core.Common.BinnedObservableId.BinnedObservableId.__str__ (   self)
Return a human-readable representation.

Definition at line 137 of file BinnedObservableId.py.

◆ flha()

pyhyperiso.core.Common.BinnedObservableId.BinnedObservableId.flha (   self)
Convert this binned id to its FLHA/LHA representation.

Returns:
    common.LhaID: Bound C++ ``LhaID`` for the binned observable.

Raises:
    RuntimeError: If the mapping from ``ObservableId`` to FLHA is unknown.

Definition at line 80 of file BinnedObservableId.py.

◆ from_cpp()

"BinnedObservableId" pyhyperiso.core.Common.BinnedObservableId.BinnedObservableId.from_cpp (   cls,
common.BinnedObservableId  cpp_obj 
)
Wrap an existing bound C++ ``BinnedObservableId`` instance.

Args:
    cpp_obj (common.BinnedObservableId): C++ object coming from pybind.

Returns:
    BinnedObservableId: Python wrapper around the provided C++ object.

Definition at line 109 of file BinnedObservableId.py.

◆ from_flha()

"BinnedObservableId" pyhyperiso.core.Common.BinnedObservableId.BinnedObservableId.from_flha (   cls,
Any  lhaid 
)
Construct a ``BinnedObservableId`` from a binned FLHA/LHA id.

Args:
    lhaid: A bound C++ ``LhaID`` or a wrapper exposing ``to_cpp()``.

Returns:
    BinnedObservableId: Wrapped instance reconstructed from the id.

Raises:
    RuntimeError: If the id cannot be decoded or the mapping is unknown.

Definition at line 92 of file BinnedObservableId.py.

◆ to_cpp()

common.BinnedObservableId pyhyperiso.core.Common.BinnedObservableId.BinnedObservableId.to_cpp (   self)
Return the underlying bound C++ object.

Definition at line 125 of file BinnedObservableId.py.

◆ to_dict()

dict pyhyperiso.core.Common.BinnedObservableId.BinnedObservableId.to_dict (   self)
Serialize this identifier into a debug-friendly dict.

Definition at line 129 of file BinnedObservableId.py.

Member Data Documentation

◆ _cpp_obj [1/2]

common pyhyperiso.core.Common.BinnedObservableId.BinnedObservableId._cpp_obj = field(init=False, repr=False)
staticprotected

Definition at line 46 of file BinnedObservableId.py.

◆ _cpp_obj [2/2]

pyhyperiso.core.Common.BinnedObservableId.BinnedObservableId._cpp_obj
protected

Definition at line 76 of file BinnedObservableId.py.

◆ p [1/2]

tuple pyhyperiso.core.Common.BinnedObservableId.BinnedObservableId.p = (0.0, 0.0)
static

Definition at line 45 of file BinnedObservableId.py.

◆ p [2/2]

pyhyperiso.core.Common.BinnedObservableId.BinnedObservableId.p

Definition at line 63 of file BinnedObservableId.py.

◆ s [1/2]

Union pyhyperiso.core.Common.BinnedObservableId.BinnedObservableId.s = field(default_factory=lambda: ObservableId("NULL"))
static

Definition at line 44 of file BinnedObservableId.py.

◆ s [2/2]

pyhyperiso.core.Common.BinnedObservableId.BinnedObservableId.s

Definition at line 55 of file BinnedObservableId.py.


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