Skip to content

Conversation

@vepadulano
Copy link
Owner

The "Other Operations" family of functions in the ROOT RDataFrame class has been added to PyRDF in the Operation class.
This group of operations is called for the moment "Info", since they mostly provide information about the dataframe, such as the names and types of the defined columns.

To start the implementation of one of those, this PR supports GetColumnType calls on PyRDF nodes.
A very basic algorithm to support this feature has been implemented in the Proxy module. When a new Info operation is created, since it is not actually a modification of the data, it is not wrapped in a Proxy.
Instead _trigger_info_operation function is called, that triggers the creation of PyROOT objects for all the nodes defined until this moment.
In this way, GetColumnType can be correctly called on the PyROOT object linked to the PyRDF node.

If the logic is accepted, new tests will be added to check this functionality.
Following is a sample script to test the new operation:

import PyRDF

rdf = PyRDF.RDataFrame(100)

mydef = rdf.Define("x","rdfentry_ * 2")

mycoltype = mydef.GetColumnType("x")

print(mycoltype) # ULong64_t

The "Other Operations" family of functions in the ROOT RDataFrame class has been added to PyRDF in the `Operation` class.
This group of operations is called for the moment "Info", since they mostly provide information about the dataframe, such as the names and types of the defined columns.

To start the implementation of one of those, this PR supports `GetColumnType` calls on PyRDF nodes.
A very basic algorithm to support this feature has been implemented in the Proxy module. When a new `Info` operation is created, since it is not actually a modification of the data, it is not wrapped in a `Proxy`.
Instead `_trigger_info_operation` function is called, that triggers the creation of PyROOT objects for all the nodes defined until this moment.
In this way, `GetColumnType` can be correctly called on the PyROOT object linked to the PyRDF node.

If the logic is accepted, new tests will be added to check this functionality.
Following is a sample script to test the new operation:

```
import PyRDF

rdf = PyRDF.RDataFrame(100)

mydef = rdf.Define("x","rdfentry_ * 2")

mycoltype = mydef.GetColumnType("x")

print(mycoltype) # ULong64_t
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant