ak.forms.Form — Awkward Array documentation

# ak.forms.Form

Superclass of type nodes that describe a low-level data type or “form”. Unlike the high-level type (see ak.type), there is an exact one-to-one relationship between each ak.layout.Content class (see ak.Array.layout) and each Form.

Forms are rendered as JSON strings, the same JSON that can be used to construct them.

The type subclasses are listed below.

> - ak.forms.EmptyForm for ak.layout.EmptyArray

> - ak.forms.NumpyForm for ak.layout.NumpyArray

> - ak.forms.RegularForm for ak.layout.RegularArray

> - ak.forms.ListForm for ak.layout.ListArray

> - ak.forms.ListOffsetForm for ak.layout.ListOffsetArray

> - ak.forms.RecordForm for ak.layout.RecordArray

> - ak.forms.IndexedForm for ak.layout.IndexedArray

> - ak.forms.IndexedOptionForm for ak.layout.IndexedOptionArray

> - ak.forms.ByteMaskedForm for ak.layout.ByteMaskedArray

> - ak.forms.BitMaskedForm for ak.layout.BitMaskedArray

> - ak.forms.UnmaskedForm for ak.layout.UnmaskedArray

> - ak.forms.UnionForm for ak.layout.UnionArray

> - ak.forms.VirtualForm for ak.layout.VirtualArray

All ak.forms.Form instances have the following properties and methods in common.

## ak.forms.Form.__eq__

ak.forms.Form.__eq__(other)

True if two forms are equal; False otherwise.

## ak.forms.Form.__ne__

ak.forms.Form.__ne__()

True if two forms are not equal; False otherwise.

## ak.forms.Form.__repr__

ak.forms.Form.__repr__()

String representation of the form, which is pretty, non-verbose #ak.forms.Form.tojson.

## ak.forms.Form.__getstate__

ak.forms.Form.__getstate__()

Forms can be pickled.

## ak.forms.Form.__setstate__

ak.forms.Form.__setstate__(arg0)

Forms can be pickled.

## ak.forms.Form.tojson

ak.forms.Form.tojson(pretty, verbose)

Converts to a JSON string. If `pretty` (bool), it will be multi-line and indented; if `verbose`, all fields will be shown, even defaults.

## ak.forms.Form.type

ak.forms.Form.type(typestrs)

The single high-level type associated with this low-level form. Conversion in the other direction is not unique. `typestrs` is a dict of `__record__` to type-string names (see Custom type names).

## ak.forms.Form.parameters

ak.forms.Form.parameters

Returns the parameters associated with this form.

## ak.forms.Form.parameter

ak.forms.Form.parameter(key)

Returns the parameter associated with `key`. (Always returns, possibly None.)