pyedb 0.5.2__py3-none-any.whl → 0.7.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 (108) hide show
  1. pyedb/__init__.py +2 -3
  2. pyedb/dotnet/application/Variables.py +22 -0
  3. pyedb/dotnet/edb.py +51 -15
  4. pyedb/dotnet/edb_core/cell/hierarchy/model.py +39 -0
  5. pyedb/dotnet/edb_core/components.py +23 -1
  6. pyedb/dotnet/edb_core/configuration.py +175 -60
  7. pyedb/dotnet/edb_core/definition/component_def.py +24 -3
  8. pyedb/dotnet/edb_core/definition/component_model.py +22 -0
  9. pyedb/dotnet/edb_core/definition/definition_obj.py +24 -4
  10. pyedb/dotnet/edb_core/definition/definitions.py +22 -1
  11. pyedb/dotnet/edb_core/definition/package_def.py +23 -3
  12. pyedb/dotnet/edb_core/dotnet/database.py +22 -0
  13. pyedb/dotnet/edb_core/dotnet/layout.py +22 -0
  14. pyedb/dotnet/edb_core/dotnet/primitive.py +22 -0
  15. pyedb/dotnet/edb_core/edb_data/components_data.py +112 -3
  16. pyedb/dotnet/edb_core/edb_data/connectable.py +22 -0
  17. pyedb/dotnet/edb_core/edb_data/control_file.py +22 -0
  18. pyedb/dotnet/edb_core/edb_data/design_options.py +23 -0
  19. pyedb/dotnet/edb_core/edb_data/edbvalue.py +23 -0
  20. pyedb/dotnet/edb_core/edb_data/hfss_extent_info.py +22 -0
  21. pyedb/dotnet/edb_core/edb_data/hfss_simulation_setup_data.py +22 -0
  22. pyedb/dotnet/edb_core/edb_data/layer_data.py +22 -0
  23. pyedb/dotnet/edb_core/edb_data/nets_data.py +23 -1
  24. pyedb/dotnet/edb_core/edb_data/obj_base.py +23 -0
  25. pyedb/dotnet/edb_core/edb_data/padstacks_data.py +42 -0
  26. pyedb/dotnet/edb_core/edb_data/ports.py +22 -0
  27. pyedb/dotnet/edb_core/edb_data/primitives_data.py +62 -7
  28. pyedb/dotnet/edb_core/edb_data/simulation_configuration.py +22 -0
  29. pyedb/dotnet/edb_core/edb_data/simulation_setup.py +22 -0
  30. pyedb/dotnet/edb_core/edb_data/siwave_simulation_setup_data.py +22 -0
  31. pyedb/dotnet/edb_core/edb_data/sources.py +23 -3
  32. pyedb/dotnet/edb_core/edb_data/terminals.py +22 -0
  33. pyedb/dotnet/edb_core/edb_data/utilities.py +25 -2
  34. pyedb/dotnet/edb_core/edb_data/variables.py +23 -0
  35. pyedb/dotnet/edb_core/general.py +22 -0
  36. pyedb/dotnet/edb_core/hfss.py +23 -1
  37. pyedb/dotnet/edb_core/layout.py +68 -35
  38. pyedb/dotnet/edb_core/layout_validation.py +24 -2
  39. pyedb/dotnet/edb_core/materials.py +22 -0
  40. pyedb/dotnet/edb_core/net_class.py +22 -0
  41. pyedb/dotnet/edb_core/nets.py +27 -5
  42. pyedb/dotnet/edb_core/padstack.py +22 -0
  43. pyedb/dotnet/edb_core/siwave.py +22 -0
  44. pyedb/dotnet/edb_core/stackup.py +22 -0
  45. pyedb/edb_logger.py +22 -0
  46. pyedb/generic/constants.py +22 -0
  47. pyedb/generic/data_handlers.py +0 -1
  48. pyedb/generic/design_types.py +24 -0
  49. pyedb/generic/general_methods.py +22 -2
  50. pyedb/generic/plot.py +3 -13
  51. pyedb/generic/settings.py +22 -0
  52. pyedb/ipc2581/bom/bom.py +22 -0
  53. pyedb/ipc2581/bom/bom_item.py +22 -0
  54. pyedb/ipc2581/bom/characteristics.py +22 -0
  55. pyedb/ipc2581/bom/refdes.py +22 -0
  56. pyedb/ipc2581/content/color.py +22 -0
  57. pyedb/ipc2581/content/content.py +22 -0
  58. pyedb/ipc2581/content/dictionary_color.py +22 -0
  59. pyedb/ipc2581/content/dictionary_fill.py +22 -0
  60. pyedb/ipc2581/content/dictionary_line.py +22 -0
  61. pyedb/ipc2581/content/entry_color.py +22 -0
  62. pyedb/ipc2581/content/entry_line.py +22 -0
  63. pyedb/ipc2581/content/fill.py +22 -0
  64. pyedb/ipc2581/content/layer_ref.py +22 -0
  65. pyedb/ipc2581/content/standard_geometries_dictionary.py +22 -0
  66. pyedb/ipc2581/ecad/cad_data/assembly_drawing.py +22 -0
  67. pyedb/ipc2581/ecad/cad_data/cad_data.py +22 -0
  68. pyedb/ipc2581/ecad/cad_data/component.py +22 -0
  69. pyedb/ipc2581/ecad/cad_data/drill.py +22 -0
  70. pyedb/ipc2581/ecad/cad_data/feature.py +22 -0
  71. pyedb/ipc2581/ecad/cad_data/layer.py +22 -0
  72. pyedb/ipc2581/ecad/cad_data/layer_feature.py +22 -0
  73. pyedb/ipc2581/ecad/cad_data/logical_net.py +22 -0
  74. pyedb/ipc2581/ecad/cad_data/outline.py +22 -0
  75. pyedb/ipc2581/ecad/cad_data/package.py +22 -0
  76. pyedb/ipc2581/ecad/cad_data/padstack_def.py +22 -0
  77. pyedb/ipc2581/ecad/cad_data/padstack_hole_def.py +22 -0
  78. pyedb/ipc2581/ecad/cad_data/padstack_instance.py +22 -0
  79. pyedb/ipc2581/ecad/cad_data/padstack_pad_def.py +22 -0
  80. pyedb/ipc2581/ecad/cad_data/path.py +22 -0
  81. pyedb/ipc2581/ecad/cad_data/phy_net.py +22 -0
  82. pyedb/ipc2581/ecad/cad_data/pin.py +22 -0
  83. pyedb/ipc2581/ecad/cad_data/polygon.py +22 -0
  84. pyedb/ipc2581/ecad/cad_data/profile.py +22 -0
  85. pyedb/ipc2581/ecad/cad_data/stackup.py +22 -0
  86. pyedb/ipc2581/ecad/cad_data/stackup_group.py +22 -0
  87. pyedb/ipc2581/ecad/cad_data/stackup_layer.py +22 -0
  88. pyedb/ipc2581/ecad/cad_data/step.py +22 -0
  89. pyedb/ipc2581/ecad/cad_header.py +22 -0
  90. pyedb/ipc2581/ecad/ecad.py +22 -0
  91. pyedb/ipc2581/ecad/spec.py +22 -0
  92. pyedb/ipc2581/history_record.py +22 -0
  93. pyedb/ipc2581/ipc2581.py +22 -0
  94. pyedb/ipc2581/logistic_header.py +22 -0
  95. pyedb/misc/aedtlib_personalib_install.py +22 -0
  96. pyedb/misc/downloads.py +22 -0
  97. pyedb/misc/misc.py +22 -0
  98. pyedb/misc/siw_feature_config/emc/component_tags.py +3 -5
  99. pyedb/misc/siw_feature_config/emc/net_tags.py +1 -3
  100. pyedb/misc/siw_feature_config/emc/tag_library.py +5 -4
  101. pyedb/misc/siw_feature_config/emc/xml_generic.py +1 -2
  102. pyedb/misc/siw_feature_config/emc_rule_checker_settings.py +55 -30
  103. pyedb/siwave.py +6 -4
  104. {pyedb-0.5.2.dist-info → pyedb-0.7.0.dist-info}/METADATA +1 -1
  105. pyedb-0.7.0.dist-info/RECORD +130 -0
  106. pyedb-0.5.2.dist-info/RECORD +0 -130
  107. {pyedb-0.5.2.dist-info → pyedb-0.7.0.dist-info}/LICENSE +0 -0
  108. {pyedb-0.5.2.dist-info → pyedb-0.7.0.dist-info}/WHEEL +0 -0
