Functions

Built-in functions

Every Content subclass has the following built-in functions:

Base.lengthFunction
Base.length(parameters::Parameters)
source
Base.length(layout::PrimitiveArray)
source
Base.length(layout::EmptyArray)
source
Base.length(layout::ListOffsetArray)

Length of a ListOffsetArray.

source
Base.length(layout::ListArray)

Length of a ListArray.

source
Base.length(layout::RegularArray)

Length of a RegularArray.

source
Base.length(layout::RecordArray)
source
Base.length(layout::TupleArray)
source
Base.length(layout::IndexedArray)
source
Base.length(layout::IndexedOptionArray)
source
Base.length(layout::ByteMaskedArray)
source
Base.length(layout::BitMaskedArray)
source
Base.length(layout::UnmaskedArray)
source
Base.length(layout::UnionArray)
source
Base.sizeFunction

Treat instances of Content as if they are one-dimensional arrays.

source
Base.firstindexFunction
Base.firstindex(layout::PrimitiveArray)
source
Base.firstindex(layout::EmptyArray)
source
Base.firstindex(layout::ListOffsetArray)

First index of a ListOffsetArray offsets.

source
Base.firstindex(layout::ListArray)

First index of a ListArray starts.

source
Base.firstindex(layout::RegularArray)

First index of a RegularArray is always 1.

source
Base.firstindex(layout::RecordArray)
source
Base.firstindex(layout::TupleArray)
source
Base.firstindex(layout::IndexedArray)
source
Base.firstindex(layout::IndexedOptionArray)
source
Base.firstindex(layout::ByteMaskedArray)
source
Base.firstindex(layout::BitMaskedArray)
source
Base.firstindex(layout::UnmaskedArray)
source
Base.firstindex(layout::UnionArray)
source
Base.lastindexFunction
Base.lastindex(layout::PrimitiveArray)
source
Base.lastindex(layout::EmptyArray)
source
Base.lastindex(layout::ListOffsetArray)

Last index of a ListOffsetArray offsets.

source
Base.lastindex(layout::ListArray)

Last index of a ListArray starts.

source
Base.lastindex(layout::RegularArray)

Last index of a RegularArray.

source
Base.lastindex(layout::RecordArray)
source
Base.lastindex(layout::TupleArray)
source
Base.lastindex(layout::IndexedArray)
source
Base.lastindex(layout::IndexedOptionArray)
source
Base.lastindex(layout::ByteMaskedArray)
source
Base.lastindex(layout::BitMaskedArray)
source
Base.lastindex(layout::UnmaskedArray)
source
Base.lastindex(layout::UnionArray)
source
Base.getindexFunction
Base.getindex(layout::PrimitiveArray, i::Int)
source
Base.getindex(layout::PrimitiveArray, r::UnitRange{Int})
source
Base.getindex(layout::EmptyArray, i::Int)
source
Base.getindex(layout::EmptyArray, r::UnitRange{Int})
source
Base.getindex(layout::ListOffsetArray, i::Int)
source
Base.getindex(layout::ListOffsetArray, r::UnitRange{Int})
source
Base.getindex(layout::ListOffsetArray, f::Symbol)
source
Base.getindex(layout::ListArray, i::Int)
source
Base.getindex(layout::ListArray, r::UnitRange{Int})
source
Base.getindex(layout::ListArray, f::Symbol)
source
Base.getindex(layout::RegularArray, i::Int)
source
Base.getindex(layout::RegularArray, r::UnitRange{Int})
source
Base.getindex(layout::RegularArray, f::Symbol)
source
Base.getindex(
    layout::ListOffsetArray{INDEX,PrimitiveArray{UInt8,BUFFER,:char},:string},
    i::Int,
) where {INDEX<:IndexBig,BUFFER<:AbstractVector{UInt8}}
source
Base.getindex(
    layout::ListArray{INDEX,PrimitiveArray{UInt8,BUFFER,:char},:string},
    i::Int,
) where {INDEX<:IndexBig,BUFFER<:AbstractVector{UInt8}}
source
Base.getindex(
    layout::RegularArray{PrimitiveArray{UInt8,BUFFER,:char},:string},
    i::Int,
) where {BUFFER<:AbstractVector{UInt8}}
source
Base.getindex(
    layout::ListOffsetArray{INDEX,PrimitiveArray{UInt8,BUFFER,:byte},:bytestring},
    i::Int,
) where {INDEX<:IndexBig,BUFFER<:AbstractVector{UInt8}}
source
Base.getindex(
    layout::ListArray{INDEX,PrimitiveArray{UInt8,BUFFER,:byte},:bytestring},
    i::Int,
) where {INDEX<:IndexBig,BUFFER<:AbstractVector{UInt8}}
source
Base.getindex(
    layout::RegularArray{PrimitiveArray{UInt8,BUFFER,:byte},:bytestring},
    i::Int,
) where {BUFFER<:AbstractVector{UInt8}}
source
Base.getindex(
    layout::RecordArray{FIELDS,CONTENTS,BEHAVIOR},
    i::Int,
) where {FIELDS,CONTENTS<:Base.Tuple{Vararg{Content}},BEHAVIOR}
source
Base.getindex(
    layout::RecordArray{FIELDS,CONTENTS,BEHAVIOR},
    r::UnitRange{Int},
) where {FIELDS,CONTENTS<:Base.Tuple{Vararg{Content}},BEHAVIOR}
source
Base.getindex(
    layout::RecordArray{FIELDS,CONTENTS,BEHAVIOR},
    f::Symbol,
) where {FIELDS,CONTENTS<:Base.Tuple{Vararg{Content}},BEHAVIOR}
source
Base.getindex(
       layout::AwkwardArray.Record,
       f::Symbol,
   )
