Skip to content

Commit 94d9684

Browse files
chore: miscellaneous RNTuple improvements (#1250)
* Fixed __len__ method * Added a few more useful methods * Use the right number in arrays method * Updated to match spec and did some cleanup * Fixed order of extra type information * Extract column summary flags * style: pre-commit fixes * Fixed conflict resolution * Fixed test * Switched to using enums * Fixed RNTuple anchor * Updated locator types * Removed UserMetadata envelope * Started implementing new real32 types * Updated sharded cluster to match spec * Removed user metadata from footer * Fixed ClusterSummaryReader * Fix cascadentuple * Introduced RNTupleField class * Added test for #1285 * Fixed test * Fix test (attempt 2) * Finalized first version of RNTupleField * Added tests for RNTupleField * Implemented iterate method --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 53f917c commit 94d9684

File tree

8 files changed

+620
-119
lines changed

8 files changed

+620
-119
lines changed

src/uproot/const.py

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"""
66
from __future__ import annotations
77

8-
import struct
8+
from enum import IntEnum
99

1010
import numpy
1111

@@ -118,8 +118,6 @@
118118
kStreamedMemberWise = numpy.uint16(1 << 14)
119119

120120
############ RNTuple https://github.com/root-project/root/blob/master/tree/ntuple/v7/doc/specifications.md
121-
_rntuple_frame_format = struct.Struct("<Q")
122-
rntuple_env_header = _rntuple_frame_format.pack(0) # TODO: need to check this
123121
rntuple_col_num_to_dtype_dict = {
124122
1: "uint64",
125123
2: "uint32",
@@ -149,6 +147,8 @@
149147
26: "int64", # split + zigzag encoding
150148
27: "int32", # split + zigzag encoding
151149
28: "int16", # split + zigzag encoding
150+
29: "float32trunc",
151+
30: "float32quant",
152152
}
153153
rntuple_col_num_to_size_dict = {
154154
1: 64,
@@ -179,6 +179,8 @@
179179
26: 64, # split + zigzag encoding
180180
27: 32, # split + zigzag encoding
181181
28: 16, # split + zigzag encoding
182+
29: 32, # TODO: variable size
183+
30: 32, # TODO: variable size
182184
}
183185

184186
rntuple_col_type_to_num_dict = {
@@ -212,7 +214,49 @@
212214
"splitzigzagint16": 28,
213215
}
214216

215-
rntuple_role_leaf = 0
216-
rntuple_role_vector = 1
217-
rntuple_role_struct = 2
218-
rntuple_role_union = 3
217+
218+
class RNTupleLocatorType(IntEnum):
219+
STANDARD = 0x00
220+
LARGE = 0x01
221+
DAOS = 0x02
222+
223+
224+
class RNTupleEnvelopeType(IntEnum):
225+
RESERVED = 0x00
226+
HEADER = 0x01
227+
FOOTER = 0x02
228+
PAGELIST = 0x03
229+
230+
231+
class RNTupleFieldRole(IntEnum):
232+
LEAF = 0x00
233+
VECTOR = 0x01
234+
STRUCT = 0x02
235+
UNION = 0x03
236+
UNSPLIT = 0x04
237+
238+
239+
class RNTupleFieldFlag(IntEnum):
240+
REPETITIVE = 0x01
241+
PROJECTED = 0x02
242+
CHECKSUM = 0x04
243+
244+
245+
class RNTupleColumnFlag(IntEnum):
246+
DEFERRED = 0x08
247+
RANGE = 0x10
248+
249+
250+
class RNTupleExtraTypeIdentifier(IntEnum):
251+
ROOT = 0x00
252+
253+
254+
class RNTupleUserMetadataType(IntEnum):
255+
INT = 0x01
256+
BOOL = 0x02
257+
DOUBLE = 0x03
258+
STRING = 0x04
259+
260+
261+
class RNTupleClusterFlag(IntEnum):
262+
SHARDED = 0x01

0 commit comments

Comments
 (0)