CircularMappingArray class#

class laygo2.object.grid.CircularMappingArray(elements=array([0]), dtype=<class 'int'>)[source]#

Bases: CircularMapping

Multi-dimensional circular mapping class (index number expands infinitely).

Public Data Attributes:

Inherited from CircularMapping

elements

getter of elements.

shape

The shape of circular mapping.

Public Methods:

__getitem__(pos)

Element access function.

flip(axis)

Flip the elements of the object.

copy()

Copy the object.

Inherited from CircularMapping

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)


dtype#

alias of int

__init__(elements=array([0]), dtype=<class 'int'>)#

Constructor function of CircularMapping class.

Parameters:
  • elements (list) – elements.

  • dtype (type) – data type of elements.

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]
_images/object_grid_CircularMapping_init.png
append(elem)#

Append elements to the mapping.

concatenate(obj)#
copy()[source]#

Copy the object.

flip(axis)[source]#

Flip the elements of the object.

get_elements()#

numpy.ndarray: getter of elements.

set_elements(value)#

numpy.ndarray: setter of elements.

summarize()#

Return the summary of the object information.

_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]
_images/object_grid_CircularMapping_elements.png
Type:

list

property elements#

getter of elements.

Type:

numpy.ndarray

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])
_images/object_grid_CircularMapping_shape.png
Type:

numpy.ndarray