source
Base.getindex(
    layout::TupleArray{CONTENTS,BEHAVIOR},
    i::Int,
) where {CONTENTS<:Base.Tuple{Vararg{Content}},BEHAVIOR}
source
Base.getindex(
    layout::TupleArray{CONTENTS,BEHAVIOR},
    r::UnitRange{Int},
) where {VALUES<:Content,CONTENTS<:Base.Tuple{VALUES},BEHAVIOR}
source
Base.getindex(
    layout::SlotRecord,
    f::Int64,
)
source
Base.getindex(layout::IndexedArray, i::Int)
source
Base.getindex(layout::IndexedArray, r::UnitRange{Int})
source
Base.getindex(layout::IndexedArray, f::Symbol)
source
Base.getindex(layout::IndexedOptionArray, i::Int)
source
Base.getindex(layout::IndexedOptionArray, r::UnitRange{Int})
source
Base.getindex(layout::IndexedOptionArray, f::Symbol)
source
Base.getindex(layout::ByteMaskedArray, i::Int)
source
Base.getindex(layout::ByteMaskedArray, r::UnitRange{Int})
source
Base.getindex(layout::ByteMaskedArray, f::Symbol)
source
Base.getindex(layout::BitMaskedArray, i::Int)
source
Base.getindex(layout::BitMaskedArray, r::UnitRange{Int})
source
Base.getindex(layout::BitMaskedArray, f::Symbol)
source
Base.getindex(layout::UnmaskedArray, i::Int)
source
Base.getindex(layout::UnmaskedArray, r::UnitRange{Int})
source
Base.getindex(layout::UnmaskedArray, f::Symbol)
source
Base.getindex(layout::UnionArray, i::Int)
source
Base.getindex(layout::UnionArray, r::UnitRange{Int})
source
Base.getindex(layout::UnionArray, f::Symbol)
source
Base.iterateFunction
Base.iterate(layout::Content)

Enable the use of Julia's iteration protocol on instances of Content type.

Examples

# Assuming Content is defined and an instance is created
for element in layout_instance
    println(element)
end

Initialization: The iteration process starts by calling Base.iterate(layout) with the collection layout as the only argument. This should return the first element and the initial state.

source
Base.iterate(layout::Content, state)

Iteration: The iteration continues by repeatedly calling Base.iterate(layout, state) with the collection and the current state. This returns the next element and the next state until it returns nothing, indicating the end of the iteration.

Parameters

layout::Content: This specifies that the function operates on an instance of the type Content.

state: This represents the current state of the iteration, typically an index or position in the collection.

source
Base.eltypeFunction
Base.eltype(layout::PrimitiveArray)
source
Base.eltype(layout::EmptyArray)
source
Base.eltype(layout::ListType)
source
Base.eltype(layout::IndexedArray)
source
Base.eltype(layout::IndexedOptionArray)
source
Base.eltype(layout::ByteMaskedArray)
source
Base.eltype(layout::BitMaskedArray)
source
Base.eltype(layout::UnmaskedArray)
source
Base.eltype(layout::UnionArray)
source
Base.:==Function
Base.:(==)(layout1::Content, layout2::Content)

Two Content objects are considered equal only if they have the same elements in the same order.

