-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
TST: increase test coverage #756
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #756 +/- ##
===========================================
+ Coverage 76.42% 80.32% +3.90%
===========================================
Files 95 95
Lines 11090 10968 -122
===========================================
+ Hits 8475 8810 +335
+ Misses 2615 2158 -457 ☔ View full report in Codecov by Sentry. |
@Gui-FernandesBR if you do not mind, I can take a closer look at |
Yes please, I'd like some help on that |
100% coverage for both |
da7c35d
to
6863d6e
Compare
(0, 20, 200, 2, 1, True, True), | ||
], | ||
) | ||
def test_short_time_fft( |
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.
@Lucas-Prates could yo review this test please? test_short_time_fft
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.
Looks okay to me! If you want to include a "numeric assertion" test, since you are using pure signal (i.e. sine function), all the result functions should be a Dirac delta function, i.e. a pulse function, at the given frequency, 5 Hz in this case. Something like this
So, if you want to, you could include an extra argument true_frequency
, and then
signal = np.sin(2 * np.pi * true_frequency * t)
.
.
.
for f in stft_results:
assert pytest.approx(1, 0.01) == f[true_frequency - 1][1]
Ok, I think this PR is already in a good point. @RocketPy-Team/code-owners ready for review! Pleas notice that the code coverage has increased 4 pp, but I didn't spend much time trying to find the best validation possible for each function method. I opted to be simple. |
Once again I am sharing the top 10 worst files in terms of coverage. |
MNT: linters TST: complementing tests for sensitivity analysis and removing duplicate piece of code. DEV: add pragma comments to exclude specific lines from coverage MNT: fix pylint error
88e6025
to
9bd4383
Compare
Pull request type
Checklist
black rocketpy/ tests/
) has passed locallypytest tests -m slow --runslow
) have passed locallyCHANGELOG.md
has been updated (if relevant)Current behavior
New behavior
Breaking change
Additional information