Baseclass for most objects appearing in zfit.

class zfit.core.baseobject.BaseNumeric(name, params, **kwargs)[source]

Bases: zfit.util.cache.Cachable, zfit.core.dependents.BaseDependentsMixin, zfit.core.interfaces.ZfitNumeric, zfit.core.baseobject.BaseObject

add_cache_dependents(cache_dependents: Union[zfit.core.interfaces.ZfitCachable, Iterable[zfit.core.interfaces.ZfitCachable]], allow_non_cachable: bool = True)

Add dependents that render the cache invalid if they change.

  • cache_dependents (ZfitCachable) –

  • allow_non_cachable (bool) – If True, allow cache_dependents to be non-cachables. If False, any cache_dependents that is not a ZfitCachable will raise an error.


TypeError – if one of the cache_dependents is not a ZfitCachable _and_ allow_non_cachable if False.

copy(deep: bool = False, name: str = None, **overwrite_params) → zfit.core.interfaces.ZfitObject
property dtype

The dtype of the object

get_dependents(only_floating: bool = True) -> OrderedSet(['z', 'f', 'i', 't', '.', 'P', 'a', 'r', 'm', 'e'])

Return a set of all independent Parameter that this object depends on.


only_floating (bool) – If True, only return floating Parameter

get_params(only_floating: bool = False, names: Union[str, List[str], None] = None) → List[ZfitParameter][source]

Return the parameters. If it is empty, automatically return all floating variables.

  • () (names) – If True, return only the floating parameters.

  • () – The names of the parameters to return.


Return type


graph_caching_methods = []
property name

The name of the object.

old_graph_caching_methods = []
property params
register_cacher(cacher: Union[zfit.core.interfaces.ZfitCachable, Iterable[zfit.core.interfaces.ZfitCachable]])

Register a cacher that caches values produces by this instance; a dependent.


() (cacher) –

reset_cache(reseter: zfit.util.cache.ZfitCachable)

Clear the cache of self and all dependent cachers.

class zfit.core.baseobject.BaseObject(name, **kwargs)[source]

Bases: zfit.core.interfaces.ZfitObject

copy(deep: bool = False, name: str = None, **overwrite_params) → zfit.core.interfaces.ZfitObject[source]
property name

The name of the object.