source
Base.:(==)(
    layout1::RecordArray{FIELDS,CONTENTS1},
    layout2::RecordArray{FIELDS,CONTENTS2},
) where {
    FIELDS,
    CONTENTS1<:Base.Tuple{Vararg{Content}},
    CONTENTS2<:Base.Tuple{Vararg{Content}},
}
source
Base.:(==)(
    layout1::Record{FIELDS,CONTENTS1},
    layout2::Record{FIELDS,CONTENTS2},
) where {
    FIELDS,
    CONTENTS1<:Base.Tuple{Vararg{Content}},
    CONTENTS2<:Base.Tuple{Vararg{Content}},
}
source
Base.:(==)(
    layout1::TupleArray{CONTENTS1},
    layout2::TupleArray{CONTENTS2},
) where {
    N,
    CONTENTS1<:Base.Tuple{Vararg{Content,N}},
    CONTENTS2<:Base.Tuple{Vararg{Content,N}},
}
source
Base.:(==)(
    layout1::SlotRecord{CONTENTS1},
    layout2::SlotRecord{CONTENTS2},
) where {
    N,
    CONTENTS1<:Base.Tuple{Vararg{Content,N}},
    CONTENTS2<:Base.Tuple{Vararg{Content,N}},
}
source
Base.push!Function
Base.push!(layout::PrimitiveArray{ITEM}, input::ITEM) where {ITEM}

Push multiple ITEM elements (from another collection) to an instance of PrimitiveArray.

source
Base.push!(layout::PrimitiveArray{ITEM}, input::Number) where {ITEM}
source
Base.push!(layout::EmptyArray, input)
source
Base.push!(layout::ListType{BEHAVIOR}, input::String) where {BEHAVIOR}
source
Base.push!(layout::ListType, input::AbstractVector)
source
Base.push!(
    layout::RecordArray{FIELDS,CONTENTS},
    input::NamedTuple{FIELDS},
) where {FIELDS,CONTENTS<:Base.Tuple{Vararg{Content}}}
source
Base.push!(
    layout::TupleArray{CONTENTS},
    input::INPUT,
) where {N,CONTENTS<:Base.Tuple{Vararg{Content,N}},INPUT<:Base.Tuple{Vararg{Any,N}}}
source
Base.push!(layout::IndexedArray, input)
source
Base.push!(layout::IndexedOptionArray, input)
source
Base.push!(layout::ByteMaskedArray, input)
source
Base.push!(layout::BitMaskedArray, input)
source
Base.push!(layout::UnmaskedArray, input)
source
Base.push!(special::Specialization, input)
source
Base.push!(layout::UnionArray, input)
source
Base.append!Function
Base.append!(layout::Content, input)

Append multiple elements (from another collection) to an instance of Content.

source
Base.append!(layout::OptionType, input)

Appending elements to an array of type OptionType, handling missing values.

source
Base.append!(special::Specialization, input)
source
Base.showFunction
Base.show(io::IO, parameters::Parameters)
source
Base.show(
    io::IO,
    data::Union{Content,Record,Tuple};
    limit_rows::Int = 1,
    limit_cols::Int = 80,
)
source
Base.show(data::Union{Content,Record,Tuple}; limit_rows::Int = 1, limit_cols::Int = 80)
source

Manipulating and checking structure

Every Content subclass has the following functions for manipulating and checking structure:

AwkwardArray.has_parameterFunction
has_parameter(parameters::Parameters, key::String)
source
has_parameter(content::CONTENT, key::String) where {CONTENT<:Content}

Return true if a parameter exists.

source
has_parameter(content::EmptyArray, key::String)
source
AwkwardArray.get_parameterFunction
get_parameter(parameters::Parameters, key::String)
source
get_parameter(content::CONTENT, key::String) where {CONTENT<:Content}

Return a parameter or raises an error.

source
get_parameter(content::EmptyArray, key::String)
source
AwkwardArray.copyFunction
copy(
    layout::PrimitiveArray{ITEM,BUFFER1,BEHAVIOR};
    data::Union{Unset,BUFFER2} = Unset(),
    parameters::Union{Unset,Parameters} = Unset(),
    behavior::Union{Unset,Symbol} = Unset(),
) where {ITEM,BUFFER1<:AbstractVector{ITEM},BUFFER2<:AbstractVector,BEHAVIOR}
source
copy(behavior::Union{Unset,Symbol} = Unset())
source
copy(
    layout::ListOffsetArray{INDEX1,CONTENT1,BEHAVIOR};
    offsets::Union{Unset,INDEX2} = Unset(),
    content::Union{Unset,CONTENT2} = Unset(),
    parameters::Union{Unset,Parameters} = Unset(),
    behavior::Union{Unset,Symbol} = Unset(),
) where {INDEX1<:IndexBig,INDEX2<:IndexBig,CONTENT1<:Content,CONTENT2<:Content,BEHAVIOR}

