ak.types.Type

Superclass of type nodes that describe a high-level data type (see ak.type and ak.Array.layout).

Types are rendered as Datashape strings, whenever possible. In some cases, they have more information than this specification can express, so we extend the Datashape language in natural ways.

The type subclasses are listed below.

All ak.types.Type instances have the following properties and methods in common.

ak.types.Type.__eq__

ak.types.Type.__eq__(other)

True if two types are equal; False otherwise.

ak.types.Type.__ne__

ak.types.Type.__ne__()

True if two types are not equal; False otherwise.

ak.types.Type.__repr__

ak.types.Type.__repr__()

String representation of the type, mostly following the Datashape grammar.

ak.types.Type.__getstate__

ak.types.Type.__getstate__()

Types can be pickled.

ak.types.Type.__setstate__

ak.types.Type.__setstate__(arg0)

Types can be pickled.

ak.types.Type.empty

ak.types.Type.empty()

Creates an empty ak.layout.Content array with this type.

ak.types.Type.fieldindex

ak.types.Type.fieldindex(key)

Returns the index position of a key if the type contains ak.types.RecordType and key is in the record.

ak.types.Type.haskey

ak.types.Type.haskey(key)

Returns True if the type contains ak.types.RecordType and key is in the record; False otherwise.

ak.types.Type.key

ak.types.Type.key(fieldindex)

Returns the key name at a given index position in the record if the type contains ak.types.RecordType with more than fieldindex fields.

ak.types.Type.keys

ak.types.Type.keys()

Returns a list of keys in the record if the type contains ak.types.RecordType.

ak.types.Type.setparameter

ak.types.Type.setparameter(key, value)

Sets a parameter.

Do not use this method! Mutable parameters are deprecated.

ak.types.Type.numfields

ak.types.Type.numfields

Returns the number of fields in the record if this type contains a ak.types.RecordType.

ak.types.Type.parameters

ak.types.Type.parameters

Returns the parameters associated with this type.

ak.types.Type.typestr

ak.types.Type.typestr

Returns the custom type string if overridden with ak.behavior.

See Custom type names.