@@ -1,3 +1,25 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
1
23
  from collections import OrderedDict
2
24
  import math
3
25
  import re
@@ -122,6 +144,11 @@ class EDBPadProperties(object):
122
144
  """
123
145
  return [i.tofloat for i in self.parameters.values()]
124
146
 
147
+ @property
148
+ def parameters_values_string(self):
149
+ """Parameters value in string format."""
150
+ return [i.tostring for i in self.parameters.values()]
151
+
125
152
  @property
126
153
  def polygon_data(self):
127
154
  """Parameters.
@@ -477,6 +504,21 @@ class EDBPadstack(object):
477
504
  self._hole_parameters = self.hole_params[2]
478
505
  return self._hole_parameters
479
506
 
507
+ @property
508
+ def hole_diameter(self):
509
+ """Hole diameter."""
510
+ return list(self.hole_params[2])[0].ToDouble()
511
+
512
+ @hole_diameter.setter
513
+ def hole_diameter(self, value):
514
+ params = convert_py_list_to_net_list([self._get_edb_value(value)])
515
+ self._update_hole_parameters(params=params)
516
+
517
+ @property
518
+ def hole_diameter_string(self):
519
+ """Hole diameter in string format."""
520
+ return list(self.hole_params[2])[0].ToString()
521
+
480
522
  @pyedb_function_handler()
481
523
  def _update_hole_parameters(self, hole_type=None, params=None, offsetx=None, offsety=None, rotation=None):
482
524
  """Update hole parameters.
@@ -1,3 +1,25 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
1
23
  from pyedb.dotnet.edb_core.edb_data.terminals import (
2
24
  BundleTerminal,
3
25
  EdgeTerminal,
@@ -1,3 +1,25 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
1
23
  import math
2
24
 
3
25
  from pyedb.dotnet.edb_core.dotnet.database import NetDotNet
@@ -118,7 +140,8 @@ class EDBPrimitivesMain(Connectable):
118
140
  def layer(self):
119
141
  """Get the primitive edb layer object."""
120
142
  try:
121
- return self.primitive_object.GetLayer()
143
+ layer_name = self.primitive_object.GetLayer().GetName()
144
+ return self._pedb.stackup.layers[layer_name]
122
145
  except AttributeError: # pragma: no cover
123
146
  return None
124
147
 
@@ -131,7 +154,7 @@ class EDBPrimitivesMain(Connectable):
131
154
  str
132
155
  """
133
156
  try:
134
- return self.layer.GetName()
157
+ return self.layer.name
135
158
  except AttributeError: # pragma: no cover
136
159
  return None
137
160
 
@@ -380,7 +403,8 @@ class EDBPrimitives(EDBPrimitivesMain):
380
403
 
381
404
  Returns
382
405
  -------
383
- Converted polygon.
406
+ bool, :class:`dotnet.edb_core.edb_data.primitives.EDBPrimitives`
407
+ Polygon when successful, ``False`` when failed.
384
408
 
