Loading...
Searching...
No Matches
None.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_NONE_H_
4#define AWKWARD_NONE_H_
5
6#include <string>
7#include <memory>
8#include <vector>
9
10#include "awkward/common.h"
11#include "awkward/Slice.h"
12#include "awkward/Content.h"
13
14namespace awkward {
22 public:
25
29 bool
30 isscalar() const override;
31
33 const std::string
34 classname() const override;
35
37 void
38 setidentities() override;
39
41 void
42 setidentities(const IdentitiesPtr& identities) override;
43
45 const TypePtr
46 type(const util::TypeStrs& typestrs) const override;
47
49 const FormPtr
50 form(bool materialize) const override;
51
53 kernels() const override;
54
55 void
56 caches(std::vector<ArrayCachePtr>& out) const override;
57
58 const std::string
59 tostring_part(const std::string& indent,
60 const std::string& pre,
61 const std::string& post) const override;
62
63 void
64 tojson_part(ToJson& builder, bool include_beginendlist) const override;
65
67 void
68 nbytes_part(std::map<size_t, int64_t>& largest) const override;
69
71 int64_t
72 length() const override;
73
74 const ContentPtr
75 shallow_copy() const override;
76
77 const ContentPtr
78 deep_copy(bool copyarrays,
79 bool copyindexes,
80 bool copyidentities) const override;
81
82 void
83 check_for_iteration() const override;
84
86 const ContentPtr
87 getitem_nothing() const override;
88
90 const ContentPtr
91 getitem_at(int64_t at) const override;
92
94 const ContentPtr
95 getitem_at_nowrap(int64_t at) const override;
96
98 const ContentPtr
99 getitem_range(int64_t start, int64_t stop) const override;
100
102 const ContentPtr
103 getitem_range_nowrap(int64_t start, int64_t stop) const override;
104
106 const ContentPtr
107 getitem_field(const std::string& key) const override;
108
110 const ContentPtr
111 getitem_field(const std::string& key,
112 const Slice& only_fields) const override;
113
115 const ContentPtr
116 getitem_fields(const std::vector<std::string>& keys) const override;
117
119 const ContentPtr
120 getitem_fields(const std::vector<std::string>& keys,
121 const Slice& only_fields) const override;
122
124 const ContentPtr
125 carry(const Index64& carry, bool allow_lazy) const override;
126
128 int64_t
129 purelist_depth() const override;
130
132 const std::pair<int64_t, int64_t>
133 minmax_depth() const override;
134
136 const std::pair<bool, int64_t>
137 branch_depth() const override;
138
140 int64_t
141 numfields() const override;
142
144 int64_t
145 fieldindex(const std::string& key) const override;
146
148 const std::string
149 key(int64_t fieldindex) const override;
150
152 bool
153 haskey(const std::string& key) const override;
154
156 const std::vector<std::string>
157 keys() const override;
158
160 bool
161 istuple() const override;
162
163 // operations
164
166 const std::string
167 validityerror(const std::string& path) const override;
168
170 const ContentPtr
171 shallow_simplify() const override;
172
174 const ContentPtr
175 num(int64_t axis, int64_t depth) const override;
176
178 const std::pair<Index64, ContentPtr>
179 offsets_and_flattened(int64_t axis, int64_t depth) const override;
180
182 bool
183 mergeable(const ContentPtr& other, bool mergebool) const override;
184
186 bool
187 referentially_equal(const ContentPtr& other) const override;
188
190 const ContentPtr
191 mergemany(const ContentPtrVec& others) const override;
192
194 const SliceItemPtr
195 asslice() const override;
196
198 const ContentPtr
199 fillna(const ContentPtr& value) const override;
200
202 const ContentPtr
203 rpad(int64_t target, int64_t axis, int64_t depth) const override;
204
206 const ContentPtr
207 rpad_and_clip(int64_t target,
208 int64_t axis,
209 int64_t depth) const override;
210
212 const ContentPtr
213 reduce_next(const Reducer& reducer,
214 int64_t negaxis,
215 const Index64& starts,
216 const Index64& shifts,
217 const Index64& parents,
218 int64_t outlength,
219 bool mask,
220 bool keepdims) const override;
221
223 const ContentPtr
224 sort_next(int64_t negaxis,
225 const Index64& starts,
226 const Index64& parents,
227 int64_t outlength,
228 bool ascending,
229 bool stable) const override;
230
231 const ContentPtr
232 argsort_next(int64_t negaxis,
233 const Index64& starts,
234 const Index64& shifts,
235 const Index64& parents,
236 int64_t outlength,
237 bool ascending,
238 bool stable) const override;
239
241 const ContentPtr
242 localindex(int64_t axis, int64_t depth) const override;
243
245 const ContentPtr
246 combinations(int64_t n,
247 bool replacement,
248 const util::RecordLookupPtr& recordlookup,
249 const util::Parameters& parameters,
250 int64_t axis,
251 int64_t depth) const override;
252
254 const ContentPtr
256 const Slice& tail,
257 const Index64& advanced) const override;
258
260 const ContentPtr
262 const Slice& tail,
263 const Index64& advanced) const override;
264
266 const ContentPtr
268 const Slice& tail,
269 const Index64& advanced) const override;
270
272 const ContentPtr
274 const Slice& tail,
275 const Index64& advanced) const override;
276
278 const ContentPtr
280 const Slice& tail,
281 const Index64& advanced) const override;
282
284 const ContentPtr
286 const Slice& tail,
287 const Index64& advanced) const override;
288
290 const ContentPtr
291 getitem_next_jagged(const Index64& slicestarts,
292 const Index64& slicestops,
293 const SliceArray64& slicecontent,
294 const Slice& tail) const override;
295
297 const ContentPtr
298 getitem_next_jagged(const Index64& slicestarts,
299 const Index64& slicestops,
300 const SliceMissing64& slicecontent,
301 const Slice& tail) const override;
302
304 const ContentPtr
305 getitem_next_jagged(const Index64& slicestarts,
306 const Index64& slicestops,
307 const SliceJagged64& slicecontent,
308 const Slice& tail) const override;
309
310 const ContentPtr
311 copy_to(kernel::lib ptr_lib) const override;
312
313 const ContentPtr
314 numbers_to_type(const std::string& name) const override;
315
317 bool
318 is_unique() const override;
319
321 const ContentPtr
322 unique() const override;
323
325 bool
326 is_subrange_equal(const Index64& start, const Index64& stop) const override;
327
328 };
329
331 extern const ContentPtr none;
332}
333
334#endif // AWKWARD_NONE_H_
Abstract superclass of all array node types (flat hierarchy). Any Content can be nested within any ot...
Definition: Content.h:276
A contiguous, one-dimensional array of integers used to represent data structures,...
Definition: Index.h:82
Represents a scalar missing value, which is None in Python.
Definition: None.h:21
int64_t purelist_depth() const override
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.
void caches(std::vector< ArrayCachePtr > &out) const override
Accumulates all the unique #ArrayCache objects from nested #VirtualArray nodes. (Uniqueness is determ...
const ContentPtr getitem_fields(const std::vector< std::string > &keys) const override
const ContentPtr getitem_next_jagged(const Index64 &slicestarts, const Index64 &slicestops, const SliceArray64 &slicecontent, const Slice &tail) const override
const ContentPtr getitem_at(int64_t at) const override
void setidentities() override
const ContentPtr getitem_field(const std::string &key, const Slice &only_fields) const override
const ContentPtr getitem_next(const SliceArray64 &array, const Slice &tail, const Index64 &advanced) const override
const ContentPtr unique() const override
Returns an array where all components are unique.
const ContentPtr sort_next(int64_t negaxis, const Index64 &starts, const Index64 &parents, int64_t outlength, bool ascending, bool stable) const override
None()
Creates a None instance.
void tojson_part(ToJson &builder, bool include_beginendlist) const override
Internal function to produce a JSON representation one node at a time.
const ContentPtr getitem_fields(const std::vector< std::string > &keys, const Slice &only_fields) const override
int64_t length() const override
Always returns -1.
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...
const std::string validityerror(const std::string &path) const override
const ContentPtr getitem_next(const SliceAt &at, const Slice &tail, const Index64 &advanced) const override
bool istuple() const override
const ContentPtr getitem_next(const SliceField &field, const Slice &tail, const Index64 &advanced) const override
const ContentPtr getitem_nothing() const override
kernel::lib kernels() const override
Returns the kernel library enum for all nested ptr_lib within the array's tree structure....
const ContentPtr carry(const Index64 &carry, bool allow_lazy) const override
const ContentPtr combinations(int64_t n, bool replacement, const util::RecordLookupPtr &recordlookup, const util::Parameters &parameters, int64_t axis, int64_t depth) const override
void setidentities(const IdentitiesPtr &identities) override
bool isscalar() const override
Returns true if the data represented by this node is scalar, not a true array.
const ContentPtr localindex(int64_t axis, int64_t depth) const override
const ContentPtr getitem_range_nowrap(int64_t start, int64_t stop) const override
const std::pair< Index64, ContentPtr > offsets_and_flattened(int64_t axis, int64_t depth) const override
int64_t fieldindex(const std::string &key) const override
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...
const std::vector< std::string > keys() const override
const ContentPtr getitem_field(const std::string &key) const override
const std::pair< bool, int64_t > branch_depth() const override
const ContentPtr rpad(int64_t target, int64_t axis, int64_t depth) const override
const ContentPtr getitem_at_nowrap(int64_t at) const override
void nbytes_part(std::map< size_t, int64_t > &largest) const override
const ContentPtr mergemany(const ContentPtrVec &others) const override
const std::string key(int64_t fieldindex) const override
const ContentPtr shallow_copy() const override
Copies this node without copying any nodes hierarchically nested within it or any array/index/identit...
const std::pair< int64_t, int64_t > minmax_depth() const override
bool is_unique() const override
Returns 'true' if all components of the array are unique.
const FormPtr form(bool materialize) const override
const SliceItemPtr asslice() const override
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.
const ContentPtr rpad_and_clip(int64_t target, int64_t axis, int64_t depth) const override
const ContentPtr getitem_next(const SliceJagged64 &jagged, const Slice &tail, const Index64 &advanced) const override
const ContentPtr getitem_range(int64_t start, int64_t stop) const override
bool is_subrange_equal(const Index64 &start, const Index64 &stop) const override
Returns 'true' if subranges are equal.
const ContentPtr fillna(const ContentPtr &value) const override
int64_t numfields() const override
bool referentially_equal(const ContentPtr &other) const override
const TypePtr type(const util::TypeStrs &typestrs) const override
const ContentPtr num(int64_t axis, int64_t depth) const override
const ContentPtr getitem_next(const SliceFields &fields, const Slice &tail, const Index64 &advanced) const override
bool mergeable(const ContentPtr &other, bool mergebool) const override
bool haskey(const std::string &key) const override
const ContentPtr getitem_next_jagged(const Index64 &slicestarts, const Index64 &slicestops, const SliceJagged64 &slicecontent, const Slice &tail) const override
const ContentPtr getitem_next_jagged(const Index64 &slicestarts, const Index64 &slicestops, const SliceMissing64 &slicecontent, const Slice &tail) const override
const ContentPtr getitem_next(const SliceRange &range, const Slice &tail, const Index64 &advanced) const override
const ContentPtr shallow_simplify() const override
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
const ContentPtr numbers_to_type(const std::string &name) const override
Change the leaf types to 'totype'.
const std::string classname() const override
User-friendly name of this class: "None".
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...
Abstract class for all reducer algorithms.
Definition: Reducer.h:20
Represents an array of integers in a slice (possibly converted from an array of booleans).
Definition: Slice.h:229
Represents an integer in a tuple of slices passed to __getitem__ in Python.
Definition: Slice.h:58
Represents a single string in a slice tuple, indicating that a RecordArray should be replaced by one ...
Definition: Slice.h:340
Definition: Slice.h:384
Represents an array of nested lists, where the content may be SliceArrayOf, SliceMissingOf,...
Definition: Slice.h:515
Represents a SliceArrayOf, SliceMissingOf, or SliceJaggedOf with missing values: None (no equivalent ...
Definition: Slice.h:435
Represents a Python slice object (usual syntax: array[start:stop:step]).
Definition: Slice.h:93
A sequence of SliceItem objects representing a tuple passed to Python's __getitem__.
Definition: Slice.h:585
Definition: json.h:21
#define LIBAWKWARD_EXPORT_SYMBOL
Definition: common.h:45
lib
Definition: kernel-dispatch.h:20
std::map< std::string, std::string > Parameters
Definition: util.h:165
std::shared_ptr< RecordLookup > RecordLookupPtr
Definition: util.h:130
std::map< std::string, std::string > TypeStrs
Definition: util.h:215
Definition: BitMaskedArray.h:15
std::vector< std::shared_ptr< Content > > ContentPtrVec
Definition: Content.h:16
const ContentPtr none
A constant value with type None.
std::shared_ptr< SliceItem > SliceItemPtr
Definition: Slice.h:15
std::shared_ptr< Content > ContentPtr
Definition: Content.h:15
std::shared_ptr< Form > FormPtr
Definition: Content.h:18
std::shared_ptr< Type > TypePtr
Definition: Content.h:23
std::shared_ptr< Identities > IdentitiesPtr
Definition: Identities.h:16