|
5 | 5 | """ |
6 | 6 | from __future__ import annotations |
7 | 7 |
|
8 | | -import struct |
| 8 | +from enum import IntEnum |
9 | 9 |
|
10 | 10 | import numpy |
11 | 11 |
|
|
118 | 118 | kStreamedMemberWise = numpy.uint16(1 << 14) |
119 | 119 |
|
120 | 120 | ############ 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 |
123 | 121 | rntuple_col_num_to_dtype_dict = { |
124 | 122 | 1: "uint64", |
125 | 123 | 2: "uint32", |
|
149 | 147 | 26: "int64", # split + zigzag encoding |
150 | 148 | 27: "int32", # split + zigzag encoding |
151 | 149 | 28: "int16", # split + zigzag encoding |
| 150 | + 29: "float32trunc", |
| 151 | + 30: "float32quant", |
152 | 152 | } |
153 | 153 | rntuple_col_num_to_size_dict = { |
154 | 154 | 1: 64, |
|
179 | 179 | 26: 64, # split + zigzag encoding |
180 | 180 | 27: 32, # split + zigzag encoding |
181 | 181 | 28: 16, # split + zigzag encoding |
| 182 | + 29: 32, # TODO: variable size |
| 183 | + 30: 32, # TODO: variable size |
182 | 184 | } |
183 | 185 |
|
184 | 186 | rntuple_col_type_to_num_dict = { |
|
212 | 214 | "splitzigzagint16": 28, |
213 | 215 | } |
214 | 216 |
|
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