385
409
  """
386
410
  if self.type == "Path":
@@ -388,6 +412,8 @@ class EDBPrimitives(EDBPrimitivesMain):
388
412
  polygon = self._app.modeler.create_polygon(polygon_data, self.layer_name, [], self.net_name)
389
413
  self.primitive_object.Delete()
390
414
  return polygon
415
+ else:
416
+ return False
391
417
 
392
418
  @pyedb_function_handler()
393
419
  def subtract(self, primitives):
@@ -1005,6 +1031,35 @@ class EdbPolygon(EDBPrimitives, PolygonDotNet):
1005
1031
  return cloned_poly
1006
1032
  return False
1007
1033
 
1034
+ @pyedb_function_handler()
1035
+ def duplicate_across_layers(self, layers):
1036
+ """Duplicate across layer a primitive object.
1037
+
1038
+ Parameters:
1039
+
1040
+ layers: list
1041
+ list of str, with layer names
1042
+
1043
+ Returns
1044
+ -------
1045
+ bool
1046
+ ``True`` when successful, ``False`` when failed.
1047
+ """
1048
+ for layer in layers:
1049
+ if layer in self._pedb.stackup.layers:
1050
+ duplicate_polygon = self._app.edb_api.cell.primitive.polygon.create(
1051
+ self._app.active_layout, layer, self.net, self.polygon_data.edb_api
1052
+ )
1053
+ if duplicate_polygon:
1054
+ for void in self.voids:
1055
+ duplicate_void = self._app.edb_api.cell.primitive.polygon.create(
1056
+ self._app.active_layout, layer, self.net, void.polygon_data.edb_api
1057
+ )
1058
+ duplicate_polygon.prim_obj.AddVoid(duplicate_void.prim_obj)
1059
+ else:
1060
+ return False
1061
+ return True
1062
+
1008
1063
  @pyedb_function_handler
1009
1064
  def move(self, vector):
1010
1065
  """Move polygon along a vector.
@@ -1082,12 +1137,12 @@ class EdbPolygon(EDBPrimitives, PolygonDotNet):
1082
1137
  Scaling factor.
1083
1138
  center : List of float or str [x,y], optional
1084
1139
  If None scaling is done from polygon center.
1085
-
1140
+
1086
1141
  Returns
1087
1142
  -------
1088
1143
  bool
1089
1144
  ``True`` when successful, ``False`` when failed.
1090
-
1145
+
1091
1146
  Examples
1092
1147
  --------
1093
1148
  >>> edbapp = pyaedt.Edb("myproject.aedb")
@@ -1114,12 +1169,12 @@ class EdbPolygon(EDBPrimitives, PolygonDotNet):
1114
1169
  @pyedb_function_handler
1115
1170
  def move_layer(self, layer):
1116
1171
  """Move polygon to given layer.
1117
-
1172
+
1118
1173
  Parameters
1119
1174
  ----------
1120
1175
  layer : str
1121
1176
  layer name.
1122
-
1177
+
1123
1178
  Returns
1124
1179
  -------
1125
1180
  bool
@@ -1,3 +1,25 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
1
23
  from collections import OrderedDict
2
24
  import json
3
25
  import os
@@ -1,3 +1,25 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
1
23
  from pyedb.generic.general_methods import generate_unique_name, pyedb_function_handler
2
24
 
3
25
 
@@ -1,3 +1,25 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
1
23
  import warnings
2
24
 
3
25
  from pyedb.dotnet.edb_core.edb_data.simulation_setup import BaseSimulationSetup
@@ -1,3 +1,25 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
1
23
  from pyedb.generic.constants import NodeType, SourceType
2
24
  from pyedb.generic.general_methods import generate_unique_name, pyedb_function_handler
3
25
 
@@ -316,9 +338,7 @@ class PinGroup(object):
316
338
 
317
339
  @pyedb_function_handler()
318
340
  def _json_format(self):
319
- dict_out = {"component": self.component,
320
- "name": self.name, "net": self.net,
321
- "node_type": self.node_type}
341
+ dict_out = {"component": self.component, "name": self.name, "net": self.net, "node_type": self.node_type}
322
342
  return dict_out
323
343
 
324
344
  @pyedb_function_handler()
@@ -1,3 +1,25 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
1
23
  import re
2
24
 
3
25
  from pyedb.dotnet.edb_core.edb_data.connectable import Connectable
@@ -1,3 +1,26 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+
1
24
  class EDBStatistics(object):
2
25
  """Statistics object