Copy of a ListOffsetArray.

source
copy(
    layout::ListArray{INDEX1,CONTENT1,BEHAVIOR};
    starts::Union{Unset,INDEX2} = Unset(),
    stops::Union{Unset,INDEX2} = Unset(),
    content::Union{Unset,CONTENT2} = Unset(),
    parameters::Union{Unset,Parameters} = Unset(),
    behavior::Union{Unset,Symbol} = Unset(),
) where {INDEX1<:IndexBig,INDEX2<:IndexBig,CONTENT1<:Content,CONTENT2<:Content,BEHAVIOR}

Copy of a ListArray.

source
copy(
    layout::RegularArray{CONTENT1,BEHAVIOR};
    content::Union{Unset,CONTENT2} = Unset(),
    size::Union{Unset,Int} = Unset(),
    zeros_length::Union{Unset,Int} = Unset(),
    parameters::Union{Unset,Parameters} = Unset(),
    behavior::Union{Unset,Symbol} = Unset(),
) where {CONTENT1<:Content,CONTENT2<:Content,BEHAVIOR}

Copy of a RegularArray.

source
copy(
    layout::RecordArray{FIELDS1,CONTENTS1,BEHAVIOR};
    contents::Union{Unset,NamedTuple{FIELDS2,CONTENTS2}} = Unset(),
    length::Union{Unset,Int64} = Unset(),
    parameters::Union{Unset,Parameters} = Unset(),
    behavior::Union{Unset,Symbol} = Unset(),
) where {
    FIELDS1,
    FIELDS2,
    CONTENTS1<:Base.Tuple{Vararg{Content}},
    CONTENTS2<:Base.Tuple{Vararg{Content}},
    BEHAVIOR,
}
source
copy(
    layout::TupleArray{CONTENTS1,BEHAVIOR};
    contents::Union{Unset,CONTENTS2} = Unset(),
    length::Union{Unset,Int64} = Unset(),
    parameters::Union{Unset,Parameters} = Unset(),
    behavior::Union{Unset,Symbol} = Unset(),
) where {
    CONTENTS1<:Base.Tuple{Vararg{Content}},
    CONTENTS2<:Base.Tuple{Vararg{Content}},
    BEHAVIOR,
}
source
copy(
    layout::IndexedArray{INDEX1,CONTENT1,BEHAVIOR};
    index::Union{Unset,INDEX2} = Unset(),
    content::Union{Unset,CONTENT2} = Unset(),
    parameters::Union{Unset,Parameters} = Unset(),
    behavior::Union{Unset,Symbol} = Unset(),
) where {INDEX1<:IndexBig,INDEX2<:IndexBig,CONTENT1<:Content,CONTENT2<:Content,BEHAVIOR}
source
copy(
    layout::IndexedOptionArray{INDEX1,CONTENT1,BEHAVIOR};
    index::Union{Unset,INDEX2} = Unset(),
    content::Union{Unset,CONTENT2} = Unset(),
    parameters::Union{Unset,Parameters} = Unset(),
    behavior::Union{Unset,Symbol} = Unset(),
) where {
    INDEX1<:IndexBigSigned,
    INDEX2<:IndexBigSigned,
    CONTENT1<:Content,
    CONTENT2<:Content,
    BEHAVIOR,
}

Copy of an IndexedOptionArray, potentially with some modifications to its fields.

