pyedb 0.51.2__py3-none-any.whl → 0.53.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 (38) hide show
  1. pyedb/__init__.py +1 -1
  2. pyedb/configuration/cfg_common.py +12 -15
  3. pyedb/configuration/cfg_data.py +2 -2
  4. pyedb/configuration/cfg_modeler.py +163 -234
  5. pyedb/configuration/cfg_stackup.py +62 -249
  6. pyedb/configuration/configuration.py +356 -409
  7. pyedb/dotnet/database/components.py +9 -3
  8. pyedb/dotnet/database/dotnet/database.py +4 -0
  9. pyedb/dotnet/database/edb_data/layer_data.py +3 -1
  10. pyedb/dotnet/database/edb_data/padstacks_data.py +8 -2
  11. pyedb/dotnet/database/layout_validation.py +3 -13
  12. pyedb/dotnet/database/siwave.py +14 -0
  13. pyedb/dotnet/database/stackup.py +8 -61
  14. pyedb/dotnet/database/utilities/simulation_setup.py +1 -1
  15. pyedb/dotnet/database/utilities/siwave_cpa_simulation_setup.py +894 -0
  16. pyedb/dotnet/database/utilities/siwave_simulation_setup.py +15 -0
  17. pyedb/dotnet/edb.py +50 -3
  18. pyedb/generic/design_types.py +29 -0
  19. pyedb/generic/grpc_warnings.py +5 -0
  20. pyedb/grpc/database/__init__.py +0 -1
  21. pyedb/grpc/database/components.py +102 -81
  22. pyedb/grpc/database/control_file.py +240 -193
  23. pyedb/grpc/database/definition/materials.py +7 -7
  24. pyedb/grpc/database/definitions.py +7 -5
  25. pyedb/grpc/database/hierarchy/pin_pair_model.py +1 -1
  26. pyedb/grpc/database/modeler.py +105 -77
  27. pyedb/grpc/database/net/differential_pair.py +2 -1
  28. pyedb/grpc/database/simulation_setup/siwave_cpa_simulation_setup.py +961 -0
  29. pyedb/grpc/database/siwave.py +14 -0
  30. pyedb/grpc/database/source_excitations.py +10 -10
  31. pyedb/grpc/edb.py +156 -180
  32. pyedb/grpc/edb_init.py +4 -2
  33. pyedb/siwave_core/cpa/simulation_setup_data_model.py +132 -0
  34. pyedb/siwave_core/product_properties.py +198 -0
  35. {pyedb-0.51.2.dist-info → pyedb-0.53.0.dist-info}/METADATA +16 -14
  36. {pyedb-0.51.2.dist-info → pyedb-0.53.0.dist-info}/RECORD +38 -33
  37. {pyedb-0.51.2.dist-info → pyedb-0.53.0.dist-info}/WHEEL +1 -1
  38. {pyedb-0.51.2.dist-info → pyedb-0.53.0.dist-info/licenses}/LICENSE +0 -0
@@ -36,6 +36,9 @@ from ansys.edb.core.simulation_setup.simulation_setup import (
36
36
  )
37
37
  from ansys.edb.core.simulation_setup.simulation_setup import SweepData as GrpcSweepData
38
38
 
39
+ from pyedb.grpc.database.simulation_setup.siwave_cpa_simulation_setup import (
40
+ SIWaveCPASimulationSetup,
41
+ )
39
42
  from pyedb.misc.siw_feature_config.xtalk_scan.scan_config import SiwaveScanConfig
40
43
 
41
44
 
@@ -582,6 +585,17 @@ class Siwave(object):
582
585
 
583
586
  return True if os.path.exists(file_name) else False
584
587
 
