dimension¶

class zfit.core.dimension.BaseDimensional[source]
property axes

Return the axes, integer based identifier(indices) for the coordinate system.

property n_obs

Return the number of observables, the dimensionality. Corresponds to the last dimension.

property obs

Return the observables, string identifier for the coordinate system.

zfit.core.dimension.common_axes(spaces: Union[zfit.Space, Iterable[zfit.Space]]) → Union[List[str], bool][source]

Extract the union of axes from spaces in the order of spaces.

For example:
space1.axes: [1, 3]
space2.axes: [2, 3, 1]
space3.axes: [2]

returns [1, 3, 2]

Parameters

() (spaces) – :py:class:~zfit.Spaces to extract the axes from

Returns

The axes as int or False if not every space has axes

Return type

List[int] or False

zfit.core.dimension.common_obs(spaces: Union[zfit.Space, Iterable[zfit.Space]]) → Union[List[str], bool][source]

Extract the union of obs from spaces in the order of spaces.

For example:
space1.obs: [‘obs1’, ‘obs3’]
space2.obs: [‘obs2’, ‘obs3’, ‘obs1’]
space3.obs: [‘obs2’]

returns [‘obs1’, ‘obs3’, ‘obs2’]

Parameters

() (spaces) – :py:class:~zfit.Spaces to extract the obs from

Returns

The observables as str or False if not every space has observables

Return type

List[str]

zfit.core.dimension.get_same_obs(obs)[source]
zfit.core.dimension.limits_overlap(spaces: Union[zfit.Space, Iterable[zfit.Space]], allow_exact_match: bool = False) → bool[source]

Check if _any_ of the limits of spaces overlaps with _any_ other of spaces.

This also checks multiple limits within one space. If allow_exact_match is set to true, then an exact overlap of limits is allowed.

Parameters
• spaces (Iterable[zfit.Space]) –

• allow_exact_match (bool) – An exact overlap of two limits is counted as “not overlapping”. Example: limits from -1 to 3 and 4 to 5 to NOT overlap with the limits 4 to 5 iff allow_exact_match is True.

Returns

if there are overlapping limits.

Return type

bool

zfit.core.dimension.obs_subsets(dimensionals: Iterable[zfit.core.interfaces.ZfitDimensional]) → Dict[Set[str], zfit.core.interfaces.ZfitDimensional][source]

Split dimensionals into the smallest subgroup of obs and return a dict.

Parameters

dimensionals – An Iterable containing two or more ZfitDimensional that should be split into the smallest subset.

Returns

dict with the keys being sets of observables and the values, an iterable, containing the ZfitDimensional

Return type

dict