Namespaces | |
namespace | PyStrings |
Classes | |
class | RPyROOTApplication |
Interactive application for Python. More... | |
class | TMemoryRegulator |
Typedefs | |
typedef std::unordered_map< Cppyy::TCppObject_t, Cppyy::TCppType_t > | ObjectMap_t |
Functions | |
PyObject * | AddBranchAttrSyntax (PyObject *self, PyObject *args) |
Allow branches to be accessed as attributes of a tree. | |
PyObject * | AddCPPInstancePickling (PyObject *self, PyObject *args) |
Set reduce attribute for CPPInstance objects. | |
PyObject * | AddDirectoryGetAttrPyz (PyObject *self, PyObject *args) |
Add attr syntax to TDirectory. | |
PyObject * | AddDirectoryWritePyz (PyObject *self, PyObject *args) |
Add pythonisation of TDirectory::WriteObject. | |
PyObject * | AddFileOpenPyz (PyObject *self, PyObject *args) |
Make TFile::Open equivalent to a constructor. | |
PyObject * | AddPrettyPrintingPyz (PyObject *self, PyObject *args) |
Add pretty printing pythonization. | |
PyObject * | AddSetItemTCAPyz (PyObject *self, PyObject *args) |
Customize the setting of an item of a TClonesArray. | |
PyObject * | AddTClassDynamicCastPyz (PyObject *self, PyObject *args) |
Add pythonization for TClass::DynamicCast. | |
PyObject * | AddTDirectoryFileGetPyz (PyObject *self, PyObject *args) |
Add pythonisation of TDirectoryFile::Get() | |
PyObject * | AddTObjectEqNePyz (PyObject *self, PyObject *args) |
Add pythonization for equality and inequality operators in TObject. | |
PyObject * | AddUsingToClass (PyObject *self, PyObject *args) |
Add base class overloads of a given method to a derived class. | |
PyObject * | AsRTensor (PyObject *self, PyObject *obj) |
Adopt memory of a Python object with array interface using an RTensor. | |
PyObject * | AsRVec (PyObject *self, PyObject *obj) |
Adopt memory of a Python object with array interface using an RVec. | |
PyObject * | BranchPyz (PyObject *self, PyObject *args) |
Add pythonization for TTree::Branch. | |
PyObject * | ClearProxiedObjects (PyObject *self, PyObject *args) |
PyObject * | CPPInstanceExpand (PyObject *self, PyObject *args) |
Deserialize pickled objects. | |
PyObject * | CreateBufferFromAddress (PyObject *self, PyObject *addr) |
Get a buffer starting at a given address. | |
bool | CreatePyStrings () |
PyObject * | DestroyPyStrings () |
Remove all cached python strings. | |
PyObject * | GetDataPointer (PyObject *self, PyObject *args) |
Get pointer to the data of an object. | |
PyObject * | GetEndianess (PyObject *self, PyObject *args) |
Get endianess of the system. | |
PyObject * | GetSizeOfType (PyObject *self, PyObject *args) |
Get size of C++ data-type. | |
void | Init () |
PyObject * | MakeNumpyDataFrame (PyObject *self, PyObject *obj) |
Make an RDataFrame from a dictionary of numpy arrays. | |
PyObject * | SetBranchAddressPyz (PyObject *self, PyObject *args) |
Add pythonization for TTree::SetBranchAddress. | |
Variables | |
PyObject * | gRootModule = 0 |
typedef std::unordered_map<Cppyy::TCppObject_t, Cppyy::TCppType_t> PyROOT::ObjectMap_t |
Definition at line 49 of file TMemoryRegulator.h.
Allow branches to be accessed as attributes of a tree.
[in] | self | Always null, since this is a module function. |
[in] | args | Pointer to a Python tuple object containing the arguments received from Python. |
Allow access to branches/leaves as if they were Python data attributes of the tree (e.g. mytree.branch)
Definition at line 174 of file TTreePyz.cxx.
Set reduce attribute for CPPInstance objects.
[in] | self | Always null, since this is a module function. |
[in] | args | Pointer to a Python tuple object containing the arguments received from Python. |
The C++ function op_reduce defined above is wrapped in a Python method so that it can be injected in CPPInstance
Definition at line 129 of file CPPInstancePyz.cxx.
Add attr syntax to TDirectory.
[in] | self | Always null, since this is a module function. |
[in] | args | Pointer to a Python tuple object containing the arguments This allows to use TDirectory and daughters (such as TDirectoryFile and TFile) as follows myfile.mydir.mysubdir.myHist.Draw()
|
Definition at line 122 of file TDirectoryPyz.cxx.
Add pythonisation of TDirectory::WriteObject.
[in] | self | Always null, since this is a module function. |
[in] | args | Pointer to a Python tuple object containing the arguments |
Definition at line 133 of file TDirectoryPyz.cxx.
Make TFile::Open equivalent to a constructor.
[in] | self | Always null, since this is a module function. |
[in] | args | Pointer to a Python tuple object containing the arguments |
Definition at line 23 of file TFilePyz.cxx.
Add pretty printing pythonization.
[in] | self | Always null, since this is a module function. |
[in] | args | Pointer to a Python tuple object containing the arguments received from Python. |
This function adds the following pythonizations to print the object more user-friendly than cppyy by using the output of cling::printValue as the return value of the special method str.
Definition at line 54 of file GenericPyz.cxx.
Customize the setting of an item of a TClonesArray.
[in] | self | Always null, since this is a module function. |
[in] | args | Pointer to a Python tuple object containing the arguments received from Python. |
Inject a setitem implementation that customizes the setting of an item into a TClonesArray.
The setitem pythonization that TClonesArray inherits from TSeqCollection does not apply in this case and a redefinition is required. The reason is TClonesArray sets objects by constructing them in-place, which is impossible to support as the Python object given as value must exist a priori. It can, however, be memcpy'd and stolen.
Definition at line 167 of file TClonesArrayPyz.cxx.
Add pythonization for TClass::DynamicCast.
[in] | self | Always null, since this is a module function. |
[in] | args | Pointer to a Python tuple object containing the arguments received from Python. |
TClass::DynamicCast returns a void* that the user still has to cast (it will have the proper offset, though). Fix this by providing the requested binding if the cast succeeded.
Definition at line 89 of file TClassPyz.cxx.
Add pythonisation of TDirectoryFile::Get()
[in] | self | Always null, since this is a module function. |
[in] | args | Pointer to a Python tuple object containing the arguments received from Python. |
Allow access to objects through the Get() method. (e.g. dirfile.Get(key))
Definition at line 69 of file TDirectoryFilePyz.cxx.
Add pythonization for equality and inequality operators in TObject.
[in] | self | Always null, since this is a module function. |
[in] | args | Pointer to a Python tuple object containing the arguments received from Python. |
The equality and inequality operators are better implemented in C++, since we need to need to rely on Cppyy's rich comparison if the object we are comparing ourselves with is not a Python proxy or if it contains a null pointer. For example, we need to support the comparison to None.
The rest of comparison operators (i.e. those that define order) can be implemented in Python, throwing a NotImplemented exception if we are not comparing two proxies to TObject or derivate.
Definition at line 57 of file TObjectPyz.cxx.
Add base class overloads of a given method to a derived class.
[in] | self | Always null, since this is a module function. |
[in] | args[0] | Derived class. |
[in] | args[1] | Name of the method whose base class overloads to inject in the derived class. |
This function adds base class overloads to a derived class for a given method. This covers the 'using' case, which is not supported by default by the bindings.
Definition at line 177 of file PyzPythonHelpers.cxx.
Adopt memory of a Python object with array interface using an RTensor.
[in] | obj | PyObject with array interface |
This function returns an RTensor which adopts the memory of the given PyObject. The RTensor takes the data pointer and the shape from the array interface dictionary.
Definition at line 28 of file RTensorPyz.cxx.
Adopt memory of a Python object with array interface using an RVec.
[in] | obj | PyObject with array interface |
This function returns an RVec which adopts the memory of the given PyObject. The RVec takes the data pointer and the size from the array interface dictionary.
Definition at line 28 of file RVecPyz.cxx.
Add pythonization for TTree::Branch.
[in] | self | Always null, since this is a module function. |
[in] | args | Pointer to a Python tuple object containing the arguments received from Python. |
Modify the behaviour of Branch so that proxy references can be passed as arguments from the Python side, more precisely in cases where the C++ implementation of the method expects the address of a pointer.
For example:
The following signatures are treated in this pythonization:
Definition at line 394 of file TTreePyz.cxx.
Definition at line 66 of file PyROOTWrapper.cxx.
Deserialize pickled objects.
[in] | self | Always null, since this is a module function. |
[in] | args | Pointer to a Python tuple object containing the arguments received from Python. |
Helper function that deserializes pickled objects. It needs to be included in the extension module API because otherwise it is not callable from Python. This is important because it will be Python itself calling it when trying to expand a serialized object.
Definition at line 39 of file CPPInstancePyz.cxx.
Get a buffer starting at a given address.
[in] | self | Always null, since this is a module function. |
[in] | addr | Address to create buffer from |
Definition at line 28 of file FacadeHelpers.cxx.
bool PyROOT::CreatePyStrings | ( | ) |
Definition at line 29 of file PyROOTStrings.cxx.
PyObject * PyROOT::DestroyPyStrings | ( | ) |
Remove all cached python strings.
Definition at line 46 of file PyROOTStrings.cxx.
Get pointer to the data of an object.
[in] | self | Always null, since this is a module function. |
[in] | args[0] | Python representation of the C++ object. |
[in] | args[1] | Data-type of the C++ object as Python string |
[in] | args[2] | Method to be called on the C++ object to get the data pointer as Python string |
This function returns the pointer to the data of an object as an Python integer retrieved by the given method.
Definition at line 71 of file PyzPythonHelpers.cxx.
Get endianess of the system.
[in] | self | Always null, since this is a module function. |
[in] | args | Pointer to an empty Python tuple. |
This function returns endianess of the system as a Python integer. The return value is either '<' or '>' for little or big endian, respectively.
Definition at line 106 of file PyzPythonHelpers.cxx.
Get size of C++ data-type.
[in] | self | Always null, since this is a module function. |
[in] | args | C++ data-type as Python string |
This function returns the length of a C++ data-type in bytes as a Python integer.
Definition at line 45 of file PyzPythonHelpers.cxx.
void PyROOT::Init | ( | ) |
Definition at line 50 of file PyROOTWrapper.cxx.
Make an RDataFrame from a dictionary of numpy arrays.
[in] | pydata | Dictionary with numpy arrays |
This function takes a dictionary of numpy arrays and creates an RDataFrame using the keys as column names and the numpy arrays as data.
Definition at line 29 of file RDataFramePyz.cxx.
Add pythonization for TTree::SetBranchAddress.
[in] | self | Always null, since this is a module function. |
[in] | args | Pointer to a Python tuple object containing the arguments received from Python. |
Modify the behaviour of SetBranchAddress so that proxy references can be passed as arguments from the Python side, more precisely in cases where the C++ implementation of the method expects the address of a pointer.
For example:
Definition at line 196 of file TTreePyz.cxx.
Definition at line 39 of file PyROOTModule.cxx.