UniformGrid

class trainsum.uniformgrid.UniformGrid(dim: Dimension, domain: Domain, /)
class trainsum.uniformgrid.UniformGrid(dims: Sequence[Dimension], domains: Sequence[Domain], /)

Uniform spaced N-dimensional grid. The grid associates a dimension and a domain to each axis. The grid can be used to convert between coordinate and index representations of points in the grid.

Parameters:
to_coords(idxs)

Convert from index representation to coordinate representation.

Parameters:

idxs (T)

Return type:

T

to_idxs(coords)

Convert from coordinate representation to index representation.

Parameters:

coords (T)

Return type:

T