mpi_array.indexing.IndexingExtent¶
-
class
mpi_array.indexing.
IndexingExtent
(slice=None, start=None, stop=None, struct=None)[source]¶ Bases:
object
Methods
__init__
([slice, start, stop, struct])Construct, must specify either slice
or both ofstart
andstop
.calc_intersection
(other)Returns the indexing extent which is the intersection of this extent with the other
extent.calc_intersection_split
(other)Returns (leftovers, intersection)
pair, whereintersection
is theIndexingExtent
object (possiblyNone
) indicating the intersection of this (self
) extent with theother
extent andleftovers
is a list ofIndexingExtent
objects indicating regions ofself
which do not intersect with theother
extent.create_struct_dtype_from_ndim
(ndim)Creates a numpy.dtype
structure for holding start and stop indices.create_struct_instance
(ndim)Creates a struct instance with numpy.dtype
self.struct_dtype_dict[ndim]
.get_struct_dtype
(ndim)get_struct_dtype_from_ndim
(ndim)split
(a, index)Split this extent into two extents by cutting along axis a
at indexindex
.to_slice
()Returns “ tuple
ofslice
” equivalent of this indexing extent.to_tuple
()Convert this instance to a tuple
which can be passed to constructor (or used as adict
key).Attributes
START
START_STR
STOP
STOP_STR
Indexing bounds for a single tile of domain decomposition. ndim
Dimension of indexing. shape
Sequence of int
indicating the shape of this extent (including halo).start
Sequence of int
indicating the per-axis start indices of this extent (including halo).stop
Sequence of int
indicating the per-axis stop indices of this extent (including halo).struct_dtype_dict