pyedb 0.50.0__py3-none-any.whl → 0.51.2__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 (75) hide show
  1. pyedb/__init__.py +1 -1
  2. pyedb/configuration/cfg_ports_sources.py +79 -239
  3. pyedb/configuration/configuration.py +27 -0
  4. pyedb/dotnet/clr_module.py +9 -3
  5. pyedb/dotnet/database/cell/hierarchy/component.py +3 -3
  6. pyedb/dotnet/database/cell/layout.py +10 -1
  7. pyedb/dotnet/database/dotnet/database.py +0 -2
  8. pyedb/dotnet/database/edb_data/padstacks_data.py +13 -0
  9. pyedb/dotnet/database/layout_validation.py +17 -13
  10. pyedb/dotnet/database/modeler.py +0 -1
  11. pyedb/dotnet/edb.py +7 -1
  12. pyedb/generic/design_types.py +183 -62
  13. pyedb/grpc/database/components.py +604 -652
  14. pyedb/grpc/database/control_file.py +597 -155
  15. pyedb/grpc/database/definition/component_def.py +17 -14
  16. pyedb/grpc/database/definition/materials.py +27 -27
  17. pyedb/grpc/database/definition/package_def.py +8 -8
  18. pyedb/grpc/database/definition/padstack_def.py +31 -33
  19. pyedb/grpc/database/definitions.py +36 -2
  20. pyedb/grpc/database/geometry/arc_data.py +5 -5
  21. pyedb/grpc/database/geometry/point_3d_data.py +3 -3
  22. pyedb/grpc/database/geometry/polygon_data.py +5 -5
  23. pyedb/grpc/database/hfss.py +412 -395
  24. pyedb/grpc/database/hierarchy/component.py +67 -58
  25. pyedb/grpc/database/hierarchy/pin_pair_model.py +6 -6
  26. pyedb/grpc/database/hierarchy/pingroup.py +13 -11
  27. pyedb/grpc/database/hierarchy/s_parameter_model.py +1 -1
  28. pyedb/grpc/database/hierarchy/spice_model.py +1 -1
  29. pyedb/grpc/database/layers/layer.py +2 -2
  30. pyedb/grpc/database/layers/stackup_layer.py +26 -23
  31. pyedb/grpc/database/layout/layout.py +12 -12
  32. pyedb/grpc/database/layout/voltage_regulator.py +8 -8
  33. pyedb/grpc/database/layout_validation.py +58 -7
  34. pyedb/grpc/database/modeler.py +248 -245
  35. pyedb/grpc/database/net/differential_pair.py +4 -4
  36. pyedb/grpc/database/net/extended_net.py +7 -8
  37. pyedb/grpc/database/net/net.py +57 -46
  38. pyedb/grpc/database/nets.py +362 -116
  39. pyedb/grpc/database/padstacks.py +259 -178
  40. pyedb/grpc/database/ports/ports.py +23 -17
  41. pyedb/grpc/database/primitive/padstack_instance.py +45 -30
  42. pyedb/grpc/database/primitive/path.py +6 -6
  43. pyedb/grpc/database/primitive/polygon.py +9 -9
  44. pyedb/grpc/database/primitive/primitive.py +21 -21
  45. pyedb/grpc/database/primitive/rectangle.py +1 -1
  46. pyedb/grpc/database/simulation_setup/hfss_advanced_settings.py +1 -1
  47. pyedb/grpc/database/simulation_setup/hfss_general_settings.py +1 -1
  48. pyedb/grpc/database/simulation_setup/hfss_settings_options.py +1 -1
  49. pyedb/grpc/database/simulation_setup/hfss_simulation_settings.py +6 -6
  50. pyedb/grpc/database/simulation_setup/hfss_simulation_setup.py +2 -2
  51. pyedb/grpc/database/simulation_setup/raptor_x_simulation_settings.py +2 -2
  52. pyedb/grpc/database/simulation_setup/raptor_x_simulation_setup.py +1 -1
  53. pyedb/grpc/database/simulation_setup/siwave_simulation_setup.py +3 -3
  54. pyedb/grpc/database/siwave.py +226 -214
  55. pyedb/grpc/database/source_excitations.py +307 -40
  56. pyedb/grpc/database/stackup.py +461 -283
  57. pyedb/grpc/database/terminal/bundle_terminal.py +12 -12
  58. pyedb/grpc/database/terminal/edge_terminal.py +6 -5
  59. pyedb/grpc/database/terminal/padstack_instance_terminal.py +13 -13
  60. pyedb/grpc/database/terminal/pingroup_terminal.py +12 -12
  61. pyedb/grpc/database/terminal/point_terminal.py +6 -6
  62. pyedb/grpc/database/terminal/terminal.py +26 -26
  63. pyedb/grpc/database/utility/heat_sink.py +5 -5
  64. pyedb/grpc/database/utility/hfss_extent_info.py +21 -21
  65. pyedb/grpc/database/utility/layout_statistics.py +13 -13
  66. pyedb/grpc/database/utility/rlc.py +3 -3
  67. pyedb/grpc/database/utility/sources.py +1 -1
  68. pyedb/grpc/database/utility/sweep_data_distribution.py +1 -1
  69. pyedb/grpc/edb.py +542 -739
  70. pyedb/grpc/edb_init.py +50 -3
  71. {pyedb-0.50.0.dist-info → pyedb-0.51.2.dist-info}/METADATA +1 -1
  72. {pyedb-0.50.0.dist-info → pyedb-0.51.2.dist-info}/RECORD +74 -75
  73. pyedb/grpc/database/utility/simulation_configuration.py +0 -3305
  74. {pyedb-0.50.0.dist-info → pyedb-0.51.2.dist-info}/LICENSE +0 -0
  75. {pyedb-0.50.0.dist-info → pyedb-0.51.2.dist-info}/WHEEL +0 -0
