-
Notifications
You must be signed in to change notification settings - Fork 133
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
FEAT: Add distributed filters topology #5608
base: main
Are you sure you want to change the base?
Conversation
Thanks for opening a Pull Request. If you want to perform a review write a comment saying: @ansys-reviewer-bot review |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5608 +/- ##
=======================================
Coverage 85.26% 85.26%
=======================================
Files 152 152
Lines 61016 61016
=======================================
+ Hits 52025 52028 +3
+ Misses 8991 8988 -3 |
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.
The new method for creating a design is nice and clean! The tests look really thorough with testing for error messages.
Please see review comments and let me know if you have questions or it would help to go through some of it together.
|
||
Examples | ||
-------- | ||
Create a ``FilterSolutions`` instance with a band-pass elliptic ideal filter. | ||
|
||
>>> import ansys.aedt.core | ||
>>> from ansys.aedt.core.filtersolutions_core.attributes import FilterImplementation | ||
>>> import ansys.aedt.core.filtersolutions | ||
>>> from ansys.aedt.core.filtersolutions_core.dll_interface import DllInterface |
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.
Is it expected that the API user will use DllInterface to get the version? I thought that DllInterface was more for internal functionality and not something the user would need to worry about.
>>> design = ansys.aedt.core.FilterSolutions(version="2025 R1", projectname= "fs1", | ||
>>> implementation_type= FilterImplementation.LUMPED, | ||
>>> ) | ||
>>> design = ansys.aedt.core.FilterSolutions.LumpDesign(version= desktop_version) |
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 FilterSolutions is the base class for the design types and is not intended to be used directly, we probably don't need a usage example. Also, the name is misleading then too. If named FilterSolutions, it implies this is the main class for using the Filter Solutions API (as HFSS class is for HFSS API). However, it's the child classes (LumpedDesign, DistributedDesign) that the user will want. So, I think it probably makes sense to rename this class to FilterSolutionsDesignBase or something along those lines and make it clear in the class documentation that this is a parent class that shouldn't be instantiated directly and the child design classes are what should be used to create a design.
|
||
See Also | ||
-------- | ||
:doc:`filtersolutions` |
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'm not sure what this refers to - this file? Or is there another filtersolutions
somewhere?
else: | ||
raise RuntimeError("The " + str(implementation_type) + " is not supported in this release.") | ||
|
||
class LumpDesign(FilterSolutions): |
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.
Should this be LumpDesign or LumpedDesign? I think we are referring to a 'Lumped Filter', not a 'Lump Filter'.
self.attributes = Attributes() | ||
self.ideal_response = IdealResponse() | ||
self.graph_setup = GraphSetup() | ||
self.source_impedance_table = LumpedTerminationImpedance(TerminationType.SOURCE) |
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.
Can things like source_impedance_table that are shared by all design types go into the base class init?
@@ -37,57 +37,65 @@ | |||
class TestClass: | |||
|
|||
def test_lumped_capacitor_q(self): | |||
lumpdesign = ansys.aedt.core.FilterSolutions(implementation_type=FilterImplementation.LUMPED) | |||
lumpdesign = ansys.aedt.core.filtersolutions.LumpDesign(config["desktopVersion"]) |
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.
Use fixture.
@@ -36,19 +36,22 @@ | |||
@pytest.mark.skipif(config["desktopVersion"] < "2025.1", reason="Skipped on versions earlier than 2025.1") | |||
class TestClass: | |||
def test_row_count(self): | |||
lumpdesign = ansys.aedt.core.FilterSolutions(implementation_type=FilterImplementation.LUMPED) | |||
lumpdesign = ansys.aedt.core.filtersolutions.LumpDesign(config["desktopVersion"]) |
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.
Use fixture.
@@ -35,7 +35,8 @@ | |||
@pytest.mark.skipif(config["desktopVersion"] < "2025.1", reason="Skipped on versions earlier than 2025.1") | |||
class TestClass: | |||
def test_raise_error(self): | |||
design = ansys.aedt.core.FilterSolutions(implementation_type=FilterImplementation.LUMPED) | |||
design = ansys.aedt.core.filtersolutions.LumpDesign(config["desktopVersion"]) |
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 fixtures are in common file, re-use it here.
@@ -49,15 +49,17 @@ | |||
@pytest.mark.skipif(config["desktopVersion"] < "2025.2", reason="Skipped on versions earlier than 2025.2") | |||
class TestClass: | |||
def test_modelithics_inductor_list_count(self): | |||
lumpdesign = ansys.aedt.core.FilterSolutions(implementation_type=FilterImplementation.LUMPED) | |||
lumpdesign = ansys.aedt.core.filtersolutions.LumpDesign(config["desktopVersion"]) |
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.
Use fixture.
@@ -39,50 +39,59 @@ | |||
@pytest.mark.skipif(config["desktopVersion"] < "2025.1", reason="Skipped on versions earlier than 2025.1") | |||
class TestClass: | |||
def test_lumped_generator_resistor_30(self): | |||
lumpdesign = ansys.aedt.core.FilterSolutions(implementation_type=FilterImplementation.LUMPED) | |||
lumpdesign = ansys.aedt.core.filtersolutions.LumpDesign(config["desktopVersion"]) |
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.
Use fixture.
…sys/pyaedt into FEAT__Add_distributed_filters # Conflicts: # src/ansys/aedt/core/filtersolutions.py
Description
This feature adds attributes of the topology page of the distributed filters
Issue linked
Please mention the issue number or describe the problem this pull request addresses.
Checklist