pyedb 0.51.2__py3-none-any.whl → 0.52.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.

pyedb/dotnet/edb.py CHANGED
@@ -1238,7 +1238,7 @@ class Edb(Database):
1238
1238
  return self._core_primitives
1239
1239
 
1240
1240
  @property
1241
- def layout(self):
1241
+ def layout(self) -> Layout:
1242
1242
  """Layout object.
1243
1243
 
1244
1244
  Returns
@@ -4735,3 +4735,37 @@ class Edb(Database):
4735
4735
  return self.variables[variable_name]
4736
4736
  else:
4737
4737
  return False
4738
+
4739
+ def compare(self, input_file, results=""):
4740
+ """Compares current open database with another one.
4741
+
4742
+ Parameters
4743
+ ----------
4744
+ input_file : str
4745
+ Path to the edb file.
4746
+ results: str, optional
4747
+ Path to directory in which results will be saved. If no path is given, a new "_compare_results"
4748
+ directory will be created with the same naming and path as the .aedb folder.
4749
+ Returns
4750
+ -------
4751
+ bool
4752
+ ``True`` when successful, ``False`` when failed.
4753
+ """
4754
+ self.save()
4755
+ if not results:
4756
+ results = self.edbpath[:-5] + "_compare_results"
4757
+ os.mkdir(results)
4758
+ command = os.path.join(self.base_path, "EDBDiff.exe")
4759
+ if is_linux:
4760
+ mono_path = os.path.join(self.base_path, "common/mono/Linux64/bin/mono")
4761
+ cmd_input = [mono_path, command, input_file, self.edbpath, results]
4762
+ else:
4763
+ cmd_input = [command, input_file, self.edbpath, results]
4764
+ subprocess.run(cmd_input)
4765
+
4766
+ if not os.path.exists(os.path.join(results, "EDBDiff.csv")):
4767
+ self.logger.error("Comparison execution failed")
4768
+ return False
4769
+ else:
4770
+ self.logger.info("Comparison correctly completed")
4771
+ return True
@@ -1 +0,0 @@
1
- from __future__ import absolute_import # noreorder
@@ -228,14 +228,14 @@ class Material(GrpcMaterialDef):
228
228
 
229
229
  """
230
230
  try:
231
- return self.dielectric_material_model.dc_relative_permitivity
231
+ return self.dielectric_material_model.dc_relative_permittivity
232
232
  except:
233
233
  return None
234
234
 
235
235
  @dc_permittivity.setter
236
236
  def dc_permittivity(self, value):
237
237
  if self.dielectric_material_model:
238
- self.dielectric_material_model.dc_relative_permitivity = float(value)
238
+ self.dielectric_material_model.dc_relative_permittivity = float(value)
239
239
 
240
240
  @property
241
241
  def loss_tangent_at_frequency(self) -> float:
@@ -289,14 +289,14 @@ class Material(GrpcMaterialDef):
289
289
 
