baseobject

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.

Parameters
  • 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.

Raises

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.

Parameters

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.

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

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

Returns

Return type

list(ZfitParameters)

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.

Parameters

() (cacher) –

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

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.