-
Notifications
You must be signed in to change notification settings - Fork 164
Fix bounding box extent #1314
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
Fix bounding box extent #1314
Conversation
The configure_hfss_extents method will never set its radiation_box property because the setter checks that its argument is of type RadiationBoxType which is just an enumeration-style class for several constant integer values. The setter should instead check that the argument is an integer (and perhaps one of the allowable values).
Introduce a new method to validate "enum class" values from classes like pyaedt.generic.constants.RadiationBoxType and use it in the setter of SimulationConfiguration.radiation_box to fix #1313.
Codecov Report
@@ Coverage Diff @@
## main #1314 +/- ##
==========================================
+ Coverage 77.87% 79.20% +1.33%
==========================================
Files 97 97
Lines 39443 39824 +381
==========================================
+ Hits 30716 31543 +827
+ Misses 8727 8281 -446 |
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.
@isaacansys I like this approach. Since the number of enum in edb is quite high I would probably create a separate module in edb_core folder and have a method also to retrieve the enum value given an int and an edb class. that would be replaced in all the methods that requires it as input
Thanks all for suggestions, have a busy calendar today but will get these incorporated by tomorrow and ready to merge. |
@isaacansys if you finalize all agreed changes we can close this PR |
Co-authored-by: Kathy Pippert <[email protected]> Co-authored-by: Maxime Rey <[email protected]>
Replace existing usage of BasisOrder.single with BasisOrder.Single per the earlier correction to that value's identifier.
A comment and a question up front:
The setters for some SimulationConfiguration properties, including cutout_subdesign_type, radiation_box, sweep_type, and basis_order would never set their property's value because they were checking that the arguments were of a type that would not be passed in. The arguments passed in are integers taken from attributes on the class. I call these "enumeration style" classes.
To fix this, add a new method validate_enum_class_value that takes an enumeration style class "cls" that has valid values from zero to N where the value N is assigned to the class attribute called Invalid and an integer value "value" to validate. The function returns true if "value" is between zero (inclusive) and cls.Invalid (exclusive). Note that the enumeration class must define this Invalid attribute and its value is not itself valid.
I added a test for setting the boundary box extent type which is the case that was reported to me as not working.
Fixes #1313