List of functions
Every Content
subclass has the following built-in functions:
Base.length
Base.size
(1-tuple oflength
)Base.firstindex
,Base.lastindex
(1-based or inherited from its index)Base.getindex
: select byInt
(single item),UnitRange{Int}
(slice), andSymbol
(record field)Base.iterate
Base.(==)
(equality defined by values: aListOffsetArray
and aListArray
may be considered the same)Base.push!
Base.append!
Base.show
They also have the following functions for manipulating and checking structure:
AwkwardArray.parameters_of
: gets all parametersAwkwardArray.has_parameter
: returns true if a parameter existsAwkwardArray.get_parameter
: returns a parameter or raises an errorAwkwardArray.with_parameter
: returns a copy of this node with a specified parameterAwkwardArray.copy
: shallow-copy of the array, allowing properties to be replacedAwkwardArray.is_valid
: verifies that the structure adheres to Awkward Array's protocol
They have the following functions for filling an array:
AwkwardArray.end_list!
: closes off aListType
array (ListOffsetArray
,ListArray
, orRegularArray
) in the manner of Python's ak.ArrayBuilder (nobegin_list
is necessary)AwkwardArray.end_record!
: closes off aRecordArray
AwkwardArray.end_tuple!
: closes off aTupleArray
AwkwardArray.push_null!
: pushes a missing value ontoOptionType
arrays (IndexedOptionArray
,ByteMaskedArray
,BitMaskedArray
, orUnmaskedArray
)AwkwardArray.push_dummy!
: pushes an unspecified value onto the array (used byByteMaskedArray
andBitMaskedArray
, which need to have a placeholder in memory behind eachmissing
value)
RecordArray
and TupleArray
have the following for selecting fields (as opposed to rows):
AwkwardArray.slot
: gets aRecordArray
orTupleArray
field, to avoid conflicts withBase.getindex
forTupleArrays
(both use integers to select a field)AwkwardArray.Record
: scalar representation of an item from aRecordArray
AwkwardArray.Tuple
: scalar representation of an item from aTupleArray
(note: not the same asBase.Tuple
)
UnionArray
has the following for dealing with specializations:
AwkwardArray.Specialization
: selects aUnionArray
specialization forpush!
,append!
, etc.
Finally, all Content
subclasses can be converted with the following:
AwkwardArray.layout_for
: returns an appropriately-nestedContent
type for a given Julia type (DataType
)AwkwardArray.from_iter
: converts Julia data into an Awkward ArrayAwkwardArray.to_vector
: converts an Awkward Array into Julia dataAwkwardArray.from_buffers
: constructs an Awkward Array from a Form (JSON), length, and buffers for zero-copy passing from PythonAwkwardArray.to_buffers
: deconstructs an Awkward Array into a Form (JSON), length, and buffers for zero-copy passing to Python