source
copy(
    layout::ByteMaskedArray{INDEX1,CONTENT1,BEHAVIOR};
    mask::Union{Unset,INDEX2} = Unset(),
    content::Union{Unset,CONTENT2} = Unset(),
    valid_when::Union{Unset,Bool} = Unset(),
    parameters::Union{Unset,Parameters} = Unset(),
    behavior::Union{Unset,Symbol} = Unset(),
) where {INDEX1<:IndexBool,INDEX2<:IndexBool,CONTENT1<:Content,CONTENT2<:Content,BEHAVIOR}
source
copy(
    layout::BitMaskedArray{CONTENT1,BEHAVIOR};
    mask::Union{Unset,BitVector} = Unset(),
    content::Union{Unset,CONTENT2} = Unset(),
    valid_when::Union{Unset,Bool} = Unset(),
    parameters::Union{Unset,Parameters} = Unset(),
    behavior::Union{Unset,Symbol} = Unset(),
) where {CONTENT1<:Content,CONTENT2<:Content,BEHAVIOR}
source
copy(
    layout::UnmaskedArray{CONTENT1,BEHAVIOR};
    content::Union{Unset,CONTENT2} = Unset(),
    parameters::Union{Unset,Parameters} = Unset(),
    behavior::Union{Unset,Symbol} = Unset(),
) where {CONTENT1<:Content,CONTENT2<:Content,BEHAVIOR}
source
copy(
    layout::UnionArray{TAGS1,INDEX1,CONTENTS1,BEHAVIOR};
    tags::Union{Unset,TAGS2} = Unset(),
    index::Union{Unset,INDEX2} = Unset(),
    contents::Union{Unset,CONTENTS2} = Unset(),
    parameters::Union{Unset,Parameters} = Unset(),
    behavior::Union{Unset,Symbol} = Unset(),
)
source
AwkwardArray.is_validFunction
is_valid(layout::PrimitiveArray)
source
is_valid(layout::EmptyArray)
source
is_valid(layout::ListOffsetArray)

Check if a ListOffsetArray is valid.

source
is_valid(layout::ListArray)

Check if a ListArray is valid.

source
is_valid(layout::RegularArray)

Check if a RegularArray is valid.

source
is_valid(layout::RecordArray)
source
is_valid(layout::TupleArray)
source
is_valid(layout::IndexedArray)
source
is_valid(layout::IndexedOptionArray)
source
is_valid(layout::ByteMaskedArray)
source
is_valid(layout::BitMaskedArray)
source
is_valid(layout::UnmaskedArray)
source
is_valid(layout::UnionArray)
source

Filling an array

Every Content subclass has the following functions for filling an array:

AwkwardArray.end_list!Function
end_list!(layout::ListOffsetArray)
source
end_list!(layout::ListArray)
source
end_list!(layout::RegularArray)
source
end_list!(layout::IndexedArray)
source
end_list!(layout::IndexedOptionArray)
source
end_list!(layout::ByteMaskedArray)
source
end_list!(layout::BitMaskedArray)
source
end_list!(layout::UnmaskedArray)
source
end_list!(special::Specialization)
source
AwkwardArray.push_null!Function
push_null!(layout::IndexedOptionArray)
source
push_null!(layout::ByteMaskedArray)
source
push_null!(layout::BitMaskedArray)
source
push_null!(
    special::Specialization{ARRAY,TAGGED},
) where {ARRAY<:UnionArray,TAGGED<:OptionType}
source
AwkwardArray.push_dummy!Function
push_dummy!(layout::PrimitiveArray{ITEM}) where {ITEM}
source
push_dummy!(layout::ListOffsetArray)
source
push_dummy!(layout::ListArray)
source
push_dummy!(layout::RegularArray)
source
push_dummy!(layout::RecordArray)
source
push_dummy!(layout::TupleArray)
source
push_dummy!(layout::IndexedArray)
source
push_dummy!(layout::IndexedOptionArray)
source
push_dummy!(layout::ByteMaskedArray)
source
push_dummy!(layout::BitMaskedArray)
source
push_dummy!(layout::UnmaskedArray)
source
push_dummy!(special::Specialization)
source

Selecting fields

RecordArrayand TupleArray have the following for selecting fields (as opposed to rows):

AwkwardArray.slotFunction
slot(
    layout::RecordArray{FIELDS,CONTENTS,BEHAVIOR},
    f::Symbol,
) where {FIELDS,CONTENTS<:Base.Tuple{Vararg{Content}},BEHAVIOR}
source
slot(
    layout::TupleArray{CONTENTS,BEHAVIOR},
    f::Int,
) where {CONTENTS<:Base.Tuple{Vararg{Content}},BEHAVIOR}
source

Specializations

UnionArrayhas the following for dealing with specializations:

Convertion

Finally, all Contentsubclasses can be converted with the following:

