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 
14 namespace awkward {
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 
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_
Represents a Python slice object (usual syntax: array[start:stop:step]).
Definition: Slice.h:93
#define LIBAWKWARD_EXPORT_SYMBOL
Definition: common.h:45
const std::string key(const RecordLookupPtr &recordlookup, int64_t fieldindex, int64_t numfields)
Returns the key associated with a field index, given a RecordLookup and a number of fields...
Abstract superclass of all array node types (flat hierarchy). Any Content can be nested within any ot...
Definition: Content.h:276
Definition: json.h:19
Definition: BitMaskedArray.h:15
A contiguous, one-dimensional array of integers used to represent data structures, rather than numerical data in the arrays themselves.
Definition: Index.h:16
const ContentPtr none
A constant value with type None.
std::string name(Mapping a, V value)
Definition: datetime_util.h:39
Definition: Slice.h:384
Represents a SliceArrayOf, SliceMissingOf, or SliceJaggedOf with missing values: None (no equivalent ...
Definition: Slice.h:431
Represents a single string in a slice tuple, indicating that a RecordArray should be replaced by one ...
Definition: Slice.h:340
Abstract class for all reducer algorithms.
Definition: Reducer.h:20
ERROR combinations(kernel::lib ptr_lib, T *toindex, int64_t n, bool replacement, int64_t singlelen)
const std::vector< std::string > keys(const RecordLookupPtr &recordlookup, int64_t numfields)
Returns a given RecordLookup as keys or generate anonymous ones form a number of fields.
ERROR unique(kernel::lib ptr_lib, T *toptr, int64_t length, int64_t *tolength)
Represents an array of integers in a slice (possibly converted from an array of booleans).
Definition: Slice.h:225
std::map< std::string, std::string > Parameters
Definition: util.h:165
ERROR copy_to(kernel::lib to_lib, kernel::lib from_lib, void *to_ptr, void *from_ptr, int64_t bytelength)
Internal Function an array buffer from library FROM to library TO, usually between main memory and a ...
std::shared_ptr< Form > FormPtr
Definition: Content.h:18
int64_t fieldindex(const RecordLookupPtr &recordlookup, const std::string &key, int64_t numfields)
Returns the field index associated with a key, given a RecordLookup and a number of fields...
Represents an array of nested lists, where the content may be SliceArrayOf, SliceMissingOf, or SliceJaggedOf (no equivalent in NumPy).
Definition: Slice.h:511
std::vector< std::shared_ptr< Content > > ContentPtrVec
Definition: Content.h:16
Mapping::value_type::value_type value(Mapping a, const std::string &name)
Definition: datetime_util.h:49
A sequence of SliceItem objects representing a tuple passed to Python&#39;s __getitem__.
Definition: Slice.h:585
bool haskey(const RecordLookupPtr &recordlookup, const std::string &key, int64_t numfields)
Returns true if a RecordLookup has a given key; false otherwise.
std::shared_ptr< Type > TypePtr
Definition: Content.h:23
std::shared_ptr< RecordLookup > RecordLookupPtr
Definition: util.h:130
Represents an integer in a tuple of slices passed to __getitem__ in Python.
Definition: Slice.h:58
std::map< std::string, std::string > TypeStrs
Definition: util.h:215
std::shared_ptr< Identities > IdentitiesPtr
Definition: Identities.h:16
std::shared_ptr< Content > ContentPtr
Definition: ArrayBuilder.h:16
std::shared_ptr< SliceItem > SliceItemPtr
Definition: Slice.h:15
lib
Definition: kernel-dispatch.h:20
Represents a scalar missing value, which is None in Python.
Definition: None.h:21