@@ -304,20 +304,24 @@ class LayoutValidation:
304
304
 
305
305
  def illegal_rlc_values(self, fix=False):
306
306
  """Find and fix RLC illegal values."""
307
- inductors = self._pedb.components.inductors
308
307
 
309
- temp = []
310
- for k, v in inductors.items():
311
- componentProperty = v.edbcomponent.GetComponentProperty()
312
- model = componentProperty.GetModel().Clone()
313
- pinpairs = model.PinPairs
314
-
315
- if not len(list(pinpairs)): # pragma: no cover
316
- temp.append(k)
317
- if fix:
318
- v.rlc_values = [0, 1, 0]
319
-
320
- self._pedb._logger.info("Found {} inductors have no value.".format(len(temp)))
308
+ for name, objs in {
309
+ "inductors": self._pedb.components.inductors,
310
+ "resistors": self._pedb.components.resistors,
311
+ "capacitors": self._pedb.components.capacitors,
312
+ }.items():
313
+ temp = []
314
+ for k, v in objs.items():
315
+ componentProperty = v.edbcomponent.GetComponentProperty()
316
+ model = componentProperty.GetModel().Clone()
317
+ pinpairs = model.PinPairs
318
+
319
+ if not len(list(pinpairs)): # pragma: no cover
320
+ temp.append(k)
321
+ if fix:
322
+ v.rlc_values = [0, 1, 0]
323
+
324
+ self._pedb._logger.info(f"Found {len(temp)} {name} have no value.")
321
325
  return
322
326
 
323
327
  def padstacks_no_name(self, fix=False):
@@ -67,7 +67,6 @@ class Modeler(object):
67
67
 
68
68
  def __init__(self, p_edb):
69
69
  self._pedb = p_edb
70
- self._primitives = []
71
70
 
72
71
  @property
73
72
  def _edb(self):
pyedb/dotnet/edb.py CHANGED
@@ -25,6 +25,7 @@
25
25
  This module is implicitly loaded in HFSS 3D Layout when launched.
26
26
 
