API docs

Fields

Field(data[, dims, axes])

An array with optional named dimensions and associated coordinates.

Field.broadcast_like(other)

Returns a field broadcasted like other.

Field.order_as(*axis_order)

Returns a field with the axes in the given order.

Field.tag(*names)

Returns a Field with attached coordinates to the positional axes.

Field.untag(*axis_order)

Returns a view of the field with the requested axes made positional.

Field.unwrap(*names)

Extracts underlying data from a field without named dimensions.

field(array, *names)

Wraps a positional array as a Field.

cmap(fun[, out_axes, vmap])

Vectorizes fun over coordinate dimensions of Field inputs.

cpmap(fun, *[, vmap])

Coordinate preserving cmap.

tag(tree, *dims)

Tag dimensions on all fields in a PyTree.

untag(tree, *dims[, allow_missing])

Untag dimensions from all fields in a PyTree.

is_field(value)

Returns True if value is of type Field.

get_coordinate(field, *[, missing_axes])

Returns a single coordinate for a field.

new_axis_name(field[, excluded_names])

Returns axis name that is not present in field or excluded_names.

shape_struct_field(*axes)

Returns a Field with axes and a ShapeDtypeStruct in place of data.

Coordinates

Coordinate()

Abstract class for coordinate objects.

CartesianProduct(coordinates)

Coordinate defined as the outer product of independent coordinates.

DummyAxis(name, size)

Dummy coordinate for dimensions without associated coordinate values.

LabeledAxis(name, ticks)

One dimensional coordinate with custom coordinate values.

Scalar()

Zero dimensional sentinel coordinate used to label scalar fields.

SizedAxis(name, size)

One dimensional coordinate with fixed size but no associated fields.

SelectedAxis(coordinate, axis)

Coordinate that exposes one dimension of a multidimensional coordinate.

coords.canonicalize(*coordinates)

Canonicalize coordinates into a minimum equivalent collection.

coords.compose(*coordinates)

Compose coordinates into a unified coordinate system.

coords.insert_axes(coordinate, indices_to_axes)

Returns coordinate with extra axes inserted at specified positions.

coords.replace_axes(coordinate, to_replace, ...)

Returns coordinate with to_replace replaced by replace_with.

Xarray compatibility

from_xarray(data_array[, coord_types])

Create a coordax.Field from an xarray.DataArray.

Field.to_xarray()

Convert this Field to an xarray.DataArray with NumPy array data.

coords.from_xarray(data_array[, coord_types])

Convert coordinates of an xarray.DataArray into coordax.Coordinate.

coords.NoCoordinateMatch(reason)

For use when no Coordax coordinate matches xarray coordinate.

Testing

testing.assert_fields_allclose(actual, desired)

Asserts that two ``Field``s are close and have matching coordinates.

testing.assert_fields_equal(actual, desired)

Asserts that two ``Field``s are equal and have matching coordinates.

testing.assert_field_properties(actual[, ...])

Asserts that a Field has expected properties.

Experimental

NDArray()

Abstract base class for non-JAX arrays that can be used with Coordax.

register_ndarray(array_type, ...)

Registers a new duck-typed array type corresponding to a numpy dtype.