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

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 {
21 class LIBAWKWARD_EXPORT_SYMBOL None: public Content {
22 public:
24 None();
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
52 kernel::lib
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
255 getitem_next(const SliceAt& at,
256 const Slice& tail,
257 const Index64& advanced) const override;
258
260 const ContentPtr
261 getitem_next(const SliceRange& range,
262 const Slice& tail,
263 const Index64& advanced) const override;
264
266 const ContentPtr
267 getitem_next(const SliceArray64& array,
268 const Slice& tail,
269 const Index64& advanced) const override;
270
272 const ContentPtr
273 getitem_next(const SliceField& field,
274 const Slice& tail,
275 const Index64& advanced) const override;
276
278 const ContentPtr
279 getitem_next(const SliceFields& fields,
280 const Slice& tail,
281 const Index64& advanced) const override;
282
284 const ContentPtr
285 getitem_next(const SliceJagged64& jagged,
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_
Content.h
Slice.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::IndexOf
A contiguous, one-dimensional array of integers used to represent data structures,...
Definition: Index.h:82
awkward::None
Represents a scalar missing value, which is None in Python.
Definition: None.h:21
awkward::None::purelist_depth
int64_t purelist_depth() const override
awkward::None::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::None::caches
void caches(std::vector< ArrayCachePtr > &out) const override
Accumulates all the unique #ArrayCache objects from nested #VirtualArray nodes. (Uniqueness is determ...
awkward::None::getitem_fields
const ContentPtr getitem_fields(const std::vector< std::string > &keys) const override
awkward::None::getitem_next_jagged
const ContentPtr getitem_next_jagged(const Index64 &slicestarts, const Index64 &slicestops, const SliceArray64 &slicecontent, const Slice &tail) const override
awkward::None::getitem_at
const ContentPtr getitem_at(int64_t at) const override
awkward::None::setidentities
void setidentities() override
awkward::None::getitem_field
const ContentPtr getitem_field(const std::string &key, const Slice &only_fields) const override
awkward::None::getitem_next
const ContentPtr getitem_next(const SliceArray64 &array, const Slice &tail, const Index64 &advanced) const override
awkward::None::unique
const ContentPtr unique() const override
Returns an array where all components are unique.
awkward::None::sort_next
const ContentPtr sort_next(int64_t negaxis, const Index64 &starts, const Index64 &parents, int64_t outlength, bool ascending, bool stable) const override
awkward::None::None
None()
Creates a None instance.
awkward::None::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::None::getitem_fields
const ContentPtr getitem_fields(const std::vector< std::string > &keys, const Slice &only_fields) const override
awkward::None::length
int64_t length() const override
Always returns -1.
awkward::None::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::None::validityerror
const std::string validityerror(const std::string &path) const override
awkward::None::getitem_next
const ContentPtr getitem_next(const SliceAt &at, const Slice &tail, const Index64 &advanced) const override
awkward::None::istuple
bool istuple() const override
awkward::None::getitem_next
const ContentPtr getitem_next(const SliceField &field, const Slice &tail, const Index64 &advanced) const override
awkward::None::getitem_nothing
const ContentPtr getitem_nothing() const override
awkward::None::kernels
kernel::lib kernels() const override
Returns the kernel library enum for all nested ptr_lib within the array's tree structure....
awkward::None::carry
const ContentPtr carry(const Index64 &carry, bool allow_lazy) const override
awkward::None::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
awkward::None::setidentities
void setidentities(const IdentitiesPtr &identities) override
awkward::None::isscalar
bool isscalar() const override
Returns true if the data represented by this node is scalar, not a true array.
awkward::None::localindex
const ContentPtr localindex(int64_t axis, int64_t depth) const override
awkward::None::getitem_range_nowrap
const ContentPtr getitem_range_nowrap(int64_t start, int64_t stop) const override
awkward::None::offsets_and_flattened
const std::pair< Index64, ContentPtr > offsets_and_flattened(int64_t axis, int64_t depth) const override
awkward::None::fieldindex
int64_t fieldindex(const std::string &key) const override
awkward::None::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::None::keys
const std::vector< std::string > keys() const override
awkward::None::getitem_field
const ContentPtr getitem_field(const std::string &key) const override
awkward::None::branch_depth
const std::pair< bool, int64_t > branch_depth() const override
awkward::None::rpad
const ContentPtr rpad(int64_t target, int64_t axis, int64_t depth) const override
awkward::None::getitem_at_nowrap
const ContentPtr getitem_at_nowrap(int64_t at) const override
awkward::None::nbytes_part
void nbytes_part(std::map< size_t, int64_t > &largest) const override
awkward::None::mergemany
const ContentPtr mergemany(const ContentPtrVec &others) const override
awkward::None::key
const std::string key(int64_t fieldindex) const override
awkward::None::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::None::minmax_depth
const std::pair< int64_t, int64_t > minmax_depth() const override
awkward::None::is_unique
bool is_unique() const override
Returns 'true' if all components of the array are unique.
awkward::None::form
const FormPtr form(bool materialize) const override
awkward::None::asslice
const SliceItemPtr asslice() const override
awkward::None::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::None::rpad_and_clip
const ContentPtr rpad_and_clip(int64_t target, int64_t axis, int64_t depth) const override
awkward::None::getitem_next
const ContentPtr getitem_next(const SliceJagged64 &jagged, const Slice &tail, const Index64 &advanced) const override
awkward::None::getitem_range
const ContentPtr getitem_range(int64_t start, int64_t stop) const override
awkward::None::is_subrange_equal
bool is_subrange_equal(const Index64 &start, const Index64 &stop) const override
Returns 'true' if subranges are equal.
awkward::None::fillna
const ContentPtr fillna(const ContentPtr &value) const override
awkward::None::numfields
int64_t numfields() const override
awkward::None::referentially_equal
bool referentially_equal(const ContentPtr &other) const override
awkward::None::type
const TypePtr type(const util::TypeStrs &typestrs) const override
awkward::None::num
const ContentPtr num(int64_t axis, int64_t depth) const override
awkward::None::getitem_next
const ContentPtr getitem_next(const SliceFields &fields, const Slice &tail, const Index64 &advanced) const override
awkward::None::mergeable
bool mergeable(const ContentPtr &other, bool mergebool) const override
awkward::None::haskey
bool haskey(const std::string &key) const override
awkward::None::getitem_next_jagged
const ContentPtr getitem_next_jagged(const Index64 &slicestarts, const Index64 &slicestops, const SliceJagged64 &slicecontent, const Slice &tail) const override
awkward::None::getitem_next_jagged
const ContentPtr getitem_next_jagged(const Index64 &slicestarts, const Index64 &slicestops, const SliceMissing64 &slicecontent, const Slice &tail) const override
awkward::None::getitem_next
const ContentPtr getitem_next(const SliceRange &range, const Slice &tail, const Index64 &advanced) const override
awkward::None::shallow_simplify
const ContentPtr shallow_simplify() const override
awkward::None::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
awkward::None::numbers_to_type
const ContentPtr numbers_to_type(const std::string &name) const override
Change the leaf types to 'totype'.
awkward::None::classname
const std::string classname() const override
User-friendly name of this class: "None".
awkward::None::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::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::ContentPtrVec
std::vector< std::shared_ptr< Content > > ContentPtrVec
Definition: Content.h:16
awkward::none
const ContentPtr none
A constant value with type None.
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