3
26
 
@@ -24,8 +47,8 @@ class EDBStatistics(object):
24
47
  self._nb_layer = 0
25
48
  self._stackup_thickness = 0.0
26
49
  self._nb_vias = 0
27
- self._occupying_ratio = 0.0
28
- self._occupying_surface = 0.0
50
+ self._occupying_ratio = {}
51
+ self._occupying_surface = {}
29
52
  self._layout_size = [0.0, 0.0, 0.0, 0.0]
30
53
  self._nb_polygons = 0
31
54
  self._nb_traces = 0
@@ -1,3 +1,26 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+
1
24
  class Variable:
2
25
  """Manages EDB methods for variable accessible from `Edb.Utility.VariableServer` property."""
3
26
 
@@ -1,3 +1,25 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
1
23
  """
2
24
  This module contains EDB general methods and related methods.
3
25
 
@@ -1,3 +1,25 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
1
23
  """
2
24
  This module contains the ``EdbHfss`` class.
3
25
  """
@@ -1143,7 +1165,7 @@ class EdbHfss(object):
1143
1165
  if not ref_prim:
1144
1166
  self._logger.error("Failed to collect valid reference primitives for terminal")
1145
1167
  if ref_prim:
1146
- reference_layer = ref_prim[0].layer
1168
+ reference_layer = ref_prim[0].layer._edb_layer
1147
1169
  if term.SetReferenceLayer(reference_layer): # pragma no cover
1148
1170
  self._logger.info("Port {} created".format(port_name))
1149
1171
  return terminal_info
@@ -1,3 +1,25 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
1
23
  """
2
24
  This module contains these classes: `EdbLayout` and `Shape`.
3
25
  """
@@ -1104,7 +1126,7 @@ class EdbLayout(object):
1104
1126
  return True
1105
1127
 
1106
1128
  @pyedb_function_handler()
1107
- def unite_polygons_on_layer(self, layer_name=None, delete_padstack_gemometries=False, net_list=[]):
1129
+ def unite_polygons_on_layer(self, layer_name=None, delete_padstack_gemometries=False, net_names_list=[]):
1108
1130
  """Try to unite all Polygons on specified layer.
1109
1131
 
1110
1132
  Parameters
@@ -1113,8 +1135,8 @@ class EdbLayout(object):
1113
1135
  Name of layer name to unite objects on. The default is ``None``, in which case all layers are taken.
1114
1136
  delete_padstack_gemometries : bool, optional
1115
1137
  Whether to delete all padstack geometries. The default is ``False``.
1116
- net_list : list[str] : optional
1117
- Net list filter. The default is ``[]``, in which case all nets are taken.
1138
+ net_names_list : list[str] : optional
1139
+ Net names list filter. The default is ``[]``, in which case all nets are taken.
1118
1140
 
1119
1141
  Returns
1120
1142
  -------
@@ -1129,6 +1151,9 @@ class EdbLayout(object):
1129
1151
  for lay in layer_name:
1130
1152
  self._logger.info("Uniting Objects on layer %s.", lay)
1131
1153
  poly_by_nets = {}
1154
+ all_voids = []
1155
+ list_polygon_data = []
1156
+ delete_list = []
1132
1157
  if lay in list(self.polygons_by_layer.keys()):
1133
1158
  for poly in self.polygons_by_layer[lay]:
1134
1159
  if not poly.GetNet().GetName() in list(poly_by_nets.keys()):
@@ -1138,34 +1163,35 @@ class EdbLayout(object):
1138
1163
  if poly.GetNet().GetName():
1139
1164
  poly_by_nets[poly.GetNet().GetName()].append(poly)
1140
1165
  for net in poly_by_nets:
