Skip to content

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

Merged
2 commits merged into from
Mar 28, 2022
Merged

Add export_w_elements to Q2d #995

2 commits merged into from
Mar 28, 2022

Conversation

ghost
Copy link

@ghost ghost commented Mar 24, 2022

Add a method to export all available variation W-elements from a 2D
Extractor design.

Add a method to export all available variation W-elements from a 2D
Extractor design.
@ghost ghost requested a review from maxcapodi78 March 24, 2022 19:30
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"))
Copy link
Author

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.

Copy link
Collaborator

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
Copy link

codecov bot commented Mar 24, 2022

Codecov Report

Merging #995 (8f3f1f6) into main (5418ae4) will increase coverage by 0.07%.
The diff coverage is 96.51%.

@@            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
Comment on lines 1051 to 1052
else:
pass
Copy link
Contributor

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:
Copy link
Contributor

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.

Suggested change
except:
except: # pragma: no cover

pyaedt/q3d.py Outdated
)
exported_files.append(export_path)
self.logger.info("Exported W-element: %s", export_path)
except:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Suggested change
except:
except: # pragma: no cover

pyaedt/q3d.py Outdated

Parameters
----------
analyze : bool
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
analyze : bool
analyze : bool, optional

pyaedt/q3d.py Outdated

for s in setups:
sweeps = self.oanalysis.GetSweeps(s)
if len(sweeps) == 0:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if len(sweeps) == 0:
if not sweeps:

@ghost
Copy link
Author

ghost commented Mar 25, 2022

@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.
@ghost ghost force-pushed the q2d_export_w_element branch from 81727b9 to 8f3f1f6 Compare March 28, 2022 13:18
@ghost ghost merged commit 274766d into main Mar 28, 2022
@ghost ghost deleted the q2d_export_w_element branch March 28, 2022 13:52
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants