-
Notifications
You must be signed in to change notification settings - Fork 161
Add export_w_elements to Q2d #995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add a method to export all available variation W-elements from a 2D Extractor design.
BasisTest.my_teardown(self) | ||
|
||
def test_01_export_w_elements_from_sweep(self): | ||
test_project = self.local_scratch.copyfile(os.path.join(local_path, "example_models", "q2d_solved_sweep.aedtz")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure the best way to work with multiple projects in a single test class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've implemented a method to do it in setup_class after you initialize BasisTest you can add your project
`
self.aedtapp1 = BasisTest.add_app(self, project_name="q2d_solved_sweep", application=Q2d)
self.aedtapp2 = BasisTest.add_app(self, project_name="q2d_solved_nominal", application=Q2d)
`
this method will take care of copying the file and opening the project and storing the app data in the variable that can be used in 1 or multiple tests and, at the end of the test, closing them
Codecov Report
@@ Coverage Diff @@
## main #995 +/- ##
==========================================
+ Coverage 80.63% 80.71% +0.07%
==========================================
Files 130 131 +1
Lines 38492 38640 +148
==========================================
+ Hits 31038 31188 +150
+ Misses 7454 7452 -2 |
pyaedt/q3d.py
Outdated
else: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This else doesn't seem necessary.
pyaedt/q3d.py
Outdated
) | ||
exported_files.append(export_path) | ||
self.logger.info("Exported W-element: %s", export_path) | ||
except: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't look like we'll be able to hit this with unit testing.
except: | |
except: # pragma: no cover |
pyaedt/q3d.py
Outdated
) | ||
exported_files.append(export_path) | ||
self.logger.info("Exported W-element: %s", export_path) | ||
except: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
except: | |
except: # pragma: no cover |
pyaedt/q3d.py
Outdated
|
||
Parameters | ||
---------- | ||
analyze : bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
analyze : bool | |
analyze : bool, optional |
pyaedt/q3d.py
Outdated
|
||
for s in setups: | ||
sweeps = self.oanalysis.GetSweeps(s) | ||
if len(sweeps) == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if len(sweeps) == 0: | |
if not sweeps: |
@MaxJPRey @akaszynski I've incorporated your feedback and added a new test. Thank you! |
Incorporate feedback from review and add a test for when export_folder is not supplied.
81727b9
to
8f3f1f6
Compare
Add a method to export all available variation W-elements from a 2D
Extractor design.