CircularMapping class#
- class laygo2.object.grid.CircularMapping(elements=array([0]), dtype=<class 'int'>)[source]#
Bases:
object
Basic circular mapping class (index number expands infinitely).
Example
>>> from laygo2.object.grid import Circularmapping >>> map = CircularMapping(elements=[100, 200, 300]) >>> print(map[0]) 100 >>> print(map[2]) 300 >>> print(map[4]) 200 >>> print(map[-3]) 100 >>> print(map[[2, 3, -2]) [300, 100, 200] >>> print(map[2:7]) [300, 100, 200, 300, 100]
Public Data Attributes:
elements
getter of elements.
shape
The shape of circular mapping.
Public Methods:
get_elements
()numpy.ndarray: getter of elements.
set_elements
(value)numpy.ndarray: setter of elements.
__init__
([elements, dtype])Constructor function of CircularMapping class.
__getitem__
(pos)Element access function of circular mapping.
__iter__
()Iteration function of circular mapping.
__next__
()Next element access function of circular mapping.
__str__
()Return str(self).
summarize
()Return the summary of the object information.
append
(elem)Append elements to the mapping.
flip
()Flip the elements of the object.
copy
()Copy the object.
concatenate
(obj)
- __init__(elements=array([0]), dtype=<class 'int'>)[source]#
Constructor function of CircularMapping class.
Example
>>> from laygo2.object.grid import CircularMapping >>> elements = [0, 35, 85, 130, 180] >>> cm = CircularMapping(elements) >>> cm.shape [5] >>> cm[5] 35 >>> cm[0:10] [0, 35, 85, 130, 0, 35, 85, 130, 0, 35]
- _elements = None#
Array consisting of the elements of circular mapping.
Example
>>> from laygo2.object.grid import CircularMapping >>> elements = [0, 35, 85, 130, 180] >>> cm = CircularMapping(elements) >>> cm.elements [0, 35, 85, 130, 180]
- Type:
- property elements#
the array that contains the physical coordinates of the grid.
- Type:
- property shape#
The shape of circular mapping.
Example
>>> from laygo2.object.grid import CircularMapping >>> elements = [0, 35, 85, 130, 180] >>> cm = CircularMapping(elements) >>> cm.shape array([5])
- Type: