pyre.grid

Package Contents

class pyre.grid.grid(shape, layout=None, value=None, data=None, **kwds)

A logically cartesian grid

enumerate(self)

Visit the entire grid in layout order returning ({index}, {value}) pairs

__getitem__(self, index)

Return the value stored at {index}

__setitem__(self, index, value)

Return the value stored at {index}

__len__(self)

Compute my length

class pyre.grid.tile(shape, layout=None, **kwds)

Encapsulation of the shape and layout of the contents of a grid that enable the separation of the topological aspects of a grid from its memory layout

Tiles are defined by providing two pieces of information

  • {shape}: a tuple of the extent of each grid index
  • {layout}: the packing order of the indices
shape = []
layout = []
size = 0
offset(self, index)

Compute the offset of the cell at the given {index} value

index(self, offset)

Compute the index that corresponds to the given {offset}

visit(self, begin, end, layout)

Generate a sequence of indices in the range {begin} to {end} in {layout} order

__getitem__(self, index)
__iter__(self)