UnstructuredCoords

class hcipy.field.UnstructuredCoords(coords, xp=None)[source]

Bases: Coords

An unstructured list of points.

Parameters:
coordslist or tuple

A tuple of a list of positions for each dimension.

xpmodule, optional

The array namespace (e.g., numpy, cupy, jax.numpy). If not provided, it will be inferred from the input arrays.

Attributes Summary

size

The number of points.

Methods Summary

from_dict(tree)

Make an UnstructuredCoords from a dictionary, previously created by to_dict().

reverse()

Reverse the ordering of points in-place.

to_dict()

Convert the object to a dictionary for serialization.

Attributes Documentation

size

The number of points.

Methods Documentation

classmethod from_dict(tree)[source]

Make an UnstructuredCoords from a dictionary, previously created by to_dict().

Parameters:
treedictionary

The dictionary from which to make a new UnstructuredCoords object.

Returns:
UnstructuredCoords

The created object.

Raises:
ValueError

If the dictionary is not formatted correctly.

reverse()[source]

Reverse the ordering of points in-place.

to_dict()[source]

Convert the object to a dictionary for serialization.

Returns:
dictionary

The created dictionary.