Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Commit

Permalink
Merge 4e2e201 into d337ed0
Browse files Browse the repository at this point in the history
  • Loading branch information
graipher committed Oct 19, 2017
2 parents d337ed0 + 4e2e201 commit 51df9c0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions root_numpy/src/tree.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,12 @@ def array2root(arr, filename, treename='tree', mode='update'):
# If a tree with that name exists, we want to update it
cdef TTree* tree = <TTree*> rfile.Get(treename)
tree = array2tree(arr, name=treename, tree=tree)
if "/" in treename:
components = treename.split("/")
dirs = components[:-1]
for d in dirs:
rfile.mkdir(d).cd()
treename = components[-1]
tree.Write(treename, kOverwrite)
del tree
rfile.Close()
Expand Down

0 comments on commit 51df9c0

Please sign in to comment.