-
Notifications
You must be signed in to change notification settings - Fork 134
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
REFACTOR: General improvements #5695
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 |
7c369d2
to
bc6ea47
Compare
For more information, see https://pre-commit.ci
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.
LGTM. Now we "only" need to do it for the other core modules
Codecov ReportAttention: Patch coverage is
❌ Your patch check has failed because the patch coverage (7.26%) is below the target coverage (85.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #5695 +/- ##
===========================================
- Coverage 85.17% 43.71% -41.46%
===========================================
Files 155 155
Lines 60819 60791 -28
===========================================
- Hits 51800 26576 -25224
- Misses 9019 34215 +25196 |
@Samuelopez-ansys @SMoraisAnsys I like the idea of raising exception instead of returning False. It's correct and it's not breaking customer code. |
I can only agree. Great work. |
Description
General changes in the code base. The ones associated to:
AEDTRuntimeError
instead of theassert ..., ....
pattern is not up for discussion;assign_thermal_map
method signature instead ofassignment
.But the other modifications are up for discussion and could be generalized to other modules:
SOLUTIONS.Maxwell3d.SOMETHING
instead of"SOMETHING"
;AEDTRuntimeError
) instead of logging an error and returning False.Note the I would like to open a discussion about
assign_matrix
whose current behavior is strange: multiplesolution_type
cases are handled inside of the implementation BUT if thesolution_type
is not in(SOLUTIONS.Maxwell3d.Transient, SOLUTIONS.Maxwell3d.ElectricTransient)
then the method was logging an error and returning False.@Samuelopez-ansys @maxcapodi78 @gmalinve What do you think about the transition of "logging and error and returning False" to "raising an exception" ? We already had a discussion on that point and the fact that methods are decorated with the pyaedt_handler decorator still ends up with a False value being returned when an error is raised. The additional value of the proposed approach is that it would allow:
Issue linked
Associated to #5504
Checklist