290
290
  """
291
291
  try:
292
- return self.dielectric_material_model.relative_permitivity_at_frequency
292
+ return self.dielectric_material_model.relative_permittivity_at_frequency
293
293
  except:
294
294
  return None
295
295
 
296
296
  @permittivity_at_frequency.setter
297
297
  def permittivity_at_frequency(self, value):
298
298
  if self.dielectric_material_model:
299
- self.dielectric_material_model.relative_permitivity_at_frequency = float(value)
299
+ self.dielectric_material_model.relative_permittivity_at_frequency = float(value)
300
300
 
301
301
  @property
302
302
  def permittivity(self) -> float:
@@ -771,14 +771,14 @@ class Materials(object):
771
771
  raise ValueError(f"Material names are case-insensitive and {name.lower()} already exists.")
772
772
 
773
773
  material_model = GrpcDjordjecvicSarkarModel.create()
774
- material_model.relative_permitivity_at_frequency = permittivity_at_frequency
774
+ material_model.relative_permittivity_at_frequency = permittivity_at_frequency
775
775
  material_model.loss_tangent_at_frequency = loss_tangent_at_frequency
776
776
  material_model.frequency = dielectric_model_frequency
777
777
  if dc_conductivity is not None:
778
778
  material_model.dc_conductivity = dc_conductivity
779
779
  material_model.use_dc_relative_conductivity = True
780
780
  if dc_permittivity is not None:
781
- material_model.dc_relative_permitivity = dc_permittivity
781
+ material_model.dc_relative_permittivity = dc_permittivity
782
782
  try:
783
783
  material = self.__add_dielectric_material_model(name, material_model)
784
784
  for key, value in kwargs.items():
@@ -841,7 +841,7 @@ class Materials(object):
841
841
  material_model = GrpcDebyeModel.create()
842
842
  material_model.frequency_range = (lower_freqency, higher_frequency)
843
843
  material_model.loss_tangent_at_high_low_frequency = (loss_tangent_low, loss_tangent_high)
844
- material_model.relative_permitivity_at_high_low_frequency = (permittivity_low, permittivity_high)
844
+ material_model.relative_permittivity_at_high_low_frequency = (permittivity_low, permittivity_high)
845
845
  try:
846
846
  material = self.__add_dielectric_material_model(name, material_model)
847
847
  for key, value in kwargs.items():
@@ -27,7 +27,7 @@ from ansys.edb.core.utility.value import Value as GrpcValue
27
27
 
28
28
 
29
29
  class PinPairModel(GrpcPinPairModel):
30
- """Manage pin pair model."""
30
+ """Manage pin-pair model."""
31
31
 
32
32
  def __init__(self, pedb, edb_object):
33
33
  self._pedb_comp = pedb
@@ -85,10 +85,11 @@ class DifferentialPairs:
85
85
  -------
86
86
  list
87
87
  A list containing identified differential pair names.
88
+
88
89
  Examples
89
90
  --------
90
91
  >>> from pyedb import Edb
91
- >>> edbapp = Edb("myaedbfolder", edbversion="2023.1")
92
+ >>> edbapp = Edb("myaedbfolder", edbversion="2025.2")
92
93
  >>> edb_nets = edbapp.differential_pairs.auto_identify()
93
94
  """
94
95
  nets = self._pedb.nets.nets
@@ -2635,16 +2635,16 @@ class SourceExcitation:
2635
2635
 
2636
2636
  Parameters
2637
2637
  ----------
2638
- terminal : :class:`EdgeTerminal <pyedb.grpc.database.terminals.EdgeTerminal>`,
2639
- :class:`PadstackInstanceTerminal <pyedb.grpc.database.terminals.PadstackInstanceTerminal>`,
2640
- :class:`PointTerminal <pyedb.grpc.database.terminals.PointTerminal>`,
2641
- :class:`PinGroupTerminal <pyedb.grpc.database.terminals.PinGroupTerminal>`,
2642
- Positive terminal of the source.
2643
- ref_terminal : :class:`EdgeTerminal <pyedb.grpc.database.terminals.EdgeTerminal>`,
2644
- :class:`pyedb.grpc.database.terminals.PadstackInstanceTerminal`,
2645
- :class:`PadstackInstanceTerminal <pyedb.grpc.database.terminals.PointTerminal>`,
2646
- :class:`PinGroupTerminal <pyedb.grpc.database.terminals.PinGroupTerminal>`,
2647
- Negative terminal of the source.
2638
+ terminal : :class:`EdgeTerminal <pyedb.grpc.database.terminals.EdgeTerminal>`or
2639
+ :class:`PadstackInstanceTerminal <pyedb.grpc.database.terminals.PadstackInstanceTerminal>` or
2640
+ :class:`PointTerminal <pyedb.grpc.database.terminals.PointTerminal>` or
2641
+ :class:`PinGroupTerminal <pyedb.grpc.database.terminals.PinGroupTerminal>`.
2642
+ Positive terminal of the source.
2643
+ ref_terminal : :class:`EdgeTerminal <pyedb.grpc.database.terminals.EdgeTerminal>` or
2644
+ :class:`pyedb.grpc.database.terminals.PadstackInstanceTerminal` or
2645
+ :class:`PadstackInstanceTerminal <pyedb.grpc.database.terminals.PointTerminal>` or
2646
+ :class:`PinGroupTerminal <pyedb.grpc.database.terminals.PinGroupTerminal>`.
2647
+ Negative terminal of the source.
2648
2648
 
2649
2649
  Returns
2650
2650
  -------
pyedb/grpc/edb.py CHANGED
@@ -178,13 +178,13 @@ class Edb(EdbInit):
178
178
 
179
179
  Examples
180
180
  --------