AwkwardArray.to_vectorFunction
to_vector(layout::Content; view::Bool = false, na::Union{Missing,Nothing} = missing)
source
to_vector(
    record::Record{FIELDS,CONTENTS};
    view::Bool = false,
    na::Union{Missing,Nothing} = missing,
) where {FIELDS,CONTENTS<:Base.Tuple{Vararg{Content}}} = NamedTuple{FIELDS}
source
to_vector(
    tuple::Tuple{CONTENTS};
    view::Bool = false,
    na::Union{Missing,Nothing} = missing,
) where {CONTENTS<:Base.Tuple{Vararg{Content}}}
source
to_vector(
    layout::PrimitiveArray{ITEM},
    r::UnitRange{Int};
    view::Bool = false,
    na::Union{Missing,Nothing} = missing,
) where {ITEM}
source
to_vector(
    layout::EmptyArray,
    r::UnitRange{Int};
    view::Bool = false,
    na::Union{Missing,Nothing} = missing,
)
source
to_vector(
    layout::ListOffsetArray{INDEX,CONTENT},
    r::UnitRange{Int};
    view::Bool = false,
    na::Union{Missing,Nothing} = missing,
) where {INDEX<:IndexBig,CONTENT<:Content}
source
to_vector(
    layout::ListArray{INDEX,CONTENT},
    r::UnitRange{Int};
    view::Bool = false,
    na::Union{Missing,Nothing} = missing,
) where {INDEX<:IndexBig,CONTENT<:Content}
source
to_vector(
    layout::RegularArray{CONTENT},
    r::UnitRange{Int};
    view::Bool = false,
    na::Union{Missing,Nothing} = missing,
) where {CONTENT<:Content}
source
to_vector(
    layout::ListOffsetArray{INDEX,PrimitiveArray{UInt8,BUFFER,:char},:string},
    r::UnitRange{Int};
    view::Bool = false,
    na::Union{Missing,Nothing} = missing,
) where {INDEX<:IndexBig,BUFFER<:AbstractVector{UInt8}}
source
to_vector(
    layout::ListArray{INDEX,PrimitiveArray{UInt8,BUFFER,:char},:string},
    r::UnitRange{Int};
    view::Bool = false,
    na::Union{Missing,Nothing} = missing,
) where {INDEX<:IndexBig,BUFFER<:AbstractVector{UInt8}}
source
to_vector(
    layout::RegularArray{PrimitiveArray{UInt8,BUFFER,:char},:string},
    r::UnitRange{Int};
    view::Bool = false,
    na::Union{Missing,Nothing} = missing,
) where {BUFFER<:AbstractVector{UInt8}}
source
to_vector(
    layout::RecordArray{FIELDS,CONTENTS},
    r::UnitRange{Int};
    view::Bool = false,
    na::Union{Missing,Nothing} = missing,
) where {FIELDS,CONTENTS<:Base.Tuple{Vararg{Content}}}
source
to_vector(
    layout::TupleArray{CONTENTS},
    r::UnitRange{Int};
    view::Bool = false,
    na::Union{Missing,Nothing} = missing,
) where {CONTENTS<:Base.Tuple{Vararg{Content}}}
source
to_vector(
    layout::IndexedArray{INDEX,CONTENT},
    r::UnitRange{Int};
    view::Bool = false,
    na::Union{Missing,Nothing} = missing,
) where {INDEX<:IndexBig,CONTENT<:Content}
source
to_vector(
    layout::IndexedOptionArray{INDEX,CONTENT},
    r::UnitRange{Int};
    view::Bool = false,
    na::Union{Missing,Nothing} = missing,
) where {INDEX<:IndexBig,CONTENT<:Content}
source
to_vector(
    layout::ByteMaskedArray{INDEX,CONTENT},
    r::UnitRange{Int};
    view::Bool = false,
    na::Union{Missing,Nothing} = missing,
) where {INDEX<:IndexBool,CONTENT<:Content}
source
to_vector(
    layout::BitMaskedArray{CONTENT},
    r::UnitRange{Int};
    view::Bool = false,
    na::Union{Missing,Nothing} = missing,
) where {CONTENT<:Content}
source
to_vector(
    layout::UnmaskedArray{CONTENT},
    r::UnitRange{Int};
    view::Bool = false,
    na::Union{Missing,Nothing} = missing,
) where {CONTENT<:Content}
source
to_vector(
    layout::UnionArray{TAGS,INDEX,CONTENTS},
    r::UnitRange{Int};
    view::Bool = false,
    na::Union{Missing,Nothing} = missing,
) where {TAGS<:Index8,INDEX<:IndexBig,CONTENTS<:Base.Tuple}
source
AwkwardArray.from_buffersFunction
from_buffers(
    form::String,
    length::Int,
    containers::Dict{String,BUFFER};
    buffer_key::BUFFER_KEY_FUNCTION = default_buffer_key,
) where {BUFFER<:AbstractVector{UInt8},BUFFER_KEY_FUNCTION<:Function}
source
from_buffers(
    form::Dict{String,Any},
    length::Int,
    containers::Dict{String,BUFFER};
    buffer_key::BUFFER_KEY_FUNCTION = default_buffer_key,
) where {BUFFER<:AbstractVector{UInt8},BUFFER_KEY_FUNCTION<:Function}
source

