Skip to content

Commit

Permalink
Fix issue 3751 (#3820)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
SMoraisAnsys authored Oct 31, 2023
1 parent 2ffcfe0 commit 1b770ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions pyaedt/edb_core/edb_data/primitives_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 1b770ed

Please sign in to comment.