Awkward Array: include/awkward/array/RecordArray.h Source File

Loading...
Searching...
No Matches
RecordArray.h
Go to the documentation of this file.
1// BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
2
3#ifndef AWKWARD_RECORDARRAY_H_
4#define AWKWARD_RECORDARRAY_H_
5
6#include <memory>
7#include <string>
8#include <unordered_map>
9
10#include "awkward/common.h"
11#include "awkward/Identities.h"
12#include "awkward/Content.h"
13
14namespace awkward {
18 class LIBAWKWARD_EXPORT_SYMBOL RecordForm: public Form {
19 public:
22 RecordForm(bool has_identities,
23 const util::Parameters& parameters,
24 const FormKey& form_key,
25 const util::RecordLookupPtr& recordlookup,
26 const std::vector<FormPtr>& contents);
27
28 const util::RecordLookupPtr
29 recordlookup() const;
30
31 const std::vector<FormPtr>
32 contents() const;
33
34 bool
35 istuple() const override;
36
37 const FormPtr
38 content(int64_t fieldindex) const;
39
40 const FormPtr
41 content(const std::string& key) const;
42
43 const std::vector<std::pair<std::string, FormPtr>>
44 items() const;
45
46 const TypePtr
47 type(const util::TypeStrs& typestrs) const override;
48
49 void
50 tojson_part(ToJson& builder, bool verbose) const override;
51
52 const FormPtr
53 shallow_copy() const override;
54
55 const FormPtr
56 with_form_key(const FormKey& form_key) const override;
57
58 const std::string
59 purelist_parameter(const std::string& key) const override;
60
61 bool
62 purelist_isregular() const override;
63
64 int64_t
65 purelist_depth() const override;
66
67 bool
68 dimension_optiontype() const override;
69
70 const std::pair<int64_t, int64_t>
71 minmax_depth() const override;
72
73 const std::pair<bool, int64_t>
74 branch_depth() const override;
75
76 int64_t
77 numfields() const override;
78
79 int64_t
80 fieldindex(const std::string& key) const override;
81
82 const std::string
83 key(int64_t fieldindex) const override;
84
85 bool
86 haskey(const std::string& key) const override;
87
88 const std::vector<std::string>
89 keys() const override;
90
91 bool
92 equal(const FormPtr& other,
93 bool check_identities,
94 bool check_parameters,
95 bool check_form_key,
96 bool compatibility_check) const override;
97
98 const FormPtr
99 getitem_field(const std::string& key) const override;
100
101 const FormPtr
102 getitem_fields(const std::vector<std::string>& keys) const override;
103
104 private:
105 const util::RecordLookupPtr recordlookup_;
106 const std::vector<FormPtr> contents_;
107 };
108
122 class LIBAWKWARD_EXPORT_SYMBOL RecordArray:
123 public Content,
124 public std::enable_shared_from_this<RecordArray> {
125 public:
144 RecordArray(const IdentitiesPtr& identities,
145 const util::Parameters& parameters,
146 const ContentPtrVec& contents,
147 const util::RecordLookupPtr& recordlookup,
148 int64_t length,
149 const std::vector<ArrayCachePtr>& caches);
150
153 RecordArray(const IdentitiesPtr& identities,
154 const util::Parameters& parameters,
155 const ContentPtrVec& contents,
156 const util::RecordLookupPtr& recordlookup,
157 int64_t length);
158
161 RecordArray(const IdentitiesPtr& identities,
162 const util::Parameters& parameters,
163 const ContentPtrVec& contents,
164 const util::RecordLookupPtr& recordlookup);
165
168 const ContentPtrVec
169 contents() const;
170
175 const util::RecordLookupPtr
176 recordlookup() const;
177
179 bool
180 istuple() const override;
181
187 const ContentPtr
188 setitem_field(int64_t where, const ContentPtr& what) const;
189
195 const ContentPtr
196 setitem_field(const std::string& where, const ContentPtr& what) const;
197
199 const std::string
200 classname() const override;
201
202 void
203 setidentities() override;
204
205 void
206 setidentities(const IdentitiesPtr& identities) override;
207
208 const FormPtr
209 form(bool materialize) const override;
210
211 kernel::lib
212 kernels() const override;
213
214 void
215 caches(std::vector<ArrayCachePtr>& out) const override;
216
217 const std::string
218 tostring_part(const std::string& indent,
219 const std::string& pre,
220 const std::string& post) const override;
221
222 const TypePtr
223 type(const util::TypeStrs& typestrs) const override;
224
225 void
226 tojson_part(ToJson& builder, bool include_beginendlist) const override;
227
228 void
229 nbytes_part(std::map<size_t, int64_t>& largest) const override;
230
234 int64_t
235 length() const override;
236
237 const ContentPtr
238 shallow_copy() const override;
239
240 const ContentPtr
241 deep_copy(bool copyarrays,
242 bool copyindexes,
243 bool copyidentities) const override;
244
245 void
246 check_for_iteration() const override;
247
248 const ContentPtr
249 getitem_nothing() const override;
250
251 const ContentPtr
252 getitem_at(int64_t at) const override;
253
254 const ContentPtr
255 getitem_at_nowrap(int64_t at) const override;
256
257 const ContentPtr
258 getitem_range(int64_t start, int64_t stop) const override;
259
260 const ContentPtr
261 getitem_range_nowrap(int64_t start, int64_t stop) const override;
262
263 const ContentPtr
264 getitem_field(const std::string& key) const override;
265
266 const ContentPtr
267 getitem_field(const std::string& key,
268 const Slice& only_fields) const override;
269
270 const ContentPtr
271 getitem_fields(const std::vector<std::string>& keys) const override;
272
273 const ContentPtr
274 getitem_fields(const std::vector<std::string>& keys,
275 const Slice& only_fields) const override;
276
277 const ContentPtr
278 getitem_next(const SliceItemPtr& head,
279 const Slice& tail,
280 const Index64& advanced) const override;
281
282 const ContentPtr
283 carry(const Index64& carry, bool allow_lazy) const override;
284
285 int64_t
286 purelist_depth() const override;
287
288 const std::pair<int64_t, int64_t>
289 minmax_depth() const override;
290
291 const std::pair<bool, int64_t>
292 branch_depth() const override;
293
294 int64_t
295 numfields() const override;
296
297 int64_t
298 fieldindex(const std::string& key) const override;
299
300 const std::string
301 key(int64_t fieldindex) const override;
302
303 bool
304 haskey(const std::string& key) const override;
305
306 const std::vector<std::string>
307 keys() const override;
308
309 // operations
310 const std::string
311 validityerror(const std::string& path) const override;
312
316 const ContentPtr
317 shallow_simplify() const override;
318
319 const ContentPtr
320 num(int64_t axis, int64_t depth) const override;
321
322 const std::pair<Index64, ContentPtr>
323 offsets_and_flattened(int64_t axis, int64_t depth) const override;
324
325 bool
326 mergeable(const ContentPtr& other, bool mergebool) const override;
327
328 bool
329 referentially_equal(const ContentPtr& other) const override;
330
331 const ContentPtr
332 mergemany(const ContentPtrVec& others) const override;
333
334 const SliceItemPtr
335 asslice() const override;
336
337 const ContentPtr
338 fillna(const ContentPtr& value) const override;
339
340 const ContentPtr
341 rpad(int64_t target, int64_t axis, int64_t depth) const override;
342
343 const ContentPtr
344 rpad_and_clip(int64_t target,
345 int64_t axis,
346 int64_t depth) const override;
347
348 const ContentPtr
349 reduce_next(const Reducer& reducer,
350 int64_t negaxis,
351 const Index64& starts,
352 const Index64& shifts,
353 const Index64& parents,
354 int64_t outlength,
355 bool mask,
356 bool keepdims) const override;
357
358 const ContentPtr
359 sort_next(int64_t negaxis,
360 const Index64& starts,
361 const Index64& parents,
362 int64_t outlength,
363 bool ascending,
364 bool stable) const override;
365
366 const ContentPtr
367 argsort_next(int64_t negaxis,
368 const Index64& starts,
369 const Index64& shifts,
370 const Index64& parents,
371 int64_t outlength,
372 bool ascending,
373 bool stable) const override;
374
375 const ContentPtr
376 localindex(int64_t axis, int64_t depth) const override;
377
378 const ContentPtr
379 combinations(int64_t n,
380 bool replacement,
381 const util::RecordLookupPtr& recordlookup,
382 const util::Parameters& parameters,
383 int64_t axis,
384 int64_t depth) const override;
385
390 const ContentPtr
391 field(int64_t fieldindex) const;
392
397 const ContentPtr
398 field(const std::string& key) const;
399
404 const ContentPtrVec
405 fields() const;
406
409 const std::vector<std::pair<std::string, ContentPtr>>
410 fielditems() const;
411
414 const std::shared_ptr<RecordArray>
415 astuple() const;
416
417 const ContentPtr
418 getitem_next(const SliceAt& at,
419 const Slice& tail,
420 const Index64& advanced) const override;
421
422 const ContentPtr
423 getitem_next(const SliceRange& range,
424 const Slice& tail,
425 const Index64& advanced) const override;
426
427 const ContentPtr
428 getitem_next(const SliceArray64& array,
429 const Slice& tail,
430 const Index64& advanced) const override;
431
432 const ContentPtr
433 getitem_next(const SliceField& field,
434 const Slice& tail,
435 const Index64& advanced) const override;
436
437 const ContentPtr
438 getitem_next(const SliceFields& fields,
439 const Slice& tail,
440 const Index64& advanced) const override;
441
442 const ContentPtr
443 getitem_next(const SliceJagged64& jagged,
444 const Slice& tail,
445 const Index64& advanced) const override;
446
447 const ContentPtr
448 getitem_next_jagged(const Index64& slicestarts,
449 const Index64& slicestops,
450 const SliceArray64& slicecontent,
451 const Slice& tail) const override;
452
453 const ContentPtr
454 getitem_next_jagged(const Index64& slicestarts,
455 const Index64& slicestops,
456 const SliceMissing64& slicecontent,
457 const Slice& tail) const override;
458
459 const ContentPtr
460 getitem_next_jagged(const Index64& slicestarts,
461 const Index64& slicestops,
462 const SliceJagged64& slicecontent,
463 const Slice& tail) const override;
464
465 const ContentPtr
466 copy_to(kernel::lib ptr_lib) const override;
467
468 const ContentPtr
469 numbers_to_type(const std::string& name) const override;
470
472 bool
473 is_unique() const override;
474
476 const ContentPtr
477 unique() const override;
478
480 bool
481 is_subrange_equal(const Index64& start, const Index64& stop) const override;
482
483 protected:
484 template <typename S>
485 const ContentPtr
486 getitem_next_jagged_generic(const Index64& slicestarts,
487 const Index64& slicestops,
488 const S& slicecontent,
489 const Slice& tail) const;
490
491 private:
493 const ContentPtrVec contents_;
495 const util::RecordLookupPtr recordlookup_;
497 int64_t length_;
499 const std::vector<ArrayCachePtr> caches_;
500 };
501}
502
503#endif // AWKWARD_RECORDARRAY_H_
Content.h
Identities.h
awkward::Content
Abstract superclass of all array node types (flat hierarchy). Any Content can be nested within any ot...
Definition: Content.h:276
awkward::Form
Abstract superclass of all array node forms, which expresses the nesting structure without any large ...
Definition: Content.h:39
awkward::IndexOf
A contiguous, one-dimensional array of integers used to represent data structures,...
Definition: Index.h:82
awkward::RecordArray
Represents an array of tuples or records, in which a tuple has a fixed number of differently typed fi...
Definition: RecordArray.h:124
awkward::RecordArray::purelist_depth
int64_t purelist_depth() const override
The list-depth of this array, not counting any contained within a RecordArray.
awkward::RecordArray::argsort_next
const ContentPtr argsort_next(int64_t negaxis, const Index64 &starts, const Index64 &shifts, const Index64 &parents, int64_t outlength, bool ascending, bool stable) const override
This array sorted indices.
awkward::RecordArray::caches
void caches(std::vector< ArrayCachePtr > &out) const override
Accumulates all the unique #ArrayCache objects from nested #VirtualArray nodes. (Uniqueness is determ...
awkward::RecordArray::getitem_fields
const ContentPtr getitem_fields(const std::vector< std::string > &keys) const override
This array with the first nested RecordArray replaced by a RecordArray of a given subset of keys.
awkward::RecordArray::getitem_next_jagged
const ContentPtr getitem_next_jagged(const Index64 &slicestarts, const Index64 &slicestops, const SliceArray64 &slicecontent, const Slice &tail) const override
Internal function that propagates a jagged array (array with irregular-length dimensions) slice throu...
awkward::RecordArray::getitem_at
const ContentPtr getitem_at(int64_t at) const override
Returns the element at a given position in the array, handling negative indexing and bounds-checking ...
awkward::RecordArray::setidentities
void setidentities() override
Assign a surrogate index of Identities to this array (in-place).
awkward::RecordArray::getitem_field
const ContentPtr getitem_field(const std::string &key, const Slice &only_fields) const override
awkward::RecordArray::getitem_next
const ContentPtr getitem_next(const SliceArray64 &array, const Slice &tail, const Index64 &advanced) const override
Internal function that propagates a generic getitem request through one axis (including advanced inde...
awkward::RecordArray::unique
const ContentPtr unique() const override
Returns an array where all components are unique.
awkward::RecordArray::sort_next
const ContentPtr sort_next(int64_t negaxis, const Index64 &starts, const Index64 &parents, int64_t outlength, bool ascending, bool stable) const override
This array sorted.
awkward::RecordArray::tojson_part
void tojson_part(ToJson &builder, bool include_beginendlist) const override
Internal function to produce a JSON representation one node at a time.
awkward::RecordArray::getitem_fields
const ContentPtr getitem_fields(const std::vector< std::string > &keys, const Slice &only_fields) const override
awkward::RecordArray::length
int64_t length() const override
The number of elements in the array.
awkward::RecordArray::deep_copy
const ContentPtr deep_copy(bool copyarrays, bool copyindexes, bool copyidentities) const override
Copies this node and all nodes hierarchically nested within it, optionally copying the associated arr...
awkward::RecordArray::validityerror
const std::string validityerror(const std::string &path) const override
Returns an error message if this array is invalid; otherwise, returns an empty string.
awkward::RecordArray::getitem_next
const ContentPtr getitem_next(const SliceAt &at, const Slice &tail, const Index64 &advanced) const override
Internal function that propagates a generic getitem request through one axis (including advanced inde...
awkward::RecordArray::istuple
bool istuple() const override
Returns true if recordlookup is nullptr; false otherwise.
awkward::RecordArray::getitem_next
const ContentPtr getitem_next(const SliceField &field, const Slice &tail, const Index64 &advanced) const override
Internal function that propagates a generic getitem request through one axis (including advanced inde...
awkward::RecordArray::getitem_nothing
const ContentPtr getitem_nothing() const override
Internal function to get an empty slice (with the correct type).
awkward::RecordArray::kernels
kernel::lib kernels() const override
Returns the kernel library enum for all nested ptr_lib within the array's tree structure....
awkward::RecordArray::fields
const ContentPtrVec fields() const
Returns all the fields (without trimming them to have the same length as this RecordArray).
awkward::RecordArray::carry
const ContentPtr carry(const Index64 &carry, bool allow_lazy) const override
Returns an array of the same type with elements filtered, rearranged, and possibly duplicated by the ...
awkward::RecordArray::combinations
const ContentPtr combinations(int64_t n, bool replacement, const util::RecordLookupPtr &recordlookup, const util::Parameters &parameters, int64_t axis, int64_t depth) const override
Tuples or records of all n-tuple combinations of list items at some axis depth.
awkward::RecordArray::setidentities
void setidentities(const IdentitiesPtr &identities) override
Assign a specified set of Identities to this array (in-place).
awkward::RecordArray::localindex
const ContentPtr localindex(int64_t axis, int64_t depth) const override
A (possibly nested) array of integers indicating the positions of elements within each nested list.
awkward::RecordArray::getitem_range_nowrap
const ContentPtr getitem_range_nowrap(int64_t start, int64_t stop) const override
Subinterval of this array, without handling negative indexing or bounds-checking.
awkward::RecordArray::recordlookup
const util::RecordLookupPtr recordlookup() const
A std::shared_ptr<std::vector<std::string>> optional list of key names. If absent (nullptr),...
awkward::RecordArray::offsets_and_flattened
const std::pair< Index64, ContentPtr > offsets_and_flattened(int64_t axis, int64_t depth) const override
Returns (a) an offsets Index and (b) a flattened version of the array at some axis depth.
awkward::RecordArray::fieldindex
int64_t fieldindex(const std::string &key) const override
The position of a tuple or record key name if this array contains a RecordArray.
awkward::RecordArray::check_for_iteration
void check_for_iteration() const override
Performs up-front validity checks on an array so that they don't have to be checked in getitem_at_now...
awkward::RecordArray::field
const ContentPtr field(int64_t fieldindex) const
Returns the field at a given index (without trimming it to have the same length as this RecordArray).
awkward::RecordArray::keys
const std::vector< std::string > keys() const override
A list of RecordArray keys or an empty list if this array does not contain a RecordArray.
awkward::RecordArray::getitem_next_jagged_generic
const ContentPtr getitem_next_jagged_generic(const Index64 &slicestarts, const Index64 &slicestops, const S &slicecontent, const Slice &tail) const
awkward::RecordArray::getitem_field
const ContentPtr getitem_field(const std::string &key) const override
This array with the first nested RecordArray replaced by the field at key.
awkward::RecordArray::branch_depth
const std::pair< bool, int64_t > branch_depth() const override
Returns (a) whether the list-depth of this array "branches," or differs when followed through differe...
awkward::RecordArray::rpad
const ContentPtr rpad(int64_t target, int64_t axis, int64_t depth) const override
If axis = 0, returns a view of this array padded on the right with None values to have a minimum leng...
awkward::RecordArray::getitem_next
const ContentPtr getitem_next(const SliceItemPtr &head, const Slice &tail, const Index64 &advanced) const override
Internal function that propagates a generic getitem request through one axis (including advanced inde...
awkward::RecordArray::getitem_at_nowrap
const ContentPtr getitem_at_nowrap(int64_t at) const override
Returns the element at a given position in the array, without handling negative indexing or bounds-ch...
awkward::RecordArray::field
const ContentPtr field(const std::string &key) const
Returns the field with a given key name (without trimming it to have the same length as this RecordAr...
awkward::RecordArray::nbytes_part
void nbytes_part(std::map< size_t, int64_t > &largest) const override
Internal function used to calculate nbytes.
awkward::RecordArray::mergemany
const ContentPtr mergemany(const ContentPtrVec &others) const override
Returns an array with this and the others concatenated (in order, this first, others last).
awkward::RecordArray::key
const std::string key(int64_t fieldindex) const override
The record name associated with a given field index or the tuple index as a string (e....
awkward::RecordArray::shallow_copy
const ContentPtr shallow_copy() const override
Copies this node without copying any nodes hierarchically nested within it or any array/index/identit...
awkward::RecordArray::minmax_depth
const std::pair< int64_t, int64_t > minmax_depth() const override
Returns (a) the minimum list-depth and (b) the maximum list-depth of the array, which can differ if t...
awkward::RecordArray::is_unique
bool is_unique() const override
Returns 'true' if all components of the array are unique.
awkward::RecordArray::RecordArray
RecordArray(const IdentitiesPtr &identities, const util::Parameters &parameters, const ContentPtrVec &contents, const util::RecordLookupPtr &recordlookup, int64_t length)
Creates a RecordArray in which caches is derived from the contents.
awkward::RecordArray::form
const FormPtr form(bool materialize) const override
Low-level Form describing all the features of this array except the actual data buffers (Index,...
awkward::RecordArray::asslice
const SliceItemPtr asslice() const override
Converts this array into a SliceItem that can be used in getitem.
awkward::RecordArray::tostring_part
const std::string tostring_part(const std::string &indent, const std::string &pre, const std::string &post) const override
Internal function to build an output string for tostring.
awkward::RecordArray::rpad_and_clip
const ContentPtr rpad_and_clip(int64_t target, int64_t axis, int64_t depth) const override
If axis = 0, returns a view of this array padded on the right.
awkward::RecordArray::getitem_next
const ContentPtr getitem_next(const SliceJagged64 &jagged, const Slice &tail, const Index64 &advanced) const override
Internal function that propagates a generic getitem request through one axis (including advanced inde...
awkward::RecordArray::setitem_field
const ContentPtr setitem_field(int64_t where, const ContentPtr &what) const
Returns a RecordArray with an additional or a replaced field at index where with value what.
awkward::RecordArray::getitem_range
const ContentPtr getitem_range(int64_t start, int64_t stop) const override
Subinterval of this array, handling negative indexing and bounds-checking like Python.
awkward::RecordArray::is_subrange_equal
bool is_subrange_equal(const Index64 &start, const Index64 &stop) const override
Returns 'true' if subranges are equal.
awkward::RecordArray::fillna
const ContentPtr fillna(const ContentPtr &value) const override
Returns this array with None values replaced by a given value.
awkward::RecordArray::numfields
int64_t numfields() const override
The number of fields in the first nested tuple or records or -1 if this array does not contain a Reco...
awkward::RecordArray::referentially_equal
bool referentially_equal(const ContentPtr &other) const override
Returns true if this array has all the same buffers and parameters as other; false otherwise.
awkward::RecordArray::type
const TypePtr type(const util::TypeStrs &typestrs) const override
High-level Type describing this array.
awkward::RecordArray::num
const ContentPtr num(int64_t axis, int64_t depth) const override
The length of this array (as a NumpyArray scalar) if axis = 0 or the lengths of subarrays (as an arra...
awkward::RecordArray::getitem_next
const ContentPtr getitem_next(const SliceFields &fields, const Slice &tail, const Index64 &advanced) const override
Internal function that propagates a generic getitem request through one axis (including advanced inde...
awkward::RecordArray::mergeable
bool mergeable(const ContentPtr &other, bool mergebool) const override
Returns true if this array can be merged with the other; false otherwise.
awkward::RecordArray::haskey
bool haskey(const std::string &key) const override
Returns true if the array contains a RecordArray with the specified key; false otherwise.
awkward::RecordArray::getitem_next_jagged
const ContentPtr getitem_next_jagged(const Index64 &slicestarts, const Index64 &slicestops, const SliceJagged64 &slicecontent, const Slice &tail) const override
Internal function that propagates a jagged array (array with irregular-length dimensions) slice throu...
awkward::RecordArray::getitem_next_jagged
const ContentPtr getitem_next_jagged(const Index64 &slicestarts, const Index64 &slicestops, const SliceMissing64 &slicecontent, const Slice &tail) const override
Internal function that propagates a jagged array (array with irregular-length dimensions) slice throu...
awkward::RecordArray::getitem_next
const ContentPtr getitem_next(const SliceRange &range, const Slice &tail, const Index64 &advanced) const override
Internal function that propagates a generic getitem request through one axis (including advanced inde...
awkward::RecordArray::shallow_simplify
const ContentPtr shallow_simplify() const override
Returns an equivalent array simplified at one level only using simplify_optiontype if an option-type ...
awkward::RecordArray::reduce_next
const ContentPtr reduce_next(const Reducer &reducer, int64_t negaxis, const Index64 &starts, const Index64 &shifts, const Index64 &parents, int64_t outlength, bool mask, bool keepdims) const override
This array with one axis removed by applying a Reducer (e.g. "sum", "max", "any", "all).
awkward::RecordArray::RecordArray
RecordArray(const IdentitiesPtr &identities, const util::Parameters &parameters, const ContentPtrVec &contents, const util::RecordLookupPtr &recordlookup, int64_t length, const std::vector< ArrayCachePtr > &caches)
Creates a RecordArray from a full set of parameters.
awkward::RecordArray::astuple
const std::shared_ptr< RecordArray > astuple() const
Returns this RecordArray without recordlookup, converting any records into tuples.
awkward::RecordArray::contents
const ContentPtrVec contents() const
std::vector of Content instances representing the (ordered) fields.
awkward::RecordArray::numbers_to_type
const ContentPtr numbers_to_type(const std::string &name) const override
Change the leaf types to 'totype'.
awkward::RecordArray::RecordArray
RecordArray(const IdentitiesPtr &identities, const util::Parameters &parameters, const ContentPtrVec &contents, const util::RecordLookupPtr &recordlookup)
Creates a RecordArray in which length is the minimum length of the contents or zero if there are no c...
awkward::RecordArray::classname
const std::string classname() const override
User-friendly name of this class: "RecordArray".
awkward::RecordArray::copy_to
const ContentPtr copy_to(kernel::lib ptr_lib) const override
Recursively copies components of the array from main memory to a GPU (if ptr_lib == kernel::lib::cuda...
awkward::RecordArray::setitem_field
const ContentPtr setitem_field(const std::string &where, const ContentPtr &what) const
Returns a RecordArray with an additional or a replaced field at key name where with value what.
awkward::RecordArray::fielditems
const std::vector< std::pair< std::string, ContentPtr > > fielditems() const
Returns key, field pairs for all fields (without trimming them to have the same length as this Record...
awkward::RecordForm
Form describing RecordArray (not a Record).
Definition: RecordArray.h:18
awkward::RecordForm::purelist_depth
int64_t purelist_depth() const override
The list-depth of this array, not counting any contained within a RecordForm.
awkward::RecordForm::with_form_key
const FormPtr with_form_key(const FormKey &form_key) const override
Copies this node, adding or replacing a form_key.
awkward::RecordForm::items
const std::vector< std::pair< std::string, FormPtr > > items() const
awkward::RecordForm::equal
bool equal(const FormPtr &other, bool check_identities, bool check_parameters, bool check_form_key, bool compatibility_check) const override
Returns true if this Form is equal to the other Form; false otherwise.
awkward::RecordForm::istuple
bool istuple() const override
Returns true if the outermost RecordArray is a tuple.
awkward::RecordForm::shallow_copy
const FormPtr shallow_copy() const override
Copies this node without copying any nodes hierarchically nested within it.
awkward::RecordForm::contents
const std::vector< FormPtr > contents() const
awkward::RecordForm::tojson_part
void tojson_part(ToJson &builder, bool verbose) const override
Internal function to produce a JSON representation one node at a time.
awkward::RecordForm::recordlookup
const util::RecordLookupPtr recordlookup() const
awkward::RecordForm::getitem_fields
const FormPtr getitem_fields(const std::vector< std::string > &keys) const override
Returns the Form that would result from a fields-slice.
awkward::RecordForm::fieldindex
int64_t fieldindex(const std::string &key) const override
The position of a tuple or record key name if this array contains a RecordForm.
awkward::RecordForm::keys
const std::vector< std::string > keys() const override
A list of RecordArray keys or an empty list if this array does not contain a RecordArray.
awkward::RecordForm::branch_depth
const std::pair< bool, int64_t > branch_depth() const override
Returns (a) whether the list-depth of this array "branches," or differs when followed through differe...
awkward::RecordForm::key
const std::string key(int64_t fieldindex) const override
The record name associated with a given field index or the tuple index as a string (e....
awkward::RecordForm::minmax_depth
const std::pair< int64_t, int64_t > minmax_depth() const override
Returns (a) the minimum list-depth and (b) the maximum list-depth of the array, which can differ if t...
awkward::RecordForm::getitem_field
const FormPtr getitem_field(const std::string &key) const override
Returns the Form that would result from a field-slice.
awkward::RecordForm::numfields
int64_t numfields() const override
The number of fields in the first nested tuple or records or -1 if this array does not contain a Reco...
awkward::RecordForm::type
const TypePtr type(const util::TypeStrs &typestrs) const override
High-level Type describing this Form.
awkward::RecordForm::purelist_parameter
const std::string purelist_parameter(const std::string &key) const override
The parameter associated with key at the first level that has a non-null value, descending only as de...
awkward::RecordForm::haskey
bool haskey(const std::string &key) const override
Returns true if the array contains a RecordForm with the specified key; false otherwise.
awkward::RecordForm::content
const FormPtr content(const std::string &key) const
awkward::RecordForm::content
const FormPtr content(int64_t fieldindex) const
awkward::RecordForm::purelist_isregular
bool purelist_isregular() const override
Returns true if all nested lists down to the first RecordForm are RegularForm nodes; false otherwise.
awkward::RecordForm::dimension_optiontype
bool dimension_optiontype() const override
Returns true if this dimension has option-type; false otherwise.
awkward::RecordForm::RecordForm
RecordForm(bool has_identities, const util::Parameters &parameters, const FormKey &form_key, const util::RecordLookupPtr &recordlookup, const std::vector< FormPtr > &contents)
Creates a RecordForm. See RecordArray (not Record) for documentation.
awkward::Reducer
Abstract class for all reducer algorithms.
Definition: Reducer.h:20
awkward::SliceArrayOf
Represents an array of integers in a slice (possibly converted from an array of booleans).
Definition: Slice.h:229
awkward::SliceAt
Represents an integer in a tuple of slices passed to __getitem__ in Python.
Definition: Slice.h:58
awkward::SliceField
Represents a single string in a slice tuple, indicating that a RecordArray should be replaced by one ...
Definition: Slice.h:340
awkward::SliceFields
Definition: Slice.h:384
awkward::SliceJaggedOf
Represents an array of nested lists, where the content may be SliceArrayOf, SliceMissingOf,...
Definition: Slice.h:515
awkward::SliceMissingOf
Represents a SliceArrayOf, SliceMissingOf, or SliceJaggedOf with missing values: None (no equivalent ...
Definition: Slice.h:435
awkward::SliceRange
Represents a Python slice object (usual syntax: array[start:stop:step]).
Definition: Slice.h:93
awkward::Slice
A sequence of SliceItem objects representing a tuple passed to Python's __getitem__.
Definition: Slice.h:585
awkward::ToJson
Definition: json.h:21
common.h
LIBAWKWARD_EXPORT_SYMBOL
#define LIBAWKWARD_EXPORT_SYMBOL
Definition: common.h:45
awkward::kernel::lib
lib
Definition: kernel-dispatch.h:20
awkward::util::Parameters
std::map< std::string, std::string > Parameters
Definition: util.h:165
awkward::util::RecordLookupPtr
std::shared_ptr< RecordLookup > RecordLookupPtr
Definition: util.h:130
awkward::util::TypeStrs
std::map< std::string, std::string > TypeStrs
Definition: util.h:215
awkward
Definition: BitMaskedArray.h:15
awkward::FormKey
std::shared_ptr< std::string > FormKey
Definition: Content.h:19
awkward::ContentPtrVec
std::vector< std::shared_ptr< Content > > ContentPtrVec
Definition: Content.h:16
awkward::SliceItemPtr
std::shared_ptr< SliceItem > SliceItemPtr
Definition: Slice.h:15
awkward::ContentPtr
std::shared_ptr< Content > ContentPtr
Definition: Content.h:15
awkward::FormPtr
std::shared_ptr< Form > FormPtr
Definition: Content.h:18
awkward::TypePtr
std::shared_ptr< Type > TypePtr
Definition: Content.h:23
awkward::IdentitiesPtr
std::shared_ptr< Identities > IdentitiesPtr
Definition: Identities.h:16