Arrays of Stings

AwkwardArray.ByteStringOffsetArrayFunction
ByteStringOffsetArray(
    offsets::INDEX,
    data::AbstractVector{UInt8};
    parameters::Parameters = Parameters(),
    byte_parameters::Parameters = Parameters(),
) where {INDEX<:IndexBig}

The function that constructs a specialized array type for handling byte strings with specific offsets.

  • offsets: This is an array of indices (INDEX) which determines where each string starts within the byte array.
  • data: This is a vector of UInt8 (unsigned 8-bit integers), representing the raw bytes of the strings.
  • parameters: Optional parameters for configuring the ListOffsetArray.
  • byte_parameters: Optional parameters specifically for the PrimitiveArray holding the byte data.
  • INDEX<: Ensures that offsets is a subtype of IndexBig, which typically implies a larger indexing type suitable for big data.
Note

It is a ListType with behavior = :bytestring.

source
ByteStringOffsetArray(;
    parameters::Parameters = Parameters(),
    byte_parameters::Parameters = Parameters(),
)

A default constructor that initializes an empty ByteStringOffsetArray.

source
AwkwardArray.ByteStringArrayFunction
ByteStringArray(
    starts::INDEX,
    stops::INDEX,
    data::AbstractVector{UInt8};
    parameters::Parameters = Parameters(),
    byte_parameters::Parameters = Parameters(),
) where {INDEX<:IndexBig}

The ByteStringArray function constructs a specialized array type for handling byte strings, similar to ByteStringOffsetArray, but it uses separate starts and stops indices rather than a single offsets array.

source
ByteStringArray(;
    parameters::Parameters = Parameters(),
    byte_parameters::Parameters = Parameters(),
)

A default constructor that initializes an empty ByteStringArray.

source
AwkwardArray.ByteStringRegularArrayFunction
ByteStringRegularArray(
    data::AbstractVector{UInt8},
    size::Int;
    zeros_length::Int = 0,
    parameters::Parameters = Parameters(),
    byte_parameters::Parameters = Parameters(),
)
source
ByteStringRegularArray(
    size::Int;
    parameters::Parameters = Parameters(),
    byte_parameters::Parameters = Parameters(),
)
source
ByteStringRegularArray(;
    parameters::Parameters = Parameters(),
    byte_parameters::Parameters = Parameters(),
)
source
AwkwardArray.StringArrayFunction
StringArray(
    starts::INDEX,
    stops::INDEX,
    data::AbstractVector{UInt8};
    parameters::Parameters = Parameters(),
    char_parameters::Parameters = Parameters(),
) where {INDEX<:IndexBig}
source
StringArray(
    starts::INDEX,
    stops::INDEX,
    data::String;   # data provided as a String, rather than AbstractVector{UInt8}
    parameters::Parameters = Parameters(),
    char_parameters::Parameters = Parameters(),
) where {INDEX<:IndexBig}
source
StringArray(;
    parameters::Parameters = Parameters(),
    char_parameters::Parameters = Parameters(),
)
source
AwkwardArray.StringOffsetArrayFunction
StringOffsetArray(
    offsets::INDEX,
    data::AbstractVector{UInt8};
    parameters::Parameters = Parameters(),
    char_parameters::Parameters = Parameters(),
) where {INDEX<:IndexBig}
source
StringOffsetArray(
    offsets::INDEX,
    data::String;
    parameters::Parameters = Parameters(),
    char_parameters::Parameters = Parameters(),
) where {INDEX<:IndexBig}
source
StringOffsetArray(; parameters = Parameters(), char_parameters = Parameters())
source
AwkwardArray.StringRegularArrayFunction
StringRegularArray(
    data::AbstractVector{UInt8},
    size::Int;
    zeros_length::Int = 0,
    parameters::Parameters = Parameters(),
    char_parameters::Parameters = Parameters(),
)
source
StringRegularArray(
    data::String,
    size::Int;
    zeros_length::Int = 0,
    parameters::Parameters = Parameters(),
    char_parameters::Parameters = Parameters(),
)
source
StringRegularArray(
    size::Int;
    parameters::Parameters = Parameters(),
    char_parameters::Parameters = Parameters(),
)
source
StringRegularArray(;
    parameters::Parameters = Parameters(),
    char_parameters::Parameters = Parameters(),
)
source

