Library
Source code in gdsr/_gdsr.pyi
783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 |
|
__init__
add
add(*cells: Cell, replace_pre_existing: bool = False) -> None
Add cells to the library.
The cells that are added are not copied and are added by reference. This means that modifying the cells after adding them to the library will also modify the cells in the library.
If replace_pre_existing is True, this will also look at cells in references and add those to the library as well.
Parameters:
-
cells
(Cell
, default:()
) –Cells to add to the library.
-
replace_pre_existing
(bool
, default:False
) –Replace pre-existing cells with the same name, defaults to False. If this is False and a cell with the same name already exists in the library, a ValueError will be raised.
python import gdsr lib = gdsr.Library() cell = gdsr.Cell("cell") lib.add(cell) cell_from_lib = lib.cells["cell"] cell_from_lib.add(gdsr.Polygon([(0, 0), (1, 0), (1, 1), (0, 1)])) assert cell is cell_from_lib
Source code in gdsr/_gdsr.pyi
remove
remove(*cells: Cell) -> None
contains
contains(cell: Cell) -> bool
copy
Return a copy of the library.
Parameters:
-
deep
(bool
, default:False
) –If True, a deep copy is returned, defaults to False.
to_gds
Write the Library to a GDS file.
Parameters:
-
file_name
(PathLike
, default:None
) –Output GDS file name.
-
units
(float
, default:1e-06
) –GDS file units in meters, defaults to 1e-6.
-
precision
(float
, default:1e-10
) –GDS file precision, defaults to 1e-10.
Returns:
-
str
–GDS file path
Source code in gdsr/_gdsr.pyi
from_gds
staticmethod
from_gds(file_name: PathLike) -> Library
Read a Library from a GDS file.
Parameters:
-
file_name
(PathLike
) –Input GDS file name.
Returns:
-
Library
–Library
__add__
__add__(other: Cell) -> Self
Add a cell to the library.
This simple calls the add method with the cell as an argument, and replace_pre_existing as True.
Parameters:
-
other
(Cell
) –Cell to add to the library. This can be used in the following way:
python import gdsr library = gdsr.Library() cell = gdsr.Cell("cell") library = library + cell # or library += cell # or library + cell
Source code in gdsr/_gdsr.pyi
__contains__
__contains__(cell: Cell) -> bool