pyedb 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pyedb might be problematic. Click here for more details.

Files changed (128) hide show
  1. pyedb/__init__.py +17 -0
  2. pyedb/dotnet/__init__.py +0 -0
  3. pyedb/dotnet/application/Variables.py +2261 -0
  4. pyedb/dotnet/application/__init__.py +0 -0
  5. pyedb/dotnet/clr_module.py +103 -0
  6. pyedb/dotnet/edb.py +4237 -0
  7. pyedb/dotnet/edb_core/__init__.py +1 -0
  8. pyedb/dotnet/edb_core/cell/__init__.py +0 -0
  9. pyedb/dotnet/edb_core/cell/hierarchy/__init__.py +0 -0
  10. pyedb/dotnet/edb_core/cell/hierarchy/model.py +66 -0
  11. pyedb/dotnet/edb_core/components.py +2669 -0
  12. pyedb/dotnet/edb_core/configuration.py +423 -0
  13. pyedb/dotnet/edb_core/definition/__init__.py +0 -0
  14. pyedb/dotnet/edb_core/definition/component_def.py +166 -0
  15. pyedb/dotnet/edb_core/definition/component_model.py +30 -0
  16. pyedb/dotnet/edb_core/definition/definition_obj.py +18 -0
  17. pyedb/dotnet/edb_core/definition/definitions.py +12 -0
  18. pyedb/dotnet/edb_core/dotnet/__init__.py +0 -0
  19. pyedb/dotnet/edb_core/dotnet/database.py +1218 -0
  20. pyedb/dotnet/edb_core/dotnet/layout.py +238 -0
  21. pyedb/dotnet/edb_core/dotnet/primitive.py +1517 -0
  22. pyedb/dotnet/edb_core/edb_data/__init__.py +0 -0
  23. pyedb/dotnet/edb_core/edb_data/components_data.py +938 -0
  24. pyedb/dotnet/edb_core/edb_data/connectable.py +113 -0
  25. pyedb/dotnet/edb_core/edb_data/control_file.py +1268 -0
  26. pyedb/dotnet/edb_core/edb_data/design_options.py +35 -0
  27. pyedb/dotnet/edb_core/edb_data/edbvalue.py +45 -0
  28. pyedb/dotnet/edb_core/edb_data/hfss_extent_info.py +330 -0
  29. pyedb/dotnet/edb_core/edb_data/hfss_simulation_setup_data.py +1607 -0
  30. pyedb/dotnet/edb_core/edb_data/layer_data.py +576 -0
  31. pyedb/dotnet/edb_core/edb_data/nets_data.py +281 -0
  32. pyedb/dotnet/edb_core/edb_data/obj_base.py +19 -0
  33. pyedb/dotnet/edb_core/edb_data/padstacks_data.py +2080 -0
  34. pyedb/dotnet/edb_core/edb_data/ports.py +287 -0
  35. pyedb/dotnet/edb_core/edb_data/primitives_data.py +1397 -0
  36. pyedb/dotnet/edb_core/edb_data/simulation_configuration.py +2914 -0
  37. pyedb/dotnet/edb_core/edb_data/simulation_setup.py +716 -0
  38. pyedb/dotnet/edb_core/edb_data/siwave_simulation_setup_data.py +1205 -0
  39. pyedb/dotnet/edb_core/edb_data/sources.py +514 -0
  40. pyedb/dotnet/edb_core/edb_data/terminals.py +632 -0
  41. pyedb/dotnet/edb_core/edb_data/utilities.py +148 -0
  42. pyedb/dotnet/edb_core/edb_data/variables.py +91 -0
  43. pyedb/dotnet/edb_core/general.py +181 -0
  44. pyedb/dotnet/edb_core/hfss.py +1646 -0
  45. pyedb/dotnet/edb_core/layout.py +1244 -0
  46. pyedb/dotnet/edb_core/layout_validation.py +272 -0
  47. pyedb/dotnet/edb_core/materials.py +939 -0
  48. pyedb/dotnet/edb_core/net_class.py +335 -0
  49. pyedb/dotnet/edb_core/nets.py +1215 -0
  50. pyedb/dotnet/edb_core/padstack.py +1389 -0
  51. pyedb/dotnet/edb_core/siwave.py +1427 -0
  52. pyedb/dotnet/edb_core/stackup.py +2703 -0
  53. pyedb/edb_logger.py +396 -0
  54. pyedb/generic/__init__.py +0 -0
  55. pyedb/generic/constants.py +1063 -0
  56. pyedb/generic/data_handlers.py +320 -0
  57. pyedb/generic/design_types.py +104 -0
  58. pyedb/generic/filesystem.py +150 -0
  59. pyedb/generic/general_methods.py +1535 -0
  60. pyedb/generic/plot.py +1840 -0
  61. pyedb/generic/process.py +285 -0
  62. pyedb/generic/settings.py +224 -0
  63. pyedb/ipc2581/__init__.py +0 -0
  64. pyedb/ipc2581/bom/__init__.py +0 -0
  65. pyedb/ipc2581/bom/bom.py +21 -0
  66. pyedb/ipc2581/bom/bom_item.py +32 -0
  67. pyedb/ipc2581/bom/characteristics.py +37 -0
  68. pyedb/ipc2581/bom/refdes.py +16 -0
  69. pyedb/ipc2581/content/__init__.py +0 -0
  70. pyedb/ipc2581/content/color.py +38 -0
  71. pyedb/ipc2581/content/content.py +55 -0
  72. pyedb/ipc2581/content/dictionary_color.py +29 -0
  73. pyedb/ipc2581/content/dictionary_fill.py +28 -0
  74. pyedb/ipc2581/content/dictionary_line.py +30 -0
  75. pyedb/ipc2581/content/entry_color.py +13 -0
  76. pyedb/ipc2581/content/entry_line.py +14 -0
  77. pyedb/ipc2581/content/fill.py +15 -0
  78. pyedb/ipc2581/content/layer_ref.py +10 -0
  79. pyedb/ipc2581/content/standard_geometries_dictionary.py +72 -0
  80. pyedb/ipc2581/ecad/__init__.py +0 -0
  81. pyedb/ipc2581/ecad/cad_data/__init__.py +0 -0
  82. pyedb/ipc2581/ecad/cad_data/assembly_drawing.py +26 -0
  83. pyedb/ipc2581/ecad/cad_data/cad_data.py +37 -0
  84. pyedb/ipc2581/ecad/cad_data/component.py +41 -0
  85. pyedb/ipc2581/ecad/cad_data/drill.py +30 -0
  86. pyedb/ipc2581/ecad/cad_data/feature.py +54 -0
  87. pyedb/ipc2581/ecad/cad_data/layer.py +41 -0
  88. pyedb/ipc2581/ecad/cad_data/layer_feature.py +151 -0
  89. pyedb/ipc2581/ecad/cad_data/logical_net.py +32 -0
  90. pyedb/ipc2581/ecad/cad_data/outline.py +25 -0
  91. pyedb/ipc2581/ecad/cad_data/package.py +104 -0
  92. pyedb/ipc2581/ecad/cad_data/padstack_def.py +38 -0
  93. pyedb/ipc2581/ecad/cad_data/padstack_hole_def.py +24 -0
  94. pyedb/ipc2581/ecad/cad_data/padstack_instance.py +62 -0
  95. pyedb/ipc2581/ecad/cad_data/padstack_pad_def.py +26 -0
  96. pyedb/ipc2581/ecad/cad_data/path.py +89 -0
  97. pyedb/ipc2581/ecad/cad_data/phy_net.py +80 -0
  98. pyedb/ipc2581/ecad/cad_data/pin.py +31 -0
  99. pyedb/ipc2581/ecad/cad_data/polygon.py +169 -0
  100. pyedb/ipc2581/ecad/cad_data/profile.py +40 -0
  101. pyedb/ipc2581/ecad/cad_data/stackup.py +31 -0
  102. pyedb/ipc2581/ecad/cad_data/stackup_group.py +42 -0
  103. pyedb/ipc2581/ecad/cad_data/stackup_layer.py +21 -0
  104. pyedb/ipc2581/ecad/cad_data/step.py +275 -0
  105. pyedb/ipc2581/ecad/cad_header.py +33 -0
  106. pyedb/ipc2581/ecad/ecad.py +19 -0
  107. pyedb/ipc2581/ecad/spec.py +46 -0
  108. pyedb/ipc2581/history_record.py +37 -0
  109. pyedb/ipc2581/ipc2581.py +387 -0
  110. pyedb/ipc2581/logistic_header.py +25 -0
  111. pyedb/misc/__init__.py +0 -0
  112. pyedb/misc/aedtlib_personalib_install.py +14 -0
  113. pyedb/misc/downloads.py +322 -0
  114. pyedb/misc/misc.py +67 -0
  115. pyedb/misc/pyedb.runtimeconfig.json +13 -0
  116. pyedb/misc/siw_feature_config/__init__.py +0 -0
  117. pyedb/misc/siw_feature_config/emc/__init__.py +0 -0
  118. pyedb/misc/siw_feature_config/emc/component_tags.py +46 -0
  119. pyedb/misc/siw_feature_config/emc/net_tags.py +37 -0
  120. pyedb/misc/siw_feature_config/emc/tag_library.py +62 -0
  121. pyedb/misc/siw_feature_config/emc/xml_generic.py +78 -0
  122. pyedb/misc/siw_feature_config/emc_rule_checker_settings.py +179 -0
  123. pyedb/misc/utilities.py +27 -0
  124. pyedb/modeler/geometry_operators.py +2082 -0
  125. pyedb-0.2.0.dist-info/LICENSE +21 -0
  126. pyedb-0.2.0.dist-info/METADATA +208 -0
  127. pyedb-0.2.0.dist-info/RECORD +128 -0
  128. pyedb-0.2.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,148 @@
