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

[MRG] Rewrite tree2array #202

Merged
merged 6 commits into from
May 20, 2015
Merged

[MRG] Rewrite tree2array #202

merged 6 commits into from
May 20, 2015

Conversation

ndawe
Copy link
Member

@ndawe ndawe commented May 19, 2015

  • Speed improvement for trees with many branches: Don't call TTree::FindBranch for each branch since that results in O(n^2). The new algorithm runs in linear time with respect to the number of branches.
  • Support for multidimensional variable-length and fixed-length arrays. This resolves Failure when reading complex root file #192.
  • If a single branch is requested as a string (not a list of one string), then return a simple 1D array.

Comparing with #193, that particular tree with many branches is now converted twice as fast:

Before:

>>> min(timeit.Timer("tree2array(tree, branches=branches)", setup=setup).repeat(10, 1))
0.362231016159

After:

>>> min(timeit.Timer("tree2array(tree, branches=branches)", setup=setup).repeat(10, 1))
0.189702987671

@ndawe ndawe changed the title [WIP] Rewrite tree2array [MRG] Rewrite tree2array May 20, 2015
ndawe added a commit that referenced this pull request May 20, 2015
[MRG] Rewrite tree2array
@ndawe ndawe merged commit c332a0f into scikit-hep:master May 20, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failure when reading complex root file
1 participant