OneDimGrid class#

class laygo2.object.grid.OneDimGrid(name, scope, elements=array([0]))[source]#

Bases: laygo2.object.grid.core.CircularMapping

Class implementing one-dimensional abstract coordinates.

Notes

(Korean) 1차원 추상좌표를 구현하는 클래스.

Public Data Attributes:

name

Coordinate system name.

range

Region in which the coordinate system is defined Coordinates in the defined region are repeatedly expanded.

phy2abs

Object that converts physical coordinates into abstract coordinates.

abs2phy

Object that converts abstract coordinates into physical coordinates.

width

The size of the region in which the coordinate system is defined.

Inherited from CircularMapping

elements

getter of elements.

shape

The shape of circular mapping.

Public Methods:

__init__(name, scope[, elements])

Constructor function of OneDimGrid class.

__getitem__(pos)

Return the physical coordinate corresponding to the abstract coordinate pos.

__eq__(other)

Return the abstract grid coordinate that matches to other.

__lt__(other)

Return the abstract grid coordinate that is the largest but less than other.

__le__(other)

Return the index of the grid coordinate that is the largest but less than or equal to other.

__gt__(other)

Return the abstract grid coordinate that is the smallest but greater than other.

__ge__(other)

Return the index of the grid coordinate that is the smallest but greater than or equal to other.

__str__()

Return the string representation of the object.

summarize()

Return the summary of the object information.

export_to_dict()

Return dict object containing grid information.

flip()

Flip the elements of the object.

copy()

Copy the object.

concatenate(obj)

Inherited from CircularMapping

get_elements()

numpy.ndarray: getter of elements.

set_elements(value)

numpy.ndarray: setter of elements.

__init__(name, scope[, elements])

Constructor function of OneDimGrid class.

__getitem__(pos)

Return the physical coordinate corresponding to the abstract coordinate pos.

__iter__()

Iteration function of circular mapping.

__next__()

Next element access function of circular mapping.

__str__()

Return the string representation of the object.

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__(name, scope, elements=array([0]))[source]#

Constructor function of OneDimGrid class.

Parameters
  • name (str) –

  • scope (numpy.ndarray) – scope of one-dimensional coordinate system

  • elements (numpy.ndarray) – members of one-dimensional coordinate system

Return type

laygo2.OneDimGrid

Example

>>> from laygo2.object.grid import OneDimGrid
>>> g1_x = OneDimGrid(name='xgrid', scope=[0, 180], elements=[0, 35, 85, 130, 50])
>>> print(g1_x)
OneDimGrid object name: xgrid, class: OneDimGrid, scope: [0, 180], elements: [0, 35, 85, 130  50]
_images/object_grid_OneDimGrid_init.png

Notes

(Korean) OneDimGrid 클래스의 생성자함수.

append(elem)#

Append elements to the mapping.

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

Copy the object.

export_to_dict()[source]#

Return dict object containing grid information.

Parameters

None

Return type

dict

Example

>>> from laygo2.object.grid import OneDimGrid
>>> g1_x = OneDimGrid(name='xgrid', scope=[0, 180], elements=[0, 35, 85, 130, 50])
>>> g1_x.export_to_dict()
{'scope': [0, 180], 'elements': [0, 35, 85, 130, 50]}
_images/object_grid_OneDimGrid_export_to_dict.png

Notes

(Korean) 그리드의 정보를 담은 dict객체 반환.

flip()[source]#

Flip the elements of the object.

get_elements()#

numpy.ndarray: getter of elements.

set_elements(value)#

numpy.ndarray: setter of elements.

summarize()[source]#

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

Notes

(Korean) 순환 맵핑의 구성 요소로 이루어진 배열.

Type

list

abs2phy = None#

Object that converts abstract coordinates into physical coordinates.

Example

>>> from laygo2.object.grid import OneDimGrid
>>> g1_x = OneDimGrid(name='xgrid', scope=[0, 180], elements=[0, 35, 85, 130, 50])
>>> g1_x.abs2phy
<_AbsToPhyGridConverter object>

Notes

(Korean) 추상 좌표에서 물리 좌표로 변환연산을 해주는 객체.

Type

self.abs2phy (laygo2._AbsToPhyGridConverter)

property elements#

getter of elements.

Type

numpy.ndarray

name = None#

Coordinate system name.

Example

>>> from laygo2.object.grid import OneDimGrid
>>> g1_x = OneDimGrid(name='xgrid', scope=[0, 180], elements=[0, 35, 85, 130, 50])
>>> g1_x.name
"xgrid"
_images/object_grid_OneDimGrid_name.png

Notes

(Korean) 좌표계 이름.

Type

str

phy2abs = None#

Object that converts physical coordinates into abstract coordinates.

Example

>>> from laygo2.object.grid import OneDimGrid
>>> g1_x  = OneDimGrid(name='xgrid', scope=[0, 180], elements=[0, 35, 85, 130, 50])
>>> g1_x.phy2abs
<_PhyToAbsGridConverter object>

Notes

(Korean) 물리 좌표에서 추상 좌표로 변환연산을 해주는 객체.

Type

self.phy2abs (laygo2._PhyToAbsGridConverter)

range = None#

Region in which the coordinate system is defined Coordinates in the defined region are repeatedly expanded.

Example

>>> from laygo2.object.grid import OneDimGrid
>>> g1_x = OneDimGrid(name='xgrid', scope=[0, 180], elements=[0, 35, 85, 130, 50])
>>> g1_x.range
[0, 180]
_images/object_grid_OneDimGrid_range.png

Notes

(Korean) 좌표계가 정의된 영역. 정의된 영역의 좌표들이 반복되는 형태로 확장된다.

Type

str

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

Notes

(Korean) 순환 맵핑의 shape.

Type

numpy.ndarray

property width#

The size of the region in which the coordinate system is defined.

Example

>>> from laygo2.object.grid import OneDimGrid
>>> g1_x = OneDimGrid(name='xgrid', scope=[0, 180], elements=[0, 35, 85, 130, 50])
>>> g1_x.width
180
_images/object_grid_OneDimGrid_width.png

Notes

(Korean) 좌표계가 정의된 영역의 크기.

Type

int