588
+ def add_cpa_analysis(self, name=None, siwave_cpa_setup_class=None):
589
+ if not name:
590
+ from pyedb.generic.general_methods import generate_unique_name
591
+
592
+ if not siwave_cpa_setup_class:
593
+ name = generate_unique_name("cpa_setup")
594
+ else:
595
+ name = siwave_cpa_setup_class.name
596
+ cpa_setup = SIWaveCPASimulationSetup(self._pedb, name=name, siwave_cpa_setup_class=siwave_cpa_setup_class)
597
+ return cpa_setup
598
+
585
599
  def add_siwave_syz_analysis(
586
600
  self,
587
601
  accuracy_level=1,
@@ -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
@@ -70,6 +70,9 @@ import warnings
70
70
  from zipfile import ZipFile as zpf
71
71
 
72
72
  from ansys.edb.core.geometry.polygon_data import PolygonData as GrpcPolygonData
73
+ from ansys.edb.core.hierarchy.layout_component import (
74
+ LayoutComponent as GrpcLayoutComponent,
75
+ )
73
76
  import ansys.edb.core.layout.cell
74
77
  from ansys.edb.core.simulation_setup.siwave_dcir_simulation_setup import (
75
78
  SIWaveDCIRSimulationSetup as GrpcSIWaveDCIRSimulationSetup,
@@ -111,6 +114,9 @@ from pyedb.grpc.database.simulation_setup.hfss_simulation_setup import (
111
114
  from pyedb.grpc.database.simulation_setup.raptor_x_simulation_setup import (
112
115
  RaptorXSimulationSetup,
113
116
  )
117
+ from pyedb.grpc.database.simulation_setup.siwave_cpa_simulation_setup import (
118
+ SIWaveCPASimulationSetup,
119
+ )
114
120
  from pyedb.grpc.database.simulation_setup.siwave_dcir_simulation_setup import (
115
121
  SIWaveDCIRSimulationSetup,
116
122
  )
@@ -178,13 +184,13 @@ class Edb(EdbInit):
178
184
 
179
185
  Examples
180
186
  --------
181
- Create new EDB:
187
+ >>> # Create new EDB:
182
188
  >>> edb = Edb()
183
189
 
184
- Open existing AEDB:
190
+ >>> # Open existing AEDB:
185
191
  >>> edb = Edb("myproject.aedb")
186
192
 
187
- Import board file:
193
+ >>> # Import board file:
188
194
  >>> edb = Edb("my_board.brd")
189
195
  """
190
196
 
@@ -486,7 +492,7 @@ class Edb(EdbInit):
486
492
 
487
493
  Returns
488
494
  -------
489
- dict[str, Union[:class:`GapPort`, :class:`WavePort`, :class:`CoaxPort`]]
495
+ dict[str, list[:class:`GapPort` or :class:`WavePort` or :class:`CoaxPort`]]
490
496
  Port names and objects.
491
497
  """
492
498
  terminals = [term for term in self.layout.terminals if not term.is_reference_terminal]
@@ -572,7 +578,7 @@ class Edb(EdbInit):
572
578
 
573
579
  Examples
574
580
  --------
575
- Open an existing EDB database:
581
+ >>> # Open an existing EDB database:
576
582
  >>> edb = Edb("myproject.aedb")
577
583
  """
578
584
  self.standalone = self.standalone
@@ -763,10 +769,9 @@ class Edb(EdbInit):
763
769
 
764
770
  Examples
765
771
  --------
766
- Import a BRD file:
772
+ >>> # Import a BRD file:
767
773
  >>> edb.import_layout_file("my_board.brd", r"C:/project")
768
-
769
- Import a GDS file with control file:
774
+ >>> # Import a GDS file with control file:
770
775
  >>> edb.import_layout_file("layout.gds", control_file="control.xml")
771
776
  """
772
777
  self._components = None
@@ -831,7 +836,7 @@ class Edb(EdbInit):
831
836
 
832
837
  Examples
833
838
  --------
834
- Export to IPC2581 format:
839
+ >>> # Export to IPC2581 format:
835
840
  >>> edb.export_to_ipc2581("output.xml")
836
841
  """
837
842
  if units.lower() not in ["millimeter", "inch", "micron"]: # pragma no cover
@@ -1238,7 +1243,7 @@ class Edb(EdbInit):
1238
1243
  """Close EDB and clean up resources.
1239
1244
 
1240
1245
  ..deprecated:: 0.51.0
1241
- Use: func:`close` instead.
1246
+ Use :func:`close` instead.
1242
1247
 
1243
1248
  Returns
1244
1249
  -------
@@ -1257,17 +1262,8 @@ class Edb(EdbInit):
1257
1262
  """Save current EDB database.
1258
1263
 
1259
1264
  ..deprecated:: 0.51.0
1260
- Use: func:`save` instead.
1265
+ Use :func:`save` instead.
1261
1266
 
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
1267
  """
1272
1268
  warnings.warn("Use method save instead.", DeprecationWarning)
1273
1269
  return self.save()
@@ -1276,22 +1272,7 @@ class Edb(EdbInit):
1276
1272
  """Save EDB database to new location.
1277
1273
 
1278
1274
  ..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")
1275
+ Use :func:`save_as` instead.
1295
1276
  """
1296
1277
  warnings.warn("Use method save_as instead.", DeprecationWarning)
1297
1278
  return self.save_as(fname)
@@ -1307,8 +1288,12 @@ class Edb(EdbInit):
1307
1288
  # return self.edb_api.utility.utility.Command.Execute(func)
1308
1289
  pass
1309
1290
 
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)."""
1291
+ def import_cadence_file(self, inputBrd, WorkDir=None, anstranslator_full_path="", use_ppe=False) -> bool:
1292
+ """Import Cadence board file.
1293
+
1294
+ .. deprecated:: 0.50
1295
+ Use :func:`import_layout_file` instead.
1296
+ """
1312
1297
  if self.import_layout_pcb(
1313
1298
  inputBrd,
1314
1299
  working_dir=WorkDir,
@@ -1707,10 +1692,9 @@ class Edb(EdbInit):
1707
1692
 
1708
1693
  Examples
1709
1694
  --------
1710
- Create a basic cutout:
1695
+ >>> # Create a basic cutout:
1711
1696
  >>> edb.cutout(signal_list=["Net1"], reference_list=["GND"])
1712
-
1713
- Create cutout with custom polygon:
1697
+ >>> # Create cutout with custom polygon:
1714
1698
  >>> custom_poly = [[0,0], [10e-3,0], [10e-3,10e-3], [0,10e-3]]
1715
1699
  >>> edb.cutout(custom_extent=custom_poly)
1716
1700
  """
@@ -2460,7 +2444,7 @@ class Edb(EdbInit):
2460
2444
 
2461
2445
  Examples
2462
2446
  --------
2463
- Export to HFSS project:
2447
+ >>> # Export to HFSS project:
2464
2448
  >>> edb.export_hfss(r"C:/output", net_list=["SignalNet"])
2465
2449
  """
2466
2450
  siwave_s = SiwaveSolve(self.edbpath, aedt_installer_path=self.base_path)
@@ -2496,7 +2480,7 @@ class Edb(EdbInit):
2496
2480
 
2497
2481
  Examples
2498
2482
  --------
2499
- Export to Q3D project:
2483
+ >>> # Export to Q3D project:
2500
2484
  >>> edb.export_q3d(r"C:/output")
2501
2485
  """
2502
2486
  siwave_s = SiwaveSolve(self.edbpath, aedt_installer_path=self.base_path)
@@ -2539,7 +2523,7 @@ class Edb(EdbInit):
2539
2523
 
2540
2524
  Examples
2541
2525
  --------
2542
- Export to Maxwell project:
2526
+ >>> # Export to Maxwell project:
2543
2527
  >>> edb.export_maxwell(r"C:/output")
2544
2528
  """
2545
2529
  siwave_s = SiwaveSolve(self.edbpath, aedt_installer_path=self.base_path)
@@ -2562,7 +2546,7 @@ class Edb(EdbInit):
2562
2546
 
2563
2547
  Examples
2564
2548
  --------
2565
- Solve with SIwave:
2549
+ >>> # Solve with SIwave:
2566
2550
  >>> edb.solve_siwave()
2567
2551
  """
2568
2552
  process = SiwaveSolve(self.edbpath, aedt_version=self.edbversion)
@@ -2762,7 +2746,7 @@ class Edb(EdbInit):
2762
2746
  Returns
2763
2747
  -------
2764
2748
  list
2765
- [[min_x, min_y], [max_x, max_y]] in meters.
2749
+ list[list[min_x, min_y], list[max_x, max_y]] in meters.
2766
2750
  """
2767
2751
  lay_inst_polygon_data = [obj_inst.get_bbox() for obj_inst in self.layout_instance.query_layout_obj_instances()]
2768
2752
  layout_bbox = GrpcPolygonData.bbox_of_polygons(lay_inst_polygon_data)
@@ -2860,30 +2844,52 @@ class Edb(EdbInit):
2860
2844
  @property
2861
2845
  def setups(
2862
2846
  self,
2863
- ) -> Union[HfssSimulationSetup, SiwaveSimulationSetup, SIWaveDCIRSimulationSetup, RaptorXSimulationSetup]:
2847
+ ) -> dict[
2848
+ str,
2849
+ Union[
2850
+ HfssSimulationSetup,
2851
+ SiwaveSimulationSetup,
2852
+ SIWaveDCIRSimulationSetup,
2853
+ RaptorXSimulationSetup,
2854
+ SIWaveCPASimulationSetup,
2855
+ ],
2856
+ ]:
2864
2857
  """Get the dictionary of all EDB HFSS and SIwave setups.
2865
2858
 
2866
2859
  Returns
2867
2860
  -------
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`]
2861
+ Dict[str,:class:`HfssSimulationSetup`] or
2862
+ Dict[str,:class:`SiwaveSimulationSetup`] or
2863
+ Dict[str,:class:`SIWaveDCIRSimulationSetup`] or
2864
+ Dict[str,:class:`RaptorXSimulationSetup`]
2865
+ Dict[str,:class:`SIWaveCPASimulationSetup`]
2872
2866
 
2873
2867
  """
2874
- self._setups = {}
2868
+ from ansys.edb.core.database import ProductIdType as GrpcProductIdType
2869
+
2870
+ from pyedb.siwave_core.product_properties import SIwaveProperties
2871
+
2872
+ setups = {}
2875
2873
  for setup in self.active_cell.simulation_setups:
2876
2874
  setup = setup.cast()
2877
2875
  setup_type = setup.type.name
2878
2876
  if setup_type == "HFSS":
2879
- self._setups[setup.name] = HfssSimulationSetup(self, setup)
2877
+ setups[setup.name] = HfssSimulationSetup(self, setup)
2880
2878
  elif setup_type == "SI_WAVE":
2881
- self._setups[setup.name] = SiwaveSimulationSetup(self, setup)
2879
+ setups[setup.name] = SiwaveSimulationSetup(self, setup)
2882
2880
  elif setup_type == "SI_WAVE_DCIR":
2883
- self._setups[setup.name] = SIWaveDCIRSimulationSetup(self, setup)
2881
+ setups[setup.name] = SIWaveDCIRSimulationSetup(self, setup)
2884
2882
  elif setup_type == "RAPTOR_X":
2885
- self._setups[setup.name] = RaptorXSimulationSetup(self, setup)
2886
- return self._setups
2883
+ setups[setup.name] = RaptorXSimulationSetup(self, setup)
2884
+ try:
2885
+ cpa_setup_name = self.active_cell.get_product_property(
2886
+ GrpcProductIdType.SIWAVE, SIwaveProperties.CPA_SIM_NAME
2887
+ ).value
2888
+ except:
2889
+ cpa_setup_name = ""
2890
+ if cpa_setup_name:
2891
+ setups[cpa_setup_name] = SIWaveCPASimulationSetup(self, cpa_setup_name)
2892
+ return setups
2887
2893
 
2888
2894
  @property
2889
2895
  def hfss_setups(self) -> dict[str, HfssSimulationSetup]:
@@ -2919,8 +2925,7 @@ class Edb(EdbInit):
2919
2925
 
2920
2926
  Returns
2921
2927
  -------
2922
- Dict[str,:class:`SiwaveSimulationSetup
2923
- <pyedb.grpc.database.simulation_setup.siwave_simulation_setup.SiwaveSimulationSetup>`]
2928
+ Dict[str,:class:`SiwaveSimulationSetup`]
2924
2929
  """
2925
2930
  return {name: i for name, i in self.setups.items() if isinstance(i, SiwaveSimulationSetup)}
2926
2931
 
@@ -2931,16 +2936,6 @@ class Edb(EdbInit):
2931
2936
 
2932
2937
  . deprecated:: pyedb 0.30.0
2933
2938
  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
2939
  """
2945
2940
  warnings.warn(
2946
2941
  "`create_hfss_setup` is deprecated and is now located here " "`pyedb.grpc.core.hfss.add_setup` instead.",
@@ -2964,8 +2959,7 @@ class Edb(EdbInit):
2964
2959
 
2965
2960
  Returns
2966
2961
  -------
2967
- :class:`RaptorXSimulationSetup
2968
- <pyedb.grpc.database.simulation_setup.raptor_x_simulation_setup.RaptorXSimulationSetup>`
2962
+ :class:`RaptorXSimulationSetup`
2969
2963
  RaptorX setup or False if unsupported.
2970
2964
  """
2971
2965
  from ansys.edb.core.simulation_setup.raptor_x_simulation_setup import (
@@ -3021,8 +3015,7 @@ class Edb(EdbInit):
3021
3015
 
3022
3016
  Returns
3023
3017
  -------
3024
- :class:`SiwaveSimulationSetup
3025
- <pyedb.grpc.database.simulation_setup.siwave_simulation_setup.SiwaveSimulationSetup>`
3018
+ :class:`SiwaveSimulationSetup`
3026
3019
  SYZ analysis setup.
3027
3020
  """
3028
3021
  if not name:
@@ -3050,8 +3043,7 @@ class Edb(EdbInit):
3050
3043
 
3051
3044
  Returns
3052
3045
  -------
3053
- :class:`SIWaveDCIRSimulationSetup
3054
- <pyedb.grpc.database.simulation_setup.siwave_dcir_simulation_setup.SIWaveDCIRSimulationSetup>`
3046
+ :class:`SIWaveDCIRSimulationSetup`
3055
3047
  DC analysis setup.
3056
3048
  """
3057
3049
  if not name:
@@ -3095,8 +3087,8 @@ class Edb(EdbInit):
3095
3087
  self.logger.info(f"The W factor is {expansion_factor}, The initial extent = {max_width}")
3096
3088
  return max_width
3097
3089
 
3098
- def copy_zones(self, working_directory=None):
3099
- """Copy multizone EDB project to one new edb per zone.
3090
+ def copy_zones(self, working_directory=None) -> dict[str, tuple[int, GrpcPolygonData]]:
3091
+ """Copy multi-zone EDB project to one new edb per zone.
3100
3092
 
3101
3093
  Parameters
3102
3094
  ----------
@@ -3105,7 +3097,8 @@ class Edb(EdbInit):
3105
3097
 
3106
3098
  Returns
3107
3099
  -------
3108
- dict[str, [int,: class:`PolygonData <ansys.edb.core.geometry.polygon_data.PolygonData>`]]
3100
+ dict[str, tuple[int,:class:`PolygonData <ansys.edb.core.geometry.polygon_data.PolygonData>`]]
3101
+
3109
3102
  Return a dictionary with edb path as key and tuple Zone Id as first item and EDB polygon Data defining
3110
3103
  the region as second item.
3111
3104
 
@@ -3124,7 +3117,7 @@ class Edb(EdbInit):
3124
3117
  edb_zones = {}
3125
3118
  if not self.setups:
3126
3119
  self.siwave.add_siwave_syz_analysis()
3127
- self.save_edb()
3120
+ self.save()
3128
3121
  for zone_primitive in zone_primitives:
3129
3122
  if zone_primitive:
3130
3123
  edb_zone_path = os.path.join(working_directory, f"{zone_primitive.id}_{os.path.basename(self.edbpath)}")
@@ -3158,10 +3151,9 @@ class Edb(EdbInit):
3158
3151
 
3159
3152
  Returns
3160
3153
  -------
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.
3154
+ dict[str: str] or list[str]
3155
+ first dictionary defined_ports with edb name as key and existing port name list as value. Those ports are
3156
+ the ones defined before processing the multizone clipping. the second is the list of connected port.
3165
3157
 
3166
3158
  """
3167
3159
  terminals = {}
@@ -3280,29 +3272,8 @@ class Edb(EdbInit):
3280
3272
  """Create a port.
3281
3273
 
3282
3274
  ..deprecated:: 0.51.0
3283
- Use: func:`create_port` has been move to source_excitation.create_port.
3275
+ Use :func:`create_port` has been moved to source_excitation.create_port.
3284
3276
 
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
3277
  """
3307
3278
 
3308
3279
  warnings.warn("Use create_port from edb.source_excitation.create_port", DeprecationWarning)
@@ -3312,24 +3283,8 @@ class Edb(EdbInit):
3312
3283
  """Create a voltage probe.
3313
3284
 
3314
3285
  ..deprecated:: 0.50.0
3315
- Use: func:`create_voltage_probe` located in edb.source_excitation.create_voltage_probe instead.
3286
+ Use :func:`create_voltage_probe` has been moved to edb.source_excitation.create_voltage_probe.
3316
3287
 
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.
3329
-
3330
- Returns
3331
- -------
3332
- :class:`Terminal <pyedb.dotnet.database.edb_data.terminals.Terminal>`
3333
3288
  """
3334
3289
  warnings.warn("Use create_voltage_probe located in edb.source_excitation instead", DeprecationWarning)
3335
3290
  return self.source_excitation.create_voltage_probe(terminal, ref_terminal)
@@ -3338,24 +3293,8 @@ class Edb(EdbInit):
3338
3293
  """Create a voltage source.
3339
3294
 
3340
3295
  ..deprecated:: 0.50.0
3341
- Use: func:`create_voltage_source` located in edb.source_excitation.create_voltage_source instead.
3342
-
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.
3296
+ Use: func:`create_voltage_source` has been moved to edb.source_excitation.create_voltage_source.
3355
3297
 
3356
- Returns
3357
- -------
3358
- class:`ExcitationSources <legacy.database.edb_data.ports.ExcitationSources>`
3359
3298
  """
3360
3299
  warnings.warn(
3361
3300
  "use create_voltage_source located in edb.source_excitation.create_voltage_source instead",
@@ -3367,24 +3306,8 @@ class Edb(EdbInit):
3367
3306
  """Create a current source.
3368
3307
 
3369
3308
  ..deprecated:: 0.50.0
3370
- Use: func:`create_current_source` located in edb.source_excitation.create_current_source instead.
3371
-
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.
3309
+ Use :func:`create_current_source` has been moved to edb.source_excitation.create_current_source.
3384
3310
 
3385
- Returns
3386
- -------
3387
- :class:`ExcitationSources <legacy.database.edb_data.ports.ExcitationSources>`
3388
3311
  """
3389
3312
  warnings.warn(
3390
3313
  "use create_current_source located in edb.source_excitation.create_current_source instead",
@@ -3396,22 +3319,7 @@ class Edb(EdbInit):
3396
3319
  """Place terminal between two points.
3397
3320
 
3398
3321
  ..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>`
3322
+ Use: func:`get_point_terminal` has been moved to edb.source_excitation.get_point_terminal.
3415
3323
  """
3416
3324
 
3417
3325
  warnings.warn(
@@ -3487,14 +3395,13 @@ class Edb(EdbInit):
3487
3395
  --------
3488
3396
  Parametrize design elements:
3489
3397
  >>> params = edb.auto_parametrize_design(
3490
- ... layers=True,
3491
- ... materials=True,
3492
- ... trace_net_filter=["Clock"]
3493
- ... )
3398
+ >>> layers=True,
3399
+ >>> materials=True,
3400
+ >>> trace_net_filter=["Clock"])
3494
3401
  """
3495
3402
  edb_original_path = self.edbpath
3496
3403
  if output_aedb_path:
3497
- self.save_edb_as(output_aedb_path)
3404
+ self.save_as(output_aedb_path)
3498
3405
  if isinstance(trace_net_filter, str):
3499
3406
  trace_net_filter = [trace_net_filter]
3500
3407
  parameters = []
@@ -3682,10 +3589,10 @@ class Edb(EdbInit):
3682
3589
  void.expand(expand_voids_size, round_corners=False)
3683
3590
 
3684
3591
  if not open_aedb_at_end and self.edbpath != edb_original_path:
3685
- self.save_edb()
3686
- self.close_edb()
3592
+ self.save()
3593
+ self.close()
3687
3594
  self.edbpath = edb_original_path
3688
- self.open_edb()
3595
+ self.open()
3689
3596
  return parameters
3690
3597
 
3691
3598
  @staticmethod
@@ -3921,3 +3828,72 @@ class Edb(EdbInit):
3921
3828
  ET.indent(tree, space="\t", level=0)
3922
3829
  tree.write(control_path)
3923
3830
  return True if os.path.exists(control_path) else False
3831
+
3832
+ def compare(self, input_file, results=""):
3833
+ """Compares current open database with another one.
3834
+
3835
+ Parameters
3836
+ ----------
3837
+ input_file : str
3838
+ Path to the edb file.
3839
+ results: str, optional
3840
+ Path to directory in which results will be saved. If no path is given, a new "_compare_results"
3841
+ directory will be created with the same naming and path as the .aedb folder.
3842
+ Returns
3843
+ -------
3844
+ bool
3845
+ ``True`` when successful, ``False`` when failed.
3846
+ """
3847
+ self.save()
3848
+ if not results:
3849
+ results = self.edbpath[:-5] + "_compare_results"
3850
+ os.mkdir(results)
3851
+ command = os.path.join(self.base_path, "EDBDiff.exe")
3852
+ if is_linux:
3853
+ mono_path = os.path.join(self.base_path, "common/mono/Linux64/bin/mono")
3854
+ cmd_input = [mono_path, command, input_file, self.edbpath, results]
3855
+ else:
3856
+ cmd_input = [command, input_file, self.edbpath, results]
3857
+ subprocess.run(cmd_input)
3858
+
3859
+ if not os.path.exists(os.path.join(results, "EDBDiff.csv")):
3860
+ self.logger.error("Comparison execution failed")
3861
+ return False
3862
+ else:
3863
+ self.logger.info("Comparison correctly completed")
3864
+ return True
3865
+
3866
+ def import_layout_component(self, component_path) -> GrpcLayoutComponent:
3867
+ """Import a layout component inside the current layout and place it at the origin.
3868
+ This feature is only supported with PyEDB gRPC. Encryption is not yet supported.
3869
+
3870
+ Parameters
3871
+ ----------
3872
+ component_path : str
3873
+ Layout component path (.aedbcomp file).
3874
+
3875
+ Returns
3876
+ -------
3877
+ class:`LayoutComponent <ansys.edb.core.hierarchy.layout_component.LayoutComponent>`.
3878
+ """
3879
+
3880
+ return GrpcLayoutComponent.import_layout_component(layout=self.active_layout, aedb_comp_path=component_path)
3881
+
3882
+ def export_layout_component(self, component_path) -> bool:
3883
+ """Export a layout component from the current layout.
3884
+ This feature is only supported with PyEDB gRPC. Encryption is not yet supported.
3885
+
3886
+ Parameters
3887
+ ----------
3888
+ component_path : str
3889
+ Layout component path (.aedbcomp file).
3890
+
3891
+ Returns
3892
+ -------
3893
+ bool
3894
+ `True` if layout component is successfully exported, `False` otherwise.
3895
+ """
3896
+
3897
+ return GrpcLayoutComponent.export_layout_component(
3898
+ layout=self.active_layout, output_aedb_comp_path=component_path
3899
+ )
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