Skip to content

Commit bfca8f6

Browse files
committed
flatten directory structure and add docstring for VectorVectorElementLink
1 parent f02b67e commit bfca8f6

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

src/uproot/interpretation/known_forth/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot5/blob/main/LICENSE
22

33
"""
4-
This module defines known forth code for types it is known a priori.
4+
This module provides known forth code and awkward forms for types where it is known a priori.
5+
6+
See :doc:`uproot.interpretation.known_forth.known_forth_of` for the function
7+
that provides the lookup of known forth codes and :doc:`uproot.interpretation.known_forth.atlas.VectorVectorElementLink` for an
8+
implementation used in ATLAS (D)AODs.
59
"""
610
from __future__ import annotations
711

812
import uproot
9-
from uproot.interpretation.known_forth.atlas.element_link import VectorVectorElementLink
13+
from uproot.interpretation.known_forth.atlas import VectorVectorElementLink
1014

1115
KNOWN_FORTH_DICT = {
1216
"std::vector<std::vector<ElementLink<DataVector<xAOD::CaloCluster_v1>>>>": VectorVectorElementLink,

src/uproot/interpretation/known_forth/atlas/element_link.py renamed to src/uproot/interpretation/known_forth/atlas.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot5/blob/main/LICENSE
22

33
"""
4-
This module defines known forth code for some ElementLink data types in ATLAS (D)AODs
4+
This module defines ATLAS specific known forth code
55
"""
66

77
from __future__ import annotations
@@ -10,6 +10,23 @@
1010

1111

1212
class VectorVectorElementLink:
13+
"""
14+
Known forth and awkward form for ``std::vector<std::vector<ElementLink<T>>`` types in ATLAS (D)AODs
15+
16+
The forth code was adjusted from what was provided in
17+
``branch._complete_forth_code`` after running ``.array()`` once.
18+
19+
The binary data of one vector<vector<ElementLink<T>> looks as follows:
20+
21+
* 6 bytes header for the outer vector
22+
* 4 bytes big endian uint for the size of the outer vector (node1)
23+
* for each outer vector element:
24+
* 4 bytes big endian uint for the size of the inner vector (node2)
25+
* for each inner vector element:
26+
* 20 bytes header for the ElementLink object
27+
* 4 bytes big endian uint for the ``m_persKey`` member (node3)
28+
* 4 bytes big endian uint for the ``m_persIndex`` member (node4)
29+
"""
1330

1431
forth_code = """
1532
input stream

src/uproot/interpretation/known_forth/atlas/__init__.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)