scikit-hep/root_pandas

Require user to specify branches he wants to flatten

KonstantinSchubert opened this issue · 2 comments

The optional argument flatten=True causes root_pandas to flatten out array-like branches in the root file by increasing the number of events in the tuple.

This can lead to unexpected side effects if more than one branch of the TTree contains arrays.

It also fails and causes an error if there are two branches with arrays of unequal length or if one branch contains tensors of dimension two or higher.

The proposal is to only flatten the branches which are specified. The remaining non-scalar branches will then be dropped just as in the case when flatten=False.

ibab commented

That's a good idea.
We could keep the old behaviour as well and issue a FutureWarning that it will be removed.

Should I keep the test for the old behaviour or also remove it?