uproot5
uproot5 copied to clipboard
How to create an empty tree with several var-length branches that share the var length
I want to write several variable length arrays that have the same length to an empty tree. https://uproot.readthedocs.io/en/latest/basic.html#extending-ttrees-with-large-datasets explains
- How to generate an empty tree with mktree, which can be
extend
ed later, I need this - How to generate a tree with several arrays that share the length and already contain data, with awkward.zip
What I am missing is the combination of the two. I want to start with an empty tree like in 1) that has branches which share the varlength. Then I want to extend this tree subsequently. Is this possible? If not, may I suggest the following intuitive API:
Instead of {"x": "var * float32", "y": "var * float32"}, which generates two extra branches "nx" and "ny", please allow this declaration, where the counting branch is explicit:
{"n": "int32", "x": "n * float32", "y": "n * float32"}
As the Python of Zen says, explicit is better than implicit.