27
27
  """
28
+ from datetime import datetime
28
29
  from itertools import combinations
29
30
  import os
30
31
  from pathlib import Path
@@ -91,6 +92,7 @@ from pyedb.dotnet.database.utilities.siwave_simulation_setup import (
91
92
  SiwaveDCSimulationSetup,
92
93
  SiwaveSimulationSetup,
93
94
  )
95
+ from pyedb.edb_logger import pyedb_logger
94
96
  from pyedb.generic.constants import AEDT_UNITS, SolverType, unit_converter
95
97
  from pyedb.generic.general_methods import (
96
98
  generate_unique_name,
@@ -195,6 +197,10 @@ class Edb(Database):
195
197
  layer_filter: str = None,
196
198
  remove_existing_aedt: bool = False,
197
199
  ):
200
+ self._logger = pyedb_logger
201
+ now = datetime.now()
202
+ self.logger.info(f"Star initializing Edb {now.time()}")
203
+
198
204
  if isinstance(edbpath, Path):
199
205
  edbpath = str(edbpath)
200
206
 
@@ -290,7 +296,7 @@ class Edb(Database):
290
296
  self._logger.add_file_logger(self.log_name, "Edb")
291
297
  self.open_edb()
292
298
  if self.active_cell:
293
- self.logger.info("EDB initialized.")
299
+ self.logger.info(f"EDB initialized.Time lapse {datetime.now() - now}")
294
300
  else:
295
301
  raise AttributeError("Failed to initialize DLLs.")
296
302
 
@@ -37,79 +37,200 @@ def Edb(
37
37
  ):
38
38
  """Provides the EDB application interface.
39
39
 
40
- This module inherits all objects that belong to EDB.
41
-
42
- Parameters
43
- ----------
44
- edbpath : str, optional
45
- Full path to the ``aedb`` folder. The variable can also contain
46
- the path to a layout to import. Allowed formats are BRD,
47
- XML (IPC2581), GDS, and DXF. The default is ``None``.
48
- For GDS import, the Ansys control file (also XML) should have the same
49
- name as the GDS file. Only the file extension differs.
50
- cellname : str, optional
51
- Name of the cell to select. The default is ``None``.
52
- isreadonly : bool, optional
53
- Whether to open EBD in read-only mode when it is
54
- owned by HFSS 3D Layout. The default is ``False``.
55
- edbversion : str, optional
56
- Version of EDB to use. The default is ``"2021.2"``.
57
- isaedtowned : bool, optional
58
- Whether to launch EDB from HFSS 3D Layout. The
59
- default is ``False``.
60
- oproject : optional
61
- Reference to the AEDT project object.
62
- student_version : bool, optional
63
- Whether to open the AEDT student version. The default is ``False.``
64
- technology_file : str, optional
65
- Full path to technology file to be converted to xml before importing or xml. Supported by GDS format only.
66
- grpc : bool, optional
67
- Whether to enable gRPC. Default value is ``False``.
68
-
69
- Returns
70
- -------
71
- :class:`Edb <pyedb.dotnet.edb.Edb>` or :class:`Edb <pyedb.grpc.edb.Edb>`
72
-
73
- Note
74
- ----
75
- PyEDB gRPC will be released starting ANSYS release 2025R2. For legacy purpose, the gRPC will not be activated by
76
- default. However, PyEDB gRPC will be the lon term supported version. The legacy PyEDB .NET will be deprecated and
77
- at some point all new features will only be implemented in PyEDB gRPC. We highly encourage users moving to gRPC
78
- starting release 2025R2, we tried keeping gRPC version backward compatible with legace .NET as much as possible and
79
- only minor adjustments are required to be compatible.
80
-
81
- Examples
82
- --------
83
- Create an ``Edb`` object and a new EDB cell.
40
+ This module inherits all objects that belong to EDB.
41
+
42
+ Parameters
43
+ ----------
44
+ edbpath : str, optional
45
+ Full path to the ``aedb`` folder. The variable can also contain
46
+ the path to a layout to import. Allowed formats are BRD,
47
+ XML (IPC2581), GDS, and DXF. The default is ``None``.
48
+ For GDS import, the Ansys control file (also XML) should have the same
49
+ name as the GDS file. Only the file extension differs.
50
+ cellname : str, optional
51
+ Name of the cell to select. The default is ``None``.
52
+ isreadonly : bool, optional
53
+ Whether to open EBD in read-only mode when it is
54
+ owned by HFSS 3D Layout. The default is ``False``.
55
+ edbversion : str, optional
56
+ Version of EDB to use. The default is ``"2021.2"``.
57
+ isaedtowned : bool, optional
58
+ Whether to launch EDB from HFSS 3D Layout. The
59
+ default is ``False``.
60
+ oproject : optional
61
+ Reference to the AEDT project object.
62
+ student_version : bool, optional
63
+ Whether to open the AEDT student version. The default is ``False.``
64
+ technology_file : str, optional
65
+ Full path to technology file to be converted to xml before importing or xml. Supported by GDS format only.
66
+ grpc : bool, optional
67
+ Whether to enable gRPC. Default value is ``False``.
68
+
69
+ Returns
70
+ -------
71
+ :class:`Edb <pyedb.dotnet.edb.Edb>` or :class:`Edb <pyedb.grpc.edb.Edb>`
72
+
73
+ Note
74
+ ----
75
+ PyEDB gRPC will be released starting ANSYS release 2025R2. For legacy purpose, the gRPC will not be activated by
76
+ default. However, PyEDB gRPC will be the lon term supported version. The legacy PyEDB .NET will be deprecated
77
+ and at some point all new features will only be implemented in PyEDB gRPC. We highly encourage users moving to
78
+ gRPC starting release 2025R2, we tried keeping gRPC version backward compatible with legace .NET as much as
79
+ possible and only minor adjustments are required to be compatible.
80
+
81
+ Examples
82
+ --------
83
+ 1. Creating and Opening an EDB Database
84
84
 