Utilities

AwkwardArray.isprimitiveFunction
isprimitive(t::Type)

Determine if a given type is one of the fundamental data types in Julia that are typically considered primitive. These include:

Integer: Represents all integer types (e.g., Int64, UInt8). AbstractFloat: Represents all floating-point types (e.g., Float64, Float32). Bool: Represents boolean values (true and false). Char: Represents character values.

source
AwkwardArray.check_primitive_typeFunction
check_primitive_type(ITEM)

A utility that provides a string representation for various primitive types in Julia. It helps in identifying the type of an item and mapping it to a human-readable format. This is useful in scenarios where type information needs to be logged, serialized, or displayed. If a type is not recognized, it defaults to returning unknown.

source

Private functions

AwkwardArray._get_bufferFunction
_get_buffer(
    form_key::Union{Nothing,String},
    attribute::String,
    buffer_key::BUFFER_KEY_FUNCTION,
    containers::Dict{String,BUFFER},
) where {BUFFER<:AbstractVector{UInt8},BUFFER_KEY_FUNCTION<:Function}
source
AwkwardArray._get_indexFunction
_get_index(
    form_snippet::String,
    length::Int64,
    buffer::BUFFER,
) where {BUFFER<:AbstractVector{UInt8}}
source
AwkwardArray._to_buffers!Function
_to_buffers!(
    layout::PrimitiveArray{ITEM,BUFFER},
    number::Vector{Int64},
    containers::Dict{String,AbstractVector{UInt8}},
) where {ITEM,BUFFER<:AbstractVector{ITEM}}
source
_to_buffers!(
    layout::EmptyArray,
    number::Vector{Int64},
    containers::Dict{String,AbstractVector{UInt8}},
)
source
_to_buffers!(
    layout::ListOffsetArray{INDEX,CONTENT},
    number::Vector{Int64},
    containers::Dict{String,AbstractVector{UInt8}},
) where {INDEX<:IndexBig,CONTENT<:Content}
source
_to_buffers!(
    layout::ListArray{INDEX,CONTENT},
    number::Vector{Int64},
    containers::Dict{String,AbstractVector{UInt8}},
) where {INDEX<:IndexBig,CONTENT<:Content}
source
_to_buffers!(
    layout::RegularArray{CONTENT},
    number::Vector{Int64},
    containers::Dict{String,AbstractVector{UInt8}},
) where {CONTENT<:Content}
source
_to_buffers!(
    layout::RecordArray{FIELDS,CONTENTS},
    number::Vector{Int64},
    containers::Dict{String,AbstractVector{UInt8}},
) where {FIELDS,CONTENTS<:Base.Tuple{Vararg{Content}}}
source
_to_buffers!(
    layout::TupleArray{CONTENTS},
    number::Vector{Int64},
    containers::Dict{String,AbstractVector{UInt8}},
) where {CONTENTS<:Base.Tuple{Vararg{Content}}}
source
_to_buffers!(
    layout::IndexedArray{INDEX,CONTENT},
    number::Vector{Int64},
    containers::Dict{String,AbstractVector{UInt8}},
) where {INDEX<:IndexBig,CONTENT<:Content}
source
_to_buffers!(
    layout::IndexedOptionArray{INDEX,CONTENT},
    number::Vector{Int64},
    containers::Dict{String,AbstractVector{UInt8}},
) where {INDEX<:IndexBigSigned,CONTENT<:Content}
source
_to_buffers!(
    layout::ByteMaskedArray{INDEX,CONTENT},
    number::Vector{Int64},
    containers::Dict{String,AbstractVector{UInt8}},
) where {INDEX<:IndexBool,CONTENT<:Content}
source
_to_buffers!(
    layout::BitMaskedArray{CONTENT},
    number::Vector{Int64},
    containers::Dict{String,AbstractVector{UInt8}},
) where {CONTENT<:Content}
source
_to_buffers!(
    layout::UnmaskedArray{CONTENT},
    number::Vector{Int64},
    containers::Dict{String,AbstractVector{UInt8}},
) where {CONTENT<:Content}
source
_to_buffers!(
    layout::UnionArray{TAGS,INDEX,CONTENTS},
    number::Vector{Int64},
    containers::Dict{String,AbstractVector{UInt8}},
) where {TAGS<:Index8,INDEX<:IndexBig,CONTENTS<:Base.Tuple{Vararg{Content}}}
source

Index