Skip to content

Commit 9058036

Browse files
guitargeekaaronj0
authored andcommitted
[Python] Inject gPad and gVirtualX into facade without ROOT meta
The `gPad and `gVirtualX` identifiers are injected into ROOT meta via `TGlobalMappedFunction::MakeFunctor()`. However, in the ROOT Python interface we don't want to rely on ROOT meta but use Cling or Clang-Repl directly. Hence, we inject these identifiers manually into the facade. The `TDirectoryPythonAdapter` previously used for `gDirectory` mirrored the live-tracking semantics of the C++ macros: every attribute access re-resolves to the current directory. The same semantics are needed for `gPad` and `gVirtualX`, which on the C++ side are also preprocessor macros that expand to a static accessor call. Therefore, a new `LiveProxy` is introduced for this.
1 parent 6ddd17c commit 9058036

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

  • bindings/pyroot/pythonizations/python/ROOT

bindings/pyroot/pythonizations/python/ROOT/_facade.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ def _finalSetup(self):
305305

306306
# Make sure the interpreter is initialized once gROOT has been initialized
307307
self.__dict__["gInterpreter"] = self._cppyy.gbl.TInterpreter.Instance()
308-
self.__dict__["gPad"] = self._cppyy.gbl.TVirtualPad.Pad()
309308

310309
# Release the GIL on the heavy TInterpreter functions. This lets
311310
# background Python threads make progress - in particular, JupyROOT's

0 commit comments

Comments
 (0)