85
85
  >>> from pyedb import Edb
86
- >>> app = Edb()
87
86
 
88
- Add a new variable named "s1" to the ``Edb`` instance.
87
+ # Create a new EDB instance
88
+ >>> edb = Edb()
89
+
90
+ # Open an existing AEDB database
91
+ >>> edb = Edb(edbpath="my_project.aedb")
92
+
93
+ # Import a board file (BRD, XML, GDS, etc.)
94
+ >>> edb = Edb(edbpath="my_board.brd")
95
+
96
+ 2. Cutout Operation
97
+
98
+ # Simple cutout with signal and reference nets
99
+ >>> edb.cutout(
100
+ >>> signal_list=["PCIe", "USB"],
101
+ >>> reference_list=["GND"]
102
+ >>> )
103
+
104
+ # Advanced cutout with custom parameters
105
+ >>> edb.cutout(
106
+ >>> signal_list=["DDR"],
107
+ >>> reference_list=["GND"],
108
+ >>> extent_type="ConvexHull",
109
+ >>> expansion_size=0.002,
110
+ >>> use_round_corner=True,
111
+ >>> output_aedb_path="cutout.aedb",
112
+ >>> remove_single_pin_components=True
113
+ >>> )
114
+
115
+ 3. Exporting Designs
116
+
117
+ # Export to IPC2581 format
118
+ >>> edb.export_to_ipc2581("output.xml", units="millimeter")
119
+
120
+ # Export to HFSS project
121
+ >>> edb.export_hfss("hfss_output")
122
+
123
+ # Export to Q3D project
124
+ >>> edb.export_q3d("q3d_output", net_list=["PowerNet"])
125
+
126
+ # Export to Maxwell project
127
+ >>> edb.export_maxwell("maxwell_output")
128
+
129
+ 4. Simulation Setup
130
+
131
+ # Create SIwave SYZ setup
132
+ >>> syz_setup = edb.create_siwave_syz_setup(
133
+ >>> name="GHz_Setup",
134
+ >>> start_freq="1GHz",
135
+ >>> stop_freq="10GHz"
136
+ >>> )
137
+
138
+ # Create SIwave DC setup
139
+ >>> dc_setup = edb.create_siwave_dc_setup(
140
+ >>> name="DC_Analysis",
141
+ >>> use_dc_point=True
142
+ >>> )
143
+
144
+ # Solve with SIwave
145
+ >>> edb.solve_siwave()
146
+
147
+ 5. Database Management
148
+
149
+ # Save database
150
+ >>> edb.save()
151
+
152
+ # Save as new database
153
+ >>> edb.save_as("new_project.aedb")
154
+
155
+ # Close database
156
+ >>> edb.close()
157
+
158
+ 6. Stackup and Material Operations
159
+
160
+ # Access stackup layers
161
+ >>> for layer_name, layer in edb.stackup.layers.items():
162
+ >>> print(f"Layer: {layer_name}, Thickness: {layer.thickness}")
163
+
164
+ # Add new material
165
+ >>> edb.materials.add_material("MyMaterial", permittivity=4.3, loss_tangent=0.02)
166
+
167
+ # Change layer thickness
168
+ >>> edb.stackup["TopLayer"].thickness = "0.035mm"
169
+
170
+ 7. Port Creation
171
+
172
+ # Create wave port between two pins
173
+ >>> wave_port = edb.source_excitation.create_port(
174
+ >>> positive_terminal=pin1,
175
+ >>> negative_terminal=pin2,
176
+ >>> port_type="Wave"
177
+ >>> )
178
+
179
+ # Create lumped port
180
+ >>> lumped_port = edb.source_excitation.create_port(
181
+ >>> positive_terminal=via_terminal,
182
+ >>> port_type="Lumped"
183
+ >>> )
184
+
185
+ 8. Component Management
186
+
187
+ # Delete components by type
188
+ >>> edb.components.delete_component(["R1", "C2"])
189
+
190
+ # Set component properties
191
+ >>> edb.components["U1"].set_property("Value", "10nH")
192
+
193
+ 9. Parametrization
194
+
195
+ # Auto-parametrize design elements
196
+ >>> params = edb.auto_parametrize_design(
197
+ >>> traces=True,
198
+ >>> pads=True,
199
+ >>> antipads=True,
200
+ >>> use_relative_variables=True
201
+ >>> )
202
+ >>> print("Created parameters:", params)
89
203
 
90
- >>> app['s1'] = "0.25 mm"
91
- >>> app['s1'].tofloat
92
- >>> 0.00025
93
- >>> app['s1'].tostring
94
- >>> "0.25mm"
204
+ 10. Design Statistics
95
205
 
96
- or add a new parameter with description:
206
+ # Get layout statistics with area calculation
207
+ >>> stats = edb.get_statistics(compute_area=True)
208
+ >>> print(f"Total nets: {stats.net_count}")
209
+ >>> print(f"Total components: {stats.component_count}")
97
210
 
98
- >>> app['s2'] = ["20um", "Spacing between traces"]
99
- >>> app['s2'].value
100
- >>> 1.9999999999999998e-05
101
- >>> app['s2'].description
102
- >>> 'Spacing between traces'
211
+ 11. Layout Validation
103
212
 
213
+ # Run DRC check
214
+ >>> drc_errors = edb.layout_validation.run_drc()
215
+ >>> print(f"Found {len(drc_errors)} DRC violations")
104
216
 
105
- Create an ``Edb`` object and open the specified project.
217
+ 12. Differential Pairs
106
218
 
107
- >>> app = Edb("myfile.aedb")
219
+ # Create differential pair
220
+ >>> edb.differential_pairs.create(
221
+ >>> positive_net="USB_P",
222
+ >>> negative_net="USB_N",
223
+ >>> name="USB_DP"
224
+ >>> )
108
225
 
109
- Create an ``Edb`` object from GDS and control files.
110
- The XML control file resides in the same directory as the GDS file: (myfile.xml).
226
+ 13. Workflow Automation
111
227
 
112
- >>> app = Edb("/path/to/file/myfile.gds")
228
+ # Define and run workflow
229
+ >>> workflow = edb.workflow
230
+ >>> workflow.add_task("Import", file_path="input.brd")
231
+ >>> workflow.add_task("Cutout", signal_nets=["PCIe"])
232
+ >>> workflow.add_task("Export", format="IPC2581")
233
+ >>> workflow.run()
113
234
 
114
235
  """
115
236