PhaseSpace
- class remu.binning.PhaseSpace(variables)[source]
A PhaseSpace defines the possible combinations of variables that characterize an event.
- Parameters
- variablesiterable of strings
The set of variables that define the phase space.
Notes
A PhaseSpace can be seen as the carthesian product of its variables:
>>> ps = PhaseSpace(variables=['a', 'b', 'c']) >>> print ps ('a' X 'c' X 'b')
You can check whether a variable is part of a phase space:
>>> 'a' in ps True
Phase spaces can be compared to one another.
Check whether two phase spaces are identical:
>>> PhaseSpace(['a','b']) == PhaseSpace(['b', 'a']) True >>> PhaseSpace(['a', 'b']) == PhaseSpace(['a', 'c']) False >>> PhaseSpace(['a', 'b']) != PhaseSpace(['a', 'c']) True
Check whether one phase space is a sub-space of the other:
>>> PhaseSpace(['a', 'b','c')] > PhaseSpace(['a', 'b']) True >>> PhaseSpace(['a', 'c']) < PhaseSpace(['a', 'b','c']) True
Attributes
variables
(set of str) The set of variables that define the phase space.
Methods
clone
()Return a copy of the object.
from_yaml
(loader, node)Convert a representation node to a Python object.
to_yaml
(dumper, obj)Convert a Python object to a representation node.
yaml_dumper
yaml_loader
- yaml_loader
alias of
yaml.loader.FullLoader