From 1b770ed4ef26a2d60f05f357546ae4467fae3eb3 Mon Sep 17 00:00:00 2001 From: SMoraisAnsys <146729917+SMoraisAnsys@users.noreply.github.com> Date: Tue, 31 Oct 2023 11:35:52 +0100 Subject: [PATCH] Fix issue 3751 (#3820) * BUGFIX: reorder calls in EdbBondwire __init__.py Problem When a user tries to access bondwires data through edb.modeler.bondwires it triggers multiple primitives data cast. When casting a raw primitive into an `EdbBondwire` instance, an infinite loop to access "_edb_object" or "_app" was triggered. Solution In order to avoid those missing attributes, one can simply call `EDBPrimitives.__init__(...)` before calling the associated DotNet type __init__(...) (here BondwireDotNet.__init__()). Note I found that workaround by looking at why other cast worked. While debugging EdbPath, I saw that the missing attributes where setted up thorugh EDBPrimitives.__init__(self, raw_primitive, core_app). Closes #3751 * BUGFIX: reoder calls in EdbText __init__.py * CI: extend unit testing timetout --- .github/workflows/unit_tests.yml | 2 +- pyaedt/edb_core/edb_data/primitives_data.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 17f0b6580c6..8242a8d8749 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -133,7 +133,7 @@ jobs: with: max_attempts: 3 retry_on: error - timeout_minutes: 40 + timeout_minutes: 50 command: | testenv\Scripts\Activate.ps1 Set-Item -Path env:PYTHONMALLOC -Value "malloc" diff --git a/pyaedt/edb_core/edb_data/primitives_data.py b/pyaedt/edb_core/edb_data/primitives_data.py index 4b29f1c4dbc..a5170bdbc72 100644 --- a/pyaedt/edb_core/edb_data/primitives_data.py +++ b/pyaedt/edb_core/edb_data/primitives_data.py @@ -1053,14 +1053,14 @@ def in_polygon( class EdbText(EDBPrimitivesMain, TextDotNet): def __init__(self, raw_primitive, core_app): - TextDotNet.__init__(self, self._app, raw_primitive) EDBPrimitives.__init__(self, raw_primitive, core_app) + TextDotNet.__init__(self, self._app, raw_primitive) class EdbBondwire(EDBPrimitivesMain, BondwireDotNet): def __init__(self, raw_primitive, core_app): - BondwireDotNet.__init__(self, self._app, raw_primitive) EDBPrimitives.__init__(self, raw_primitive, core_app) + BondwireDotNet.__init__(self, core_app, raw_primitive) class EDBArcs(object):