-
-
Notifications
You must be signed in to change notification settings - Fork 170
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
Add testing cases for new motor classes: LiquidMotor and HybridMotor #400
Conversation
Co-authored-by: MateusStano <69485049+MateusStano@users.noreply.github.com>
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.
Good job here, we were really missing these tests since our last release. I'm approving your code, however, I'd like to invite you to think about some points:
-
You are testing the construction of Hybrid and Liquid classes. But you're not testing the Flight class behavior when using these motors. Should we add a test where the rocket flies with a non-solid motor?
-
In the
test_hybrid_motor_info
method (same for liquid) you tested theall_info()
. Mty suggestion is to also test theinfo()
method, in the ame test. This way we would gain a few lines in our code coverage -
Speaking of code coverage, I've ran a report here, and the overall coverage of motors files was higher than 90%. Amazing job here!
-
I imagine you would agree if i say that the
test_tank.py
file is the hardest one to understand (and therefore to maintain) of all the test files. I loved how you created the auxiliary functions by the end of the file, however, I still think the code structure is a bit far from the other files. For example, thetest_tank_bounds
method is testing the same thing for 3 different types of tanks. Did you consider parametrizing (@parametrize decorator) this kind of test so we could easily know what is the tank raising error in case of bug?
All in all the code is great and it does solve the problem, it deserves to be approved and merge. I will be happy if you find my comments helpful somehow.
Thanks,
Guilherme
Thank you for your review. Regarding your questions/suggestions:
|
Very well done!! The implementations made the functions way more readable now, this was a significant improvement. In the future, having different ways to validade these classes will be important, especially through experimental data comparison. |
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.
Good improvements, @phmbressan , well done!
Tests are passing, I don't think there's much more to do in this PR.
Please feel free to merge whenever you want ;)
Pull request type
Please check the type of change your PR introduces:
Pull request checklist
Please check if your PR fulfills the following requirements, depending on the type of PR:
Code base maintenance (refactoring, formatting, renaming):
black rocketpy
) has passed locally and any fixes were madepytest --runslow
) have passed locallyWhat is the current behavior?
The code was lacking proper testing for
LiquidMotor
andHybridMotor
classes.What is the new behavior?
All the implemented tests are passing and they are checks for basic properties of
Tank
,LiquidMotor
andHybridMotor
classes, such as masses, volumes, center of masses and inertias.Does this introduce a breaking change?