@@ -153,12 +153,20 @@ def root2array(filenames,
153153 ``length``. This truncation is after any object selection performed
154154 with the ``object_selection`` argument.
155155 selection : str, optional (default=None)
156- Only include entries fulfilling this condition.
156+ Only include entries fulfilling this condition. If the condition
157+ evaluates to multiple values per tree entry (e.g. conditions on array
158+ branches) then an entry will be included if the condition evaluates to
159+ true for at least one array element.
157160 object_selection : dict, optional (default=None)
158161 A dictionary mapping selection strings to branch names or lists of
159- branch names. Only elements passing the selection strings will be
162+ branch names. Only array elements passing the selection strings will be
160163 included in the output array per entry in the tree. The branches
161- specified must be variable-length array-type branches.
164+ specified must be variable-length array-type branches and the length of
165+ the selection and branches it acts on must match for each tree entry.
166+ For example ``object_selection={'a > 0': ['a', 'b']}`` will include all
167+ elements of 'a' and corresponding elements of 'b' where 'a > 0' for
168+ each tree entry. 'a' and 'b' must have the same length in every tree
169+ entry.
162170 start, stop, step: int, optional (default=None)
163171 The meaning of the ``start``, ``stop`` and ``step`` parameters is the
164172 same as for Python slices. If a range is supplied (by setting some of
@@ -313,12 +321,20 @@ def tree2array(tree,
313321 ``length``. This truncation is after any object selection performed
314322 with the ``object_selection`` argument.
315323 selection : str, optional (default=None)
316- Only include entries fulfilling this condition.
324+ Only include entries fulfilling this condition. If the condition
325+ evaluates to multiple values per tree entry (e.g. conditions on array
326+ branches) then an entry will be included if the condition evaluates to
327+ true for at least one array element.
317328 object_selection : dict, optional (default=None)
318329 A dictionary mapping selection strings to branch names or lists of
319- branch names. Only elements passing the selection strings will be
330+ branch names. Only array elements passing the selection strings will be
320331 included in the output array per entry in the tree. The branches
321- specified must be variable-length array-type branches.
332+ specified must be variable-length array-type branches and the length of
333+ the selection and branches it acts on must match for each tree entry.
334+ For example ``object_selection={'a > 0': ['a', 'b']}`` will include all
335+ elements of 'a' and corresponding elements of 'b' where 'a > 0' for
336+ each tree entry. 'a' and 'b' must have the same length in every tree
337+ entry.
322338 start, stop, step: int, optional (default=None)
323339 The meaning of the ``start``, ``stop`` and ``step`` parameters is the
324340 same as for Python slices. If a range is supplied (by setting some of
0 commit comments