-
-
Notifications
You must be signed in to change notification settings - Fork 128
/
__init__.py
96 lines (83 loc) · 2.58 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
######################################################################
# #
# Copyright 2009 Lucas Heitzmann Gabrielli. #
# This file is part of gdspy, distributed under the terms of the #
# Boost Software License - Version 1.0. See the accompanying #
# LICENSE file or <http://www.boost.org/LICENSE_1_0.txt> #
# #
######################################################################
"""
gdspy is a Python module that allows the creation of GDSII stream files.
Most features of the GDSII format are implemented, including support for
polygons with any number of vertices.
GDSII format references:
- http://boolean.klaasholwerda.nl/interface/bnf/gdsformat.html
- http://www.artwork.com/gdsii/gdsii/
- http://www.buchanan1.net/stream_description.html
"""
__version__ = "1.6.10"
import warnings
from gdspy.library import (
Cell,
CellReference,
CellArray,
GdsLibrary,
GdsWriter,
get_gds_units,
get_binary_cells,
)
from gdspy.curve import Curve
from gdspy.label import Label
from gdspy.path import FlexPath, RobustPath
from gdspy.polygon import (
PolygonSet,
Polygon,
Rectangle,
Round,
Text,
Path,
PolyPath,
L1Path,
)
from gdspy.gdsiiformat import gdsii_hash, set_gdsii_timestamp
from gdspy.operation import slice, offset, boolean, inside, copy
try:
from gdspy.viewer import LayoutViewer
except ImportError as e:
warnings.warn(
"[GDSPY] LayoutViewer not available: " + str(e),
category=ImportWarning,
stacklevel=1,
)
def fast_boolean(*args, **kwargs):
"""
.. deprecated:: 1.5
`fast_boolean` is deprecated in favor of `boolean` and will be
removed in a future version of Gdspy.
"""
warnings.warn(
"[GDSPY] fast_boolean is deprecated. Use boolean instead.",
category=DeprecationWarning,
stacklevel=1,
)
return boolean(*args, **kwargs)
def write_gds(
outfile,
cells=None,
name="library",
unit=1.0e-6,
precision=1.0e-9,
timestamp=None,
binary_cells=None,
):
warnings.warn(
"[GDSPY] write_gds and the global library is deprecated. "
"Use GdsLibrary.write_gds instead.",
category=DeprecationWarning,
stacklevel=1,
)
current_library.name = name
current_library.unit = unit
current_library.precision = precision
current_library.write_gds(outfile, cells, timestamp, binary_cells)
current_library = GdsLibrary()