FIX: Wait for active project after ImportEDB (#7560)#7561
Draft
Devin-Crawford wants to merge 5 commits intomainfrom
Draft
FIX: Wait for active project after ImportEDB (#7560)#7561Devin-Crawford wants to merge 5 commits intomainfrom
Devin-Crawford wants to merge 5 commits intomainfrom
Conversation
ImportEDB is an asynchronous AEDT operation. Calling active_project() immediately after ImportEDB returns None, which caused: AttributeError: 'NoneType' object has no attribute 'Save' Added a retry loop (up to 30 s, 0.5 s intervals) in the oproject setter after the ImportEDB call so the setter waits until AEDT finishes loading the project before attempting to call Save(). Also added unit tests in tests/unit/test_design_oproject.py that validate: - Retry succeeds on the Nth poll when project becomes available - RuntimeError is raised after the 30 s timeout - .aedb folder paths are resolved to edb.def before calling ImportEDB Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…7560) - Added `edb_import_timeout` (default 300 s) to the central `Settings` class so the EDB import wait time can be tuned per-project via the PyAEDT YAML settings file (general.edb_import_timeout) rather than being buried in source code. - Updated the `oproject` setter in `design.py` to read the timeout from `settings.edb_import_timeout` instead of a hardcoded literal. Also standardised the progress-log interval to 15 s and switched to f-string- free `logger.info` formatting for consistency. - Updated the unit tests to patch `settings` directly so each test uses an explicit timeout value and is not sensitive to the global default. - Added `test_edb_import_oproject_is_valid` system test (layout EDB suite) that opens the real `ANSYS-HSD_V1.aedb` fixture through the normal `Hfss3dLayout(project=<aedb_path>)` constructor path and asserts: * `_oproject` is not `None` after construction * `_oproject.Save()` does not raise * `project_name` is a non-empty string Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ImportEDB is an asynchronous AEDT operation. Calling active_project() immediately after ImportEDB returns None, which caused:
AttributeError: 'NoneType' object has no attribute 'Save'
Added a retry loop (up to 30 s, 0.5 s intervals) in the oproject setter after the ImportEDB call so the setter waits until AEDT finishes loading the project before attempting to call Save().
Also added unit tests in tests/unit/test_design_oproject.py that validate:
Issue linked
#7560