-
Notifications
You must be signed in to change notification settings - Fork 114
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
🧹 📊 Metrics cleanup #1111
🧹 📊 Metrics cleanup #1111
Conversation
from review, adding the calculations in comments with the tests helps to make the arithmetic more credible e-mission#1098 (review)
adding specific numbers from fakeLabels.json for the footprints, but keeping the testing at just the keys for mets due to complexity the keys in the fallback are different, so we can be sure here that the custom mets were accessed
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1111 +/- ##
==========================================
+ Coverage 77.55% 78.45% +0.90%
==========================================
Files 28 28
Lines 1702 1699 -3
Branches 367 364 -3
==========================================
+ Hits 1320 1333 +13
+ Misses 382 366 -16
Flags with carried forward coverage won't be shown. Click here to find out more.
|
checking the 'ON_FOOT' case verifying negative speed returns 0, even if there is a fallback
I made a discovery working through upping the codecov report - in both For Also, is there anywhere we still use |
This is actually even more complicated when it comes to the What do we want to do there? My first instinct would be to cache some sort of calculation of all the modes with |
added explicit throw of error and test to detect the thrown error, calculations now in try/catch block to account for errors also now allowing "ON FOOT" to go to default pending decision about "IN VEHICLE" for final coverage gap
also renamed the clearing function to ensure it was clear it was only for testing
Something else I've found while looking into the code coverage: the range - limits for modes |
test was failing because error was not thrown, it was handled, throwing error, which will be caught by the code that displays the metrics
After we talked about it in our meeting today, I'm going to go ahead and take this out, since we now have custom modes, really, either it's in the list or it is not, so we can't do this type of fallback anymore (at least not right now) it could be something to think about as we overhaul the metrics in upcoming months
This was old code, and no longer used elected to take it out rather than test it, this concept is something we should keep in mind if we integrate suggestions back into the app (ie I can't e-bike from CO to GA, no matter how much emissions it would save)
this label has no co2 or met information, which hits some of the edge cases in the custom metrics code
After discussion in our UI meeting today, I've gone ahead and removed the old code, which increased the code coverage, as that was most of what was not getting tested. I've tested in the emulator, and the dashboard is working well! |
After resolving merge conflicts and one issue the merge created this cleanup PR is ready again! |
The android raw values include
Yes, take it out. We used to use it to compute the "optimal" footprint, but that is not relevant any more and will likely have to be redesigned when we work with recommendations. |
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.
Almost there
Addressing code review from #1098 and codecov results from the same PR