From 40a7fef9bb505c61b5f4846086660d113bc64b8b Mon Sep 17 00:00:00 2001 From: hui-zhou-a Date: Thu, 2 Oct 2025 10:52:43 +0200 Subject: [PATCH 1/3] REFACTOR: EDB CFG RLC --- src/pyedb/configuration/cfg_components.py | 39 +++++++++++++++++++---- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/src/pyedb/configuration/cfg_components.py b/src/pyedb/configuration/cfg_components.py index f88fbb8458..52abf9ea3e 100644 --- a/src/pyedb/configuration/cfg_components.py +++ b/src/pyedb/configuration/cfg_components.py @@ -98,14 +98,39 @@ def _set_model_properties_to_edb(self): m = self._pedb._edb.Cell.Hierarchy.PinPairModel() for i in self.pin_pair_model: p = self._pedb._edb.Utility.PinPair(str(i["first_pin"]), str(i["second_pin"])) + res = i.get("resistance") + if res is None: + # If resistance is not defined, set it to 0 and disable it + res = "0ohm" + en_res = False + else: + # If resistance is defined, use the provided value and enabled status + res = i["resistance"] + en_res = i.get("resistance_enabled", True) + ind = i.get("inductance") + if ind is None: + # If inductance is not defined, set it to 0 and disable it + ind = "0nH" + en_ind = False + else: + # If inductance is defined, use the provided value and enabled status + ind = i["inductance"] + en_ind = i.get("inductance_enabled", True) + cap = i.get("capacitance") + if cap is None: + # If capacitance is not defined, set it to 0 and disable it + cap = "0pF" + en_cap = False + else: + # If capacitance is defined, use the provided value and enabled status + cap = i["capacitance"] + en_cap = i.get("capacitance_enabled", True) + rlc = self._pedb._edb.Utility.Rlc( - self._pedb.edb_value(i["resistance"]), - i["resistance_enabled"], - self._pedb.edb_value(i["inductance"]), - i["inductance_enabled"], - self._pedb.edb_value(i["capacitance"]), - i["capacitance_enabled"], - i["is_parallel"], + self._pedb.edb_value(res), en_res, + self._pedb.edb_value(ind), en_ind, + self._pedb.edb_value(cap), en_cap, + i.get("is_parallel", False), ) m.SetPinPairRlc(p, rlc) c_p.SetModel(m) From 4c012a5746a33f9eac4bb67484088295b81b44dd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 08:53:26 +0000 Subject: [PATCH 2/3] MISC: Auto fixes from pre-commit.com hooks For more information, see https://pre-commit.ci --- src/pyedb/configuration/cfg_components.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pyedb/configuration/cfg_components.py b/src/pyedb/configuration/cfg_components.py index 52abf9ea3e..46517a6a7d 100644 --- a/src/pyedb/configuration/cfg_components.py +++ b/src/pyedb/configuration/cfg_components.py @@ -127,9 +127,12 @@ def _set_model_properties_to_edb(self): en_cap = i.get("capacitance_enabled", True) rlc = self._pedb._edb.Utility.Rlc( - self._pedb.edb_value(res), en_res, - self._pedb.edb_value(ind), en_ind, - self._pedb.edb_value(cap), en_cap, + self._pedb.edb_value(res), + en_res, + self._pedb.edb_value(ind), + en_ind, + self._pedb.edb_value(cap), + en_cap, i.get("is_parallel", False), ) m.SetPinPairRlc(p, rlc) From a670b902009f6df4c69e6dcf2d6448fd7e33a585 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 13:25:11 +0000 Subject: [PATCH 3/3] MISC: Auto fixes from pre-commit.com hooks For more information, see https://pre-commit.ci --- src/pyedb/workflows/utilities/__init__.py | 21 +++++++++++++++++++++ src/pyedb/workflows/utilities/cutout.py | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/pyedb/workflows/utilities/__init__.py b/src/pyedb/workflows/utilities/__init__.py index e69de29bb2..919240eaef 100644 --- a/src/pyedb/workflows/utilities/__init__.py +++ b/src/pyedb/workflows/utilities/__init__.py @@ -0,0 +1,21 @@ +# Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. diff --git a/src/pyedb/workflows/utilities/cutout.py b/src/pyedb/workflows/utilities/cutout.py index 8bc7d3b350..333b6dfc72 100644 --- a/src/pyedb/workflows/utilities/cutout.py +++ b/src/pyedb/workflows/utilities/cutout.py @@ -1,4 +1,4 @@ -# Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # #