pacman.model.graphs.common package¶
Submodules¶
pacman.model.graphs.common.edge_traffic_type module¶
-
class
pacman.model.graphs.common.edge_traffic_type.
EdgeTrafficType
[source]¶ Bases:
enum.IntEnum
Indicates the traffic type of an Edge in a graph.
-
FIXED_ROUTE
= 2¶ Edge communicates using fixed route packets
-
MULTICAST
= 1¶ Edge communicates using multicast packets
-
SDRAM
= 3¶ Edge communicates using shared memory
-
Module contents¶
-
class
pacman.model.graphs.common.
ChipAndCore
(x, y, p=None)¶ Bases:
object
A constraint to place a vertex on a specific chip and, optionally, a specific core on that chip.
Parameters:
-
class
pacman.model.graphs.common.
MDSlice
(lo_atom, hi_atom, shape, start, atoms_shape)¶ Bases:
pacman.model.graphs.common.Slice
Represents a multi-dimensional slice of a vertex.
Parameters: - lo_atom (int) – Index of the lowest atom to represent.
- hi_atom (int) – Index of the highest atom to represent.
- shape (tuple(int,..)) – The size of each dimension in the slice.
- start (tuple(int,..)) – The offset to the start index along each dimension.
- atoms_shape (list(int)) – The shape of atoms (?)
Raises: PacmanValueError – If the bounds of the slice are invalid.
-
as_slice
¶ Converts the Slice to a standard slice object if possible.
Note
Use of this method is not recommended. It fails for multi-dimensional slices and may be removed.
Returns: a standard built-in slice object Return type: slice Raises: NotImplementedError – If called on a multi-dimensional slice
-
dimension
¶ Get directions or edges as slices for every dimension
This is the width and if available height, depth, etc., of the Slice/Grid as represented as slices form the origin along in that direction.
Return type: tuple(slice, ..)
-
classmethod
from_string
(as_str)[source]¶ Convert the string form of a
MDSlice
into an object instance.Parameters: as_str (str) – The string to parse Return type: MDSlice
-
get_ids_as_slice_or_list
()[source]¶ Returns the IDs as a built-in slice if possible, otherwise as a list of IDs.
Returns: a slice or list of IDs Return type: slice or list(int)
-
get_raster_ids
()[source]¶ Get the IDs of the atoms in the slice as they would appear in a “raster scan” of the atoms over the whole shape.
Returns: A list of the global raster IDs of the atoms in this slice Return type: ndarray
-
get_slice
(n)[source]¶ Get a slice in the n’th dimension
Parameters: n (int) – The 0-indexed dimension to get the shape of Type: slice
-
hi_atom
¶ The highest atom represented in the slice.
Note
Use of this method is not recommended. It fails for multi-dimensional slices and may be removed
Return type: int
-
class
pacman.model.graphs.common.
Slice
(lo_atom, hi_atom)¶ Bases:
object
Represents a simple single-dimensional slice of a vertex.
Note
Multi-dimensional slices are supported by
MDSlice
.Parameters: Raises: - PacmanTypeError – If non-integer arguments are used.
- PacmanValueError – If the bounds of the slice are invalid.
-
as_slice
¶ Converts the Slice to a standard slice object if possible.
Note
Use of this method is not recommended. It fails for multi-dimensional slices and may be removed.
Returns: a standard built-in slice object Return type: slice Raises: NotImplementedError – If called on a multi-dimensional slice
-
dimension
¶ Get directions or edges as slices for every dimension
This is the width and if available height, depth, etc., of the Slice/Grid as represented as slices form the origin along in that direction.
Return type: tuple(slice, ..)
-
classmethod
from_string
(as_str)[source]¶ Convert the string form of a
Slice
into an object instance.Parameters: as_str (str) – The string to parse Return type: Slice
-
get_ids_as_slice_or_list
()[source]¶ Returns the IDs as a built-in slice if possible, otherwise as a list of IDs.
Returns: a slice or list of IDs Return type: slice or list(int)
-
get_raster_ids
()[source]¶ Get the IDs of the atoms in the slice as they would appear in a “raster scan” of the atoms over the whole shape.
Returns: A list of the global raster IDs of the atoms in this slice Return type: ndarray
-
hi_atom
¶ The highest atom represented in the slice.
Note
Use of this method is not recommended. It fails for multi-dimensional slices and may be removed
Return type: int