181
- Create new EDB:
181
+ >>> # Create new EDB:
182
182
  >>> edb = Edb()
183
183
 
184
- Open existing AEDB:
184
+ >>> # Open existing AEDB:
185
185
  >>> edb = Edb("myproject.aedb")
186
186
 
187
- Import board file:
187
+ >>> # Import board file:
188
188
  >>> edb = Edb("my_board.brd")
189
189
  """
190
190
 
@@ -486,7 +486,7 @@ class Edb(EdbInit):
486
486
 
487
487
  Returns
488
488
  -------
489
- dict[str, Union[:class:`GapPort`, :class:`WavePort`, :class:`CoaxPort`]]
489
+ dict[str, list[:class:`GapPort` or :class:`WavePort` or :class:`CoaxPort`]]
490
490
  Port names and objects.
491
491
  """
492
492
  terminals = [term for term in self.layout.terminals if not term.is_reference_terminal]
@@ -572,7 +572,7 @@ class Edb(EdbInit):
572
572
 
573
573
  Examples
574
574
  --------
575
- Open an existing EDB database:
575
+ >>> # Open an existing EDB database:
576
576
  >>> edb = Edb("myproject.aedb")
577
577
  """
578
578
  self.standalone = self.standalone
@@ -763,10 +763,9 @@ class Edb(EdbInit):
763
763
 
764
764
  Examples
765
765
  --------
766
- Import a BRD file:
766
+ >>> # Import a BRD file:
767
767
  >>> edb.import_layout_file("my_board.brd", r"C:/project")
768
-
769
- Import a GDS file with control file:
768
+ >>> # Import a GDS file with control file:
770
769
  >>> edb.import_layout_file("layout.gds", control_file="control.xml")
771
770
  """
772
771
  self._components = None
@@ -831,7 +830,7 @@ class Edb(EdbInit):
831
830
 
832
831
  Examples
833
832
  --------
834
- Export to IPC2581 format:
833
+ >>> # Export to IPC2581 format:
835
834
  >>> edb.export_to_ipc2581("output.xml")
836
835
  """
837
836
  if units.lower() not in ["millimeter", "inch", "micron"]: # pragma no cover
@@ -1238,7 +1237,7 @@ class Edb(EdbInit):
1238
1237
  """Close EDB and clean up resources.
1239
1238
 
1240
1239
  ..deprecated:: 0.51.0
1241
- Use: func:`close` instead.
1240
+ Use :func:`close` instead.
1242
1241
 
1243
1242
  Returns
1244
1243
  -------
@@ -1257,17 +1256,8 @@ class Edb(EdbInit):
1257
1256
  """Save current EDB database.
1258
1257
 
1259
1258
  ..deprecated:: 0.51.0
1260
- Use: func:`save` instead.
1259
+ Use :func:`save` instead.
1261
1260
 
1262
- Returns
1263
- -------
1264
- bool
1265
- True if successful, False otherwise.
1266
-
1267
- Examples
1268
- --------
1269
- Save the current EDB:
1270
- >>> edb.save_edb()
1271
1261
  """
1272
1262
  warnings.warn("Use method save instead.", DeprecationWarning)
1273
1263
  return self.save()
@@ -1276,22 +1266,7 @@ class Edb(EdbInit):
1276
1266
  """Save EDB database to new location.
1277
1267
 
1278
1268
  ..deprecated:: 0.51.0
1279
- Use: func:`save_as` instead.
1280
-
1281
- Parameters
1282
- ----------
1283
- fname : str
1284
- New AEDB path.
1285
-
1286
- Returns
1287
- -------
1288
- bool
1289
- True if successful, False otherwise.
1290
-
1291
- Examples
1292
- --------
1293
- Save EDB to new location:
1294
- >>> edb.save_edb_as("new_location.aedb")
1269
+ Use :func:`save_as` instead.
1295
1270
  """
1296
1271
  warnings.warn("Use method save_as instead.", DeprecationWarning)
1297
1272
  return self.save_as(fname)
@@ -1307,8 +1282,12 @@ class Edb(EdbInit):
1307
1282
  # return self.edb_api.utility.utility.Command.Execute(func)
1308
1283
  pass
1309
1284
 