1
+ class EDBStatistics(object):
2
+ """Statistics object
3
+
4
+ Object properties example.
5
+ >>> stat_model = EDBStatistics()
6
+ >>> stat_model.num_capacitors
7
+ >>> stat_model.num_resistors
8
+ >>> stat_model.num_inductors
9
+ >>> stat_model.layout_size
10
+ >>> stat_model.num_discrete_components
11
+ >>> stat_model.num_inductors
12
+ >>> stat_model.num_resistors
13
+ >>> stat_model.num_capacitors
14
+ >>> stat_model.num_nets
15
+ >>> stat_model.num_traces
16
+ >>> stat_model.num_polygons
17
+ >>> stat_model.num_vias
18
+ >>> stat_model.stackup_thickness
19
+ >>> stat_model.occupying_surface
20
+ >>> stat_model.occupying_ratio
21
+ """
22
+
23
+ def __init__(self):
24
+ self._nb_layer = 0
25
+ self._stackup_thickness = 0.0
26
+ self._nb_vias = 0
27
+ self._occupying_ratio = 0.0
28
+ self._occupying_surface = 0.0
29
+ self._layout_size = [0.0, 0.0, 0.0, 0.0]
30
+ self._nb_polygons = 0
31
+ self._nb_traces = 0
32
+ self._nb_nets = 0
33
+ self._nb_discrete_components = 0
34
+ self._nb_inductors = 0
35
+ self._nb_capacitors = 0
36
+ self._nb_resistors = 0
37
+
38
+ @property
39
+ def num_layers(self):
40
+ return self._nb_layer
41
+
42
+ @num_layers.setter
43
+ def num_layers(self, value):
44
+ if isinstance(value, int):
45
+ self._nb_layer = value
46
+
47
+ @property
48
+ def stackup_thickness(self):
49
+ return self._stackup_thickness
50
+
51
+ @stackup_thickness.setter
52
+ def stackup_thickness(self, value):
53
+ if isinstance(value, float):
54
+ self._stackup_thickness = value
55
+
56
+ @property
57
+ def num_vias(self):
58
+ return self._nb_vias
59
+
60
+ @num_vias.setter
61
+ def num_vias(self, value):
62
+ if isinstance(value, int):
63
+ self._nb_vias = value
64
+
65
+ @property
66
+ def occupying_ratio(self):
67
+ return self._occupying_ratio
68
+
69
+ @occupying_ratio.setter
70
+ def occupying_ratio(self, value):
71
+ if isinstance(value, float):
72
+ self._occupying_ratio = value
73
+
74
+ @property
75
+ def occupying_surface(self):
76
+ return self._occupying_surface
77
+
78
+ @occupying_surface.setter
79
+ def occupying_surface(self, value):
80
+ if isinstance(value, float):
81
+ self._occupying_surface = value
82
+
83
+ @property
84
+ def layout_size(self):
85
+ return self._layout_size
86
+
87
+ @property
88
+ def num_polygons(self):
89
+ return self._nb_polygons
90
+
91
+ @num_polygons.setter
92
+ def num_polygons(self, value):
93
+ if isinstance(value, int):
94
+ self._nb_polygons = value
95
+
96
+ @property
97
+ def num_traces(self):
98
+ return self._nb_traces
99
+
100
+ @num_traces.setter
101
+ def num_traces(self, value):
102
+ if isinstance(value, int):
103
+ self._nb_traces = value
104
+
105
+ @property
106
+ def num_nets(self):
107
+ return self._nb_nets
108
+
109
+ @num_nets.setter
110
+ def num_nets(self, value):
111
+ if isinstance(value, int):
112
+ self._nb_nets = value
113
+
114
+ @property
115
+ def num_discrete_components(self):
116
+ return self._nb_discrete_components
117
+
118
+ @num_discrete_components.setter
119
+ def num_discrete_components(self, value):
120
+ if isinstance(value, int):
121
+ self._nb_discrete_components = value
122
+
123
+ @property
124
+ def num_inductors(self):
125
+ return self._nb_inductors
126
+
127
+ @num_inductors.setter
128
+ def num_inductors(self, value):
129
+ if isinstance(value, int):
130
+ self._nb_inductors = value
131
+
132
+ @property
133
+ def num_capacitors(self):
134
+ return self._nb_capacitors
135
+
136
+ @num_capacitors.setter
137
+ def num_capacitors(self, value):
138
+ if isinstance(value, int):
139
+ self._nb_capacitors = value
140
+
141
+ @property
142
+ def num_resistors(self):
143
+ return self._nb_resistors
144
+
145
+ @num_resistors.setter
146
+ def num_resistors(self, value):
147
+ if isinstance(value, int):
148
+ self._nb_resistors = value
@@ -0,0 +1,91 @@
1
+ class Variable:
2
+ """Manages EDB methods for variable accessible from `Edb.Utility.VariableServer` property."""
3
+
4
+ def __init__(self, pedb, name):
5
+ self._pedb = pedb
6
+ self._name = name
7
+
8
+ @property
9
+ def _is_design_varible(self):
10
+ """Determines whether this variable is a design variable."""
11
+ if self.name.startswith("$"):
12
+ return False
13
+ else:
14
+ return True
15
+
16
+ @property
17
+ def _var_server(self):
18
+ if self._is_design_varible:
19
+ return self._pedb.active_cell.GetVariableServer()
20
+ else:
21
+ return self._pedb.active_db.GetVariableServer()
22
+
23
+ @property
24
+ def name(self):
25
+ """Get the name of this variable."""
26
+ return self._name
27
+
28
+ @property
29
+ def value_string(self):
30
+ """Get/Set the value of this variable.
31
+
32
+ Returns
33
+ -------
34
+ str
35
+
36
+ """
37
+ return self._pedb.get_variable(self.name).tostring
38
+
39
+ @property
40
+ def value_object(self):
41
+ """Get/Set the value of this variable.
42
+
43
+ Returns
44
+ -------
45
+ :class:`pyedb.dotnet.edb_core.edb_data.edbvalue.EdbValue`
46
+ """
47
+ return self._pedb.get_variable(self.name)
48
+
49
+ @property
50
+ def value(self):
51
+ """Get the value of this variable.
52
+
53
+ Returns
54
+ -------
55
+ float
56
+ """
57
+ return self._pedb.get_variable(self.name).tofloat
58
+
59
+ @value.setter
60
+ def value(self, value):
61
+ self._pedb.change_design_variable_value(self.name, value)
62
+
63
+ @property
64
+ def description(self):
65
+ """Get the description of this variable."""
66
+ return self._var_server.GetVariableDescription(self.name)
67
+
68
+ @description.setter
69
+ def description(self, value):
70
+ self._var_server.SetVariableDescription(self.name, value)
71
+
72
+ @property
73
+ def is_parameter(self):
74
+ """Determine whether this variable is a parameter."""
75
+ return self._var_server.IsVariableParameter(self.name)
76
+
77
+ def delete(self):
78
+ """Delete this variable.
79
+
80
+ Returns
81
+ -------
82
+ bool
83
+ ``True`` when successful, ``False`` when failed.
84
+
85
+ Examples
86
+ --------
87
+ >>> from pyedb import Edb
88
+ >>> edb = Edb()
89
+ >>> edb.design_variables["new_variable"].delete()
90
+ """
91
+ return self._var_server.DeleteVariable(self.name)
@@ -0,0 +1,181 @@
1
+ """
2
+ This module contains EDB general methods and related methods.
3
+
4
+ """
5
+
6
+ from __future__ import absolute_import # noreorder
7
+
8
+ import logging
9
+
10
+ from pyedb.dotnet.clr_module import Dictionary, List, Tuple
11
+ from pyedb.generic.general_methods import is_ironpython, pyedb_function_handler
12
+
13
+ if not is_ironpython: # pragma: no cover
14
+ try:
15
+ from enum import Enum
16
+ except ImportError:
17
+ Enum = None
18
+ else: # pragma: no cover
19
+ Enum = object
20
+
21
+ logger = logging.getLogger(__name__)
22
+
23
+
24
+ @pyedb_function_handler()
25
+ def convert_netdict_to_pydict(dict_in):
26
+ """Convert a net dictionary to a Python dictionary.
27
+
28
+ Parameters
29
+ ----------
30
+ dict_in : dict
31
+ Net dictionary to convert.
32
+
33
+ Returns
34
+ -------
35
+ dict
36
+ Dictionary converted to Python.
37
+
38
+ """
39
+ pydict = {}
40
+ for key in dict_in.Keys:
41
+ pydict[key] = dict_in[key]
42
+ return pydict
43
+
44
+
45
+ @pyedb_function_handler()
46
+ def convert_pytuple_to_nettuple(_tuple):
47
+ """Convert a Python tuple into a .NET tuple.
48
+ Parameters
49
+ ----------
50
+ tuple : Python tuple
51
+
52
+ Returns
53
+ -------
54
+ .NET tuple.
55
+ """
56
+ return Tuple.Create(_tuple[0], _tuple[1])
57
+
58
+
59
+ @pyedb_function_handler()
60
+ def convert_pydict_to_netdict(input_dict):
61
+ """Convert a Python dictionary to a .NET dictionary.
62
+
63
+ Parameters
64
+ ----------
65
+ input_dict : dict
66
+ Python dictionary to convert.
67
+
68
+
69
+ Returns
70
+ -------
71
+ dict
72
+ Dictionary converted to .NET.
73
+ """
74
+ net_dict = Dictionary[type(list(input_dict.keys())[0]), type(list(input_dict.values())[0])]()
75
+ for k1, v1 in input_dict.items(): # pragma: no cover
76
+ net_dict[k1] = v1
77
+ return net_dict
78
+ # to be completed
79
+
80
+
81
+ @pyedb_function_handler()
82
+ def convert_py_list_to_net_list(pylist, list_type=None):
83
+ """Convert a Python list to a Net list.
84
+
85
+ Parameters
86
+ ----------
87
+ pylist : list
88
+ Python list to convert.
89
+
90
+ Returns
91
+ -------
92
+ list
93
+ List converted to Net.
94
+ """
95
+ if not isinstance(pylist, (list, tuple)):
96
+ pylist = [pylist]
97
+ ls = list([type(item) for item in pylist])
98
+ if len(ls) > 0:
99
+ if list_type:
100
+ net_list = List[list_type]()
101
+ else:
102
+ net_list = List[ls[0]]()
103
+ for el in pylist:
104
+ net_list.Add(el)
105
+ return net_list
106
+
107
+
108
+ @pyedb_function_handler()
109
+ def convert_net_list_to_py_list(netlist):
110
+ """Convert a Net list to a Python list.
111
+
112
+ Parameters
113
+ ----------
114
+ netlist : list
115
+ Net list to convert.
116
+
117
+
118
+ Returns
119
+ -------
120
+ list
121
+ List converted to Python.
122
+ """
123
+ pylist = []
124
+ for el in netlist:
125
+ pylist.__add__(el)
126
+ return pylist
127
+
128
+
129
+ class PadGeometryTpe(Enum): # pragma: no cover
130
+ Circle = 1
131
+ Square = 2
132
+ Rectangle = 3
133
+ Oval = 4
134
+ Bullet = 5
135
+ NSidedPolygon = 6
136
+ Polygon = 7
137
+ Round45 = 8
138
+ Round90 = 9
139
+ Square45 = 10
140
+ Square90 = 11
141
+ InvalidGeometry = 12
142
+
143
+
144
+ class DielectricExtentType(Enum):
145
+ BoundingBox = 0
146
+ Conforming = 1
147
+ ConvexHull = 2
148
+ Polygon = 3
149
+
150
+
151
+ class Primitives(Enum):
152
+ Rectangle = 0
153
+ Circle = 1
154
+ Polygon = 2
155
+ Path = 3
156
+ Bondwire = 4
157
+ PrimitivePlugin = 5
158
+ Text = 6
159
+ Path3D = 7
160
+ BoardBendDef = 8
161
+ InValidType = 9
162
+
163
+
164
+ class LayoutObjType(Enum):
165
+ InvalidLayoutObj = -1
166
+ Primitive = 0
167
+ PadstackInstance = 1
168
+ Terminal = 2
169
+ TerminalInstance = 3
170
+ CellInstance = 4
171
+ Layer = 5
172
+ Net = 6
173
+ Padstack = 7
174
+ Group = 8
175
+ NetClass = 9
176
+ Cell = 10
177
+ DifferentialPair = 11
178
+ PinGroup = 12
179
+ VoltageRegulator = 13
180
+ ExtendedNet = 14
181
+ LayoutObjTypeCount = 15