1141
- if net in net_list or not net_list: # pragma no cover
1142
- list_polygon_data = [i.GetPolygonData() for i in poly_by_nets[net]]
1143
- all_voids = [i.Voids for i in poly_by_nets[net]]
1144
- a = self._edb.geometry.polygon_data.unite(convert_py_list_to_net_list(list_polygon_data))
1145
- for item in a:
1146
- for v in all_voids:
1147
- for void in v:
1148
- if int(item.GetIntersectionType(void.GetPolygonData())) == 2:
1149
- item.AddHole(void.GetPolygonData())
1150
- poly = self._edb.cell.primitive.polygon.create(
1151
- self._active_layout,
1152
- lay,
1153
- self._pedb.nets.nets[net],
1154
- item,
1155
- )
1156
- list_to_delete = [i for i in poly_by_nets[net]]
1157
- for v in all_voids:
1158
- for void in v:
1159
- for poly in poly_by_nets[net]: # pragma no cover
1160
- if int(void.GetPolygonData().GetIntersectionType(poly.GetPolygonData())) >= 2:
1161
- try:
1162
- id = list_to_delete.index(poly)
1163
- except ValueError:
1164
- id = -1
1165
- if id >= 0:
1166
- list_to_delete.pop(id)
1167
-
1168
- [i.Delete() for i in list_to_delete] # pragma no cover
1166
+ if net in net_names_list or not net_names_list:
1167
+ for i in poly_by_nets[net]:
1168
+ list_polygon_data.append(i.GetPolygonData())
1169
+ delete_list.append(i)
1170
+ all_voids.append(i.Voids)
1171
+ a = self._edb.geometry.polygon_data.unite(convert_py_list_to_net_list(list_polygon_data))
1172
+ for item in a:
1173
+ for v in all_voids:
1174
+ for void in v:
1175
+ if int(item.GetIntersectionType(void.GetPolygonData())) == 2:
1176
+ item.AddHole(void.GetPolygonData())
1177
+ poly = self._edb.cell.primitive.polygon.create(
1178
+ self._active_layout,
1179
+ lay,
1180
+ self._pedb.nets.nets[net],
1181
+ item,
1182
+ )
1183
+ for v in all_voids:
1184
+ for void in v:
1185
+ for poly in poly_by_nets[net]: # pragma no cover
1186
+ if int(void.GetPolygonData().GetIntersectionType(poly.GetPolygonData())) >= 2:
1187
+ try:
1188
+ id = delete_list.index(poly)
1189
+ except ValueError:
1190
+ id = -1
1191
+ if id >= 0:
1192
+ delete_list.pop(id)
1193
+ for poly in delete_list:
1194
+ poly.Delete()
1169
1195
 
1170
1196
  if delete_padstack_gemometries:
1171
1197
  self._logger.info("Deleting Padstack Definitions")
@@ -1233,12 +1259,19 @@ class EdbLayout(object):
1233
1259
  stat_model.num_vias = len(self._pedb.padstacks.instances)
1234
1260
  stat_model.stackup_thickness = self._pedb.stackup.get_layout_thickness()
1235
1261
  if evaluate_area:
1262
+ outline_surface = stat_model.layout_size[0] * stat_model.layout_size[1]
1236
1263
  if net_list:
1237
1264
  netlist = list(self._pedb.nets.nets.keys())
1238
1265
  _poly = self._pedb.get_conformal_polygon_from_netlist(netlist)
1239
1266
  else:
1240
- _poly = self._pedb.get_conformal_polygon_from_netlist()
1241
- stat_model.occupying_surface = _poly.Area()
1242
- outline_surface = stat_model.layout_size[0] * stat_model.layout_size[1]
1243
- stat_model.occupying_ratio = stat_model.occupying_surface / outline_surface
1267
+ for layer in list(self._pedb.stackup.signal_layers.keys()):
1268
+ surface = 0.0
1269
+ primitives = self.primitives_by_layer[layer]
1270
+ for prim in primitives:
1271
+ if prim.type == "Path":
1272
+ surface += prim.length * prim.width
1273
+ if prim.type == "Polygon":
1274
+ surface += prim.polygon_data.edb_api.Area()
1275
+ stat_model.occupying_surface[layer] = surface
1276
+ stat_model.occupying_ratio[layer] = surface / outline_surface
1244
1277
  return stat_model