1310
- def import_cadence_file(self, inputBrd, WorkDir=None, anstranslator_full_path="", use_ppe=False):
1311
- """Import Cadence board file (Deprecated - use import_layout_file)."""
1285
+ def import_cadence_file(self, inputBrd, WorkDir=None, anstranslator_full_path="", use_ppe=False) -> bool:
1286
+ """Import Cadence board file.
1287
+
1288
+ .. deprecated:: 0.50
1289
+ Use :func:`import_layout_file` instead.
1290
+ """
1312
1291
  if self.import_layout_pcb(
1313
1292
  inputBrd,
1314
1293
  working_dir=WorkDir,
@@ -1707,10 +1686,9 @@ class Edb(EdbInit):
1707
1686
 
1708
1687
  Examples
1709
1688
  --------
1710
- Create a basic cutout:
1689
+ >>> # Create a basic cutout:
1711
1690
  >>> edb.cutout(signal_list=["Net1"], reference_list=["GND"])
1712
-
1713
- Create cutout with custom polygon:
1691
+ >>> # Create cutout with custom polygon:
1714
1692
  >>> custom_poly = [[0,0], [10e-3,0], [10e-3,10e-3], [0,10e-3]]
1715
1693
  >>> edb.cutout(custom_extent=custom_poly)
1716
1694
  """
@@ -2460,7 +2438,7 @@ class Edb(EdbInit):
2460
2438
 
2461
2439
  Examples
2462
2440
  --------
2463
- Export to HFSS project:
2441
+ >>> # Export to HFSS project:
2464
2442
  >>> edb.export_hfss(r"C:/output", net_list=["SignalNet"])
2465
2443
  """
2466
2444
  siwave_s = SiwaveSolve(self.edbpath, aedt_installer_path=self.base_path)
@@ -2496,7 +2474,7 @@ class Edb(EdbInit):
2496
2474
 
2497
2475
  Examples
2498
2476
  --------
2499
- Export to Q3D project:
2477
+ >>> # Export to Q3D project:
2500
2478
  >>> edb.export_q3d(r"C:/output")
2501
2479
  """
2502
2480
  siwave_s = SiwaveSolve(self.edbpath, aedt_installer_path=self.base_path)
@@ -2539,7 +2517,7 @@ class Edb(EdbInit):
2539
2517
 
2540
2518
  Examples
2541
2519
  --------
2542
- Export to Maxwell project:
2520
+ >>> # Export to Maxwell project:
2543
2521
  >>> edb.export_maxwell(r"C:/output")
2544
2522
  """
2545
2523
  siwave_s = SiwaveSolve(self.edbpath, aedt_installer_path=self.base_path)
@@ -2562,7 +2540,7 @@ class Edb(EdbInit):
2562
2540
 
2563
2541
  Examples
2564
2542
  --------
2565
- Solve with SIwave:
2543
+ >>> # Solve with SIwave:
2566
2544
  >>> edb.solve_siwave()
2567
2545
  """
2568
2546
  process = SiwaveSolve(self.edbpath, aedt_version=self.edbversion)
@@ -2762,7 +2740,7 @@ class Edb(EdbInit):
2762
2740
  Returns
2763
2741
  -------
2764
2742
  list
2765
- [[min_x, min_y], [max_x, max_y]] in meters.
2743
+ list[list[min_x, min_y], list[max_x, max_y]] in meters.
2766
2744
  """
2767
2745
  lay_inst_polygon_data = [obj_inst.get_bbox() for obj_inst in self.layout_instance.query_layout_obj_instances()]
2768
2746
  layout_bbox = GrpcPolygonData.bbox_of_polygons(lay_inst_polygon_data)
@@ -2865,10 +2843,10 @@ class Edb(EdbInit):
2865
2843
 
2866
2844
  Returns
2867
2845
  -------
2868
- Dict[str,: class:`pyedb.grpc.database.simulation_setup.hfss_simulation_setup.HfssSimulationSetup`] or
2869
- Dict[str,: class:`pyedb.grpc.database.simulation_setup.siwave_simulation_setup.SiwaveSimulationSetup`] or
2870
- Dict[str,: class:`SIWaveDCIRSimulationSetup`] or
2871
- Dict[str,: class:`pyedb.grpc.database.simulation_setup.raptor_x_simulation_setup.RaptorXSimulationSetup`]
2846
+ Dict[str,:class:`HfssSimulationSetup`] or
2847
+ Dict[str,:class:`SiwaveSimulationSetup`] or
2848
+ Dict[str,:class:`SIWaveDCIRSimulationSetup`] or
2849
+ Dict[str,:class:`RaptorXSimulationSetup`]
2872
2850
 
2873
2851
  """
2874
2852
  self._setups = {}
@@ -2919,8 +2897,7 @@ class Edb(EdbInit):
2919
2897
 
2920
2898
  Returns
2921
2899
  -------
2922
- Dict[str,:class:`SiwaveSimulationSetup
2923
- <pyedb.grpc.database.simulation_setup.siwave_simulation_setup.SiwaveSimulationSetup>`]
2900
+ Dict[str,:class:`SiwaveSimulationSetup`]
2924
2901
  """
2925
2902
  return {name: i for name, i in self.setups.items() if isinstance(i, SiwaveSimulationSetup)}
2926
2903
 
@@ -2931,16 +2908,6 @@ class Edb(EdbInit):
2931
2908
 
2932
2909
  . deprecated:: pyedb 0.30.0
2933
2910
  Use :func:`pyedb.grpc.core.hfss.add_setup` instead.
2934
-
2935
- Parameters
2936
- ----------
2937
- name : str, optional
2938
- Setup name.
2939
-
2940
- Returns
2941
- -------
2942
- :class:`HfssSimulationSetup <legacy.database.edb_data.hfss_simulation_setup_data.HfssSimulationSetup>`
2943
-
2944
2911
  """
2945
2912
  warnings.warn(
2946
2913
  "`create_hfss_setup` is deprecated and is now located here " "`pyedb.grpc.core.hfss.add_setup` instead.",
@@ -2964,8 +2931,7 @@ class Edb(EdbInit):
2964
2931
 
2965
2932
  Returns
2966
2933
  -------
2967
- :class:`RaptorXSimulationSetup
2968
- <pyedb.grpc.database.simulation_setup.raptor_x_simulation_setup.RaptorXSimulationSetup>`
2934
+ :class:`RaptorXSimulationSetup`
2969
2935
  RaptorX setup or False if unsupported.
2970
2936
  """
2971
2937
  from ansys.edb.core.simulation_setup.raptor_x_simulation_setup import (
@@ -3021,8 +2987,7 @@ class Edb(EdbInit):
3021
2987
 
3022
2988
  Returns
3023
2989
  -------
3024
- :class:`SiwaveSimulationSetup
3025
- <pyedb.grpc.database.simulation_setup.siwave_simulation_setup.SiwaveSimulationSetup>`
2990
+ :class:`SiwaveSimulationSetup`
3026
2991
  SYZ analysis setup.
3027
2992
  """
3028
2993
  if not name:
@@ -3050,8 +3015,7 @@ class Edb(EdbInit):
3050
3015
 
3051
3016
  Returns
3052
3017
  -------
3053
- :class:`SIWaveDCIRSimulationSetup
3054
- <pyedb.grpc.database.simulation_setup.siwave_dcir_simulation_setup.SIWaveDCIRSimulationSetup>`
3018
+ :class:`SIWaveDCIRSimulationSetup`
3055
3019
  DC analysis setup.
3056
3020
  """
3057
3021
  if not name:
@@ -3095,8 +3059,8 @@ class Edb(EdbInit):
3095
3059
  self.logger.info(f"The W factor is {expansion_factor}, The initial extent = {max_width}")
3096
3060
  return max_width
3097
3061
 
3098
- def copy_zones(self, working_directory=None):
3099
- """Copy multizone EDB project to one new edb per zone.
3062
+ def copy_zones(self, working_directory=None) -> dict[str, tuple[int, GrpcPolygonData]]:
3063
+ """Copy multi-zone EDB project to one new edb per zone.
3100
3064
 
3101
3065
  Parameters
3102
3066
  ----------
@@ -3105,7 +3069,8 @@ class Edb(EdbInit):
3105
3069
 
3106
3070
  Returns
3107
3071
  -------
3108
- dict[str, [int,: class:`PolygonData <ansys.edb.core.geometry.polygon_data.PolygonData>`]]
3072
+ dict[str, tuple[int,:class:`PolygonData <ansys.edb.core.geometry.polygon_data.PolygonData>`]]
3073
+
3109
3074
  Return a dictionary with edb path as key and tuple Zone Id as first item and EDB polygon Data defining
3110
3075
  the region as second item.
3111
3076
 
@@ -3124,7 +3089,7 @@ class Edb(EdbInit):
3124
3089
  edb_zones = {}
3125
3090
  if not self.setups:
3126
3091
  self.siwave.add_siwave_syz_analysis()
3127
- self.save_edb()
3092
+ self.save()
3128
3093
  for zone_primitive in zone_primitives:
3129
3094
  if zone_primitive:
3130
3095
  edb_zone_path = os.path.join(working_directory, f"{zone_primitive.id}_{os.path.basename(self.edbpath)}")
@@ -3158,10 +3123,9 @@ class Edb(EdbInit):
3158
3123
 
3159
3124
  Returns
3160
3125
  -------
3161
- Dict[str: str] or List[str]
3162
- first dictionary defined_ports with edb name as key and existing port name list as value. Those ports are the
3163
- ones defined before processing the multizone clipping.
3164
- second is the list of connected port.
3126
+ dict[str: str] or list[str]
3127
+ first dictionary defined_ports with edb name as key and existing port name list as value. Those ports are
3128
+ the ones defined before processing the multizone clipping. the second is the list of connected port.
3165
3129
 
3166
3130
  """
3167
3131
  terminals = {}
@@ -3280,29 +3244,8 @@ class Edb(EdbInit):
3280
3244
  """Create a port.
3281
3245
 
3282
3246
  ..deprecated:: 0.51.0
3283
- Use: func:`create_port` has been move to source_excitation.create_port.
3247
+ Use :func:`create_port` has been moved to source_excitation.create_port.
3284
3248
 
3285
- Parameters
3286
- ----------
3287
- terminal : class:`pyedb.dotnet.database.edb_data.terminals.EdgeTerminal`,
3288
- class:`pyedb.grpc.database.terminals.PadstackInstanceTerminal`,
3289
- class:`pyedb.grpc.database.terminals.PointTerminal`,
3290
- class:`pyedb.grpc.database.terminals.PinGroupTerminal`,
3291
- Positive terminal of the port.
3292
- ref_terminal : class:`pyedb.grpc.database.terminals.EdgeTerminal`,
3293
- class:`pyedb.grpc.database.terminals.PadstackInstanceTerminal`,
3294
- class:`pyedb.grpc.database.terminals.PointTerminal`,
3295
- class:`pyedb.grpc.database.terminals.PinGroupTerminal`,
3296
- optional
3297
- Negative terminal of the port.
3298
- is_circuit_port : bool, optional
3299
- Whether it is a circuit port. The default is ``False``.
3300
- name: str, optional
3301
- Name of the created port. The default is None, a random name is generated.
3302
- Returns
3303
- -------
3304
- list: [:class:`GapPort <pyedb.grpc.database.ports.ports.GapPort`>,
3305
- :class:`WavePort <pyedb.grpc.database.ports.ports.WavePort>`].
3306
3249
  """
3307
3250
 
3308
3251
  warnings.warn("Use create_port from edb.source_excitation.create_port", DeprecationWarning)
@@ -3312,24 +3255,8 @@ class Edb(EdbInit):
3312
3255
  """Create a voltage probe.
3313
3256
 
3314
3257
  ..deprecated:: 0.50.0
3315
- Use: func:`create_voltage_probe` located in edb.source_excitation.create_voltage_probe instead.
3316
-
3317
- Parameters
3318
- ----------
3319
- terminal : :class:`EdgeTerminal <pyedb.grpc.database.terminals.EdgeTerminal>`,
3320
- :class:`PadstackInstanceTerminal <pyedb.grpc.database.terminals.PadstackInstanceTerminal>`,
3321
- :class:`PointTerminal <pyedb.grpc.database.terminals.PointTerminal>`,
3322
- :class:`PinGroupTerminal <pyedb.grpc.database.terminals.PinGroupTerminal>`,
3323
- Positive terminal of the port.
3324
- ref_terminal : :class:`EdgeTerminal <pyedb.grpc.database.terminals.EdgeTerminal>`,
3325
- :class:`pyedb.grpc.database.terminals.PadstackInstanceTerminal`,
3326
- :class:`PadstackInstanceTerminal <pyedb.grpc.database.terminals.PointTerminal>`,
3327
- :class:`PinGroupTerminal <pyedb.grpc.database.terminals.PinGroupTerminal>`,
3328
- Negative terminal of the probe.
3258
+ Use :func:`create_voltage_probe` has been moved to edb.source_excitation.create_voltage_probe.
3329
3259
 
3330
- Returns
3331
- -------
3332
- :class:`Terminal <pyedb.dotnet.database.edb_data.terminals.Terminal>`
3333
3260
  """
3334
3261
  warnings.warn("Use create_voltage_probe located in edb.source_excitation instead", DeprecationWarning)
3335
3262
  return self.source_excitation.create_voltage_probe(terminal, ref_terminal)
@@ -3338,24 +3265,8 @@ class Edb(EdbInit):
3338
3265
  """Create a voltage source.
3339
3266
 
3340
3267
  ..deprecated:: 0.50.0
3341
- Use: func:`create_voltage_source` located in edb.source_excitation.create_voltage_source instead.
3268
+ Use: func:`create_voltage_source` has been moved to edb.source_excitation.create_voltage_source.
3342
3269
 
3343
- Parameters
3344
- ----------
3345
- terminal : :class:`EdgeTerminal <pyedb.grpc.database.terminals.EdgeTerminal>`,
3346
- :class:`PadstackInstanceTerminal <pyedb.grpc.database.terminals.PadstackInstanceTerminal>`,
3347
- :class:`PointTerminal <pyedb.grpc.database.terminals.PointTerminal>`,
3348
- :class:`PinGroupTerminal <pyedb.grpc.database.terminals.PinGroupTerminal>`,
3349
- Positive terminal of the source.
3350
- ref_terminal : :class:`EdgeTerminal <pyedb.grpc.database.terminals.EdgeTerminal>`,
3351
- :class:`pyedb.grpc.database.terminals.PadstackInstanceTerminal`,
3352
- :class:`PadstackInstanceTerminal <pyedb.grpc.database.terminals.PointTerminal>`,
3353
- :class:`PinGroupTerminal <pyedb.grpc.database.terminals.PinGroupTerminal>`,
3354
- Negative terminal of the source.
3355
-
3356
- Returns
3357
- -------
3358
- class:`ExcitationSources <legacy.database.edb_data.ports.ExcitationSources>`
3359
3270
  """
3360
3271
  warnings.warn(
3361
3272
  "use create_voltage_source located in edb.source_excitation.create_voltage_source instead",
@@ -3367,24 +3278,8 @@ class Edb(EdbInit):
3367
3278
  """Create a current source.
3368
3279
 
3369
3280
  ..deprecated:: 0.50.0
3370
- Use: func:`create_current_source` located in edb.source_excitation.create_current_source instead.
3281
+ Use :func:`create_current_source` has been moved to edb.source_excitation.create_current_source.
3371
3282
 
3372
- Parameters
3373
- ----------
3374
- terminal : :class:`EdgeTerminal <pyedb.grpc.database.terminals.EdgeTerminal>`,
3375
- :class:`PadstackInstanceTerminal <pyedb.grpc.database.terminals.PadstackInstanceTerminal>`,
3376
- :class:`PointTerminal <pyedb.grpc.database.terminals.PointTerminal>`,
3377
- :class:`PinGroupTerminal <pyedb.grpc.database.terminals.PinGroupTerminal>`,
3378
- Positive terminal of the source.
3379
- ref_terminal : :class:`EdgeTerminal <pyedb.grpc.database.terminals.EdgeTerminal>`,
3380
- :class:`pyedb.grpc.database.terminals.PadstackInstanceTerminal`,
3381
- :class:`PadstackInstanceTerminal <pyedb.grpc.database.terminals.PointTerminal>`,
3382
- :class:`PinGroupTerminal <pyedb.grpc.database.terminals.PinGroupTerminal>`,
3383
- Negative terminal of the source.
3384
-
3385
- Returns
3386
- -------
3387
- :class:`ExcitationSources <legacy.database.edb_data.ports.ExcitationSources>`
3388
3283
  """
3389
3284
  warnings.warn(
3390
3285
  "use create_current_source located in edb.source_excitation.create_current_source instead",
@@ -3396,22 +3291,7 @@ class Edb(EdbInit):
3396
3291
  """Place terminal between two points.
3397
3292
 
3398
3293
  ..deprecated:: 0.50.0
3399
- Use: func:`get_point_terminal` located in edb.source_excitation.get_point_terminal instead.
3400
-
3401
- Parameters
3402
- ----------
3403
- name : str,
3404
- Name of the terminal.
3405
- net_name : str
3406
- Name of the net.
3407
- location : list
3408
- Location of the terminal.
3409
- layer : str,
3410
- Layer of the terminal.
3411
-
3412
- Returns
3413
- -------
3414
- :class:`PointTerminal <pyedb.grpc.database.terminal.point_terminal.PointTerminal>`
3294
+ Use: func:`get_point_terminal` has been moved to edb.source_excitation.get_point_terminal.
3415
3295
  """
3416
3296
 
3417
3297
  warnings.warn(
@@ -3487,14 +3367,13 @@ class Edb(EdbInit):
3487
3367
  --------
3488
3368
  Parametrize design elements:
3489
3369
  >>> params = edb.auto_parametrize_design(
3490
- ... layers=True,
3491
- ... materials=True,
3492
- ... trace_net_filter=["Clock"]
3493
- ... )
3370
+ >>> layers=True,
3371
+ >>> materials=True,
3372
+ >>> trace_net_filter=["Clock"])
3494
3373
  """
3495
3374
  edb_original_path = self.edbpath
3496
3375
  if output_aedb_path:
3497
- self.save_edb_as(output_aedb_path)
3376
+ self.save_as(output_aedb_path)
3498
3377
  if isinstance(trace_net_filter, str):
3499
3378
  trace_net_filter = [trace_net_filter]
3500
3379
  parameters = []
@@ -3682,10 +3561,10 @@ class Edb(EdbInit):
3682
3561
  void.expand(expand_voids_size, round_corners=False)
3683
3562
 
3684
3563
  if not open_aedb_at_end and self.edbpath != edb_original_path:
3685
- self.save_edb()
3686
- self.close_edb()
3564
+ self.save()
3565
+ self.close()
3687
3566
  self.edbpath = edb_original_path
3688
- self.open_edb()
3567
+ self.open()
3689
3568
  return parameters
3690
3569
 
3691
3570
  @staticmethod
@@ -3921,3 +3800,37 @@ class Edb(EdbInit):
3921
3800
  ET.indent(tree, space="\t", level=0)
3922
3801
  tree.write(control_path)
3923
3802
  return True if os.path.exists(control_path) else False
3803
+
3804
+ def compare(self, input_file, results=""):
3805
+ """Compares current open database with another one.
3806
+
3807
+ Parameters
3808
+ ----------
3809
+ input_file : str
3810
+ Path to the edb file.
3811
+ results: str, optional
3812
+ Path to directory in which results will be saved. If no path is given, a new "_compare_results"
3813
+ directory will be created with the same naming and path as the .aedb folder.
3814
+ Returns
3815
+ -------
3816
+ bool
3817
+ ``True`` when successful, ``False`` when failed.
3818
+ """
3819
+ self.save()
3820
+ if not results:
3821
+ results = self.edbpath[:-5] + "_compare_results"
3822
+ os.mkdir(results)
3823
+ command = os.path.join(self.base_path, "EDBDiff.exe")
3824
+ if is_linux:
3825
+ mono_path = os.path.join(self.base_path, "common/mono/Linux64/bin/mono")
3826
+ cmd_input = [mono_path, command, input_file, self.edbpath, results]
3827
+ else:
3828
+ cmd_input = [command, input_file, self.edbpath, results]
3829
+ subprocess.run(cmd_input)
3830
+
3831
+ if not os.path.exists(os.path.join(results, "EDBDiff.csv")):
3832
+ self.logger.error("Comparison execution failed")
3833
+ return False
3834
+ else:
3835
+ self.logger.info("Comparison correctly completed")
3836
+ return True
pyedb/grpc/edb_init.py CHANGED
@@ -193,10 +193,12 @@ class EdbInit(object):
193
193
  Parameters
194
194
  ----------
195
195
  terminate_rpc_session : bool, optional
196
-
196
+ Terminate RPC session when closing the database. The default value is `True`.
197
197
 
198
198
  . note::
199
- Unsaved changes will be lost.
199
+ Unsaved changes will be lost. If multiple databases are open and RPC session is terminated, the connection
200
+ with all databases will be lost. You might be careful and set to `False` until the last open database
201
+ remains.
200
202
  """
201
203
  self._db.close()
202
204
  self._db = None