libmuscle.grid module

class libmuscle.grid.Grid(array: ndarray, indexes: List[str] | None = None)[source]

Bases: object

Represents a grid of data to send or receive.

Note that for received grids, the array of data is a read-only NumPy array. If you have another array that you want to put the received data into, use np.copyto(dest, source) to copy the contents of the received array across into your destination array. If you don’t have an array yet and want a writable version of the received array, use array.copy() to create a writable copy. See the tutorial for examples.

array

An array of data

Type:

np.ndarray

indexes

The names of the array’s indexes.

Type:

Optional[List[str]]