pyroot_zen.entrypoints package¶
Submodules¶
pyroot_zen.entrypoints.at_cpp_lookup module¶
-
pyroot_zen.entrypoints.at_cpp_lookup.
inject_after
(hook)[source]¶ Signature: hook(name, module)
>>> foo = lambda name, module: None >>> inject_after(foo) >>> inject_after(foo) Traceback (most recent call last): ... ValueError: Hook name already used: <lambda>
pyroot_zen.entrypoints.at_roostats_lookup module¶
Apply hooks after the call from RooStats namespace. This has 2 forms:
- ROOT.RooStats.ProfileLikelihoodCalculator
- from ROOT.RooStats import ProfileLikelihoodCalculator
pyroot_zen.entrypoints.at_tobject_callable module¶
pyroot_zen.entrypoints.at_tobject_setter module¶
-
pyroot_zen.entrypoints.at_tobject_setter.
hooked_TObject_setter
(*args)[source]¶ Shorten the setter to pythonic-descriptor
## Simple class >>> obj = ROOT.TH1F() >>> obj.name = ‘foo’ >>> obj.GetName() ‘foo’ >>> obj.nameTitle = ‘bar’, ‘baz’ # Setting by tuples >>> obj.non_existent_attribute = ‘foo’ Traceback (most recent call last): … AttributeError: ‘TH1F’ object has no attribute ‘non_existent_attribute’
Note: In this construction, duck-typing of the new attribute is forbidden, for ease-of-mind! Note: For special pointer-object like gPad, the hack is in _ExpandMacroFunction
## SetOwnership Usage: >> c = ROOT.TCanvas() >> c.ownership = False
Note: apply on top of above __setattr__ Note: Prefer not-auto so that user is in control.
-
pyroot_zen.entrypoints.at_tobject_setter.
inject
(hook)[source]¶ Inject the hook to apply to arguments before the actual setter call:
The signature shoud be:
new_setter = hook(class_name, attribute_name, original_setter)Primary used to apply RooFit arglist/set patcher into setters, e.g., ModelConfig.SetSnapshot(RooArgSet)