vmiklos / plees-tracker

Plees Tracker is a simple sleep tracker for your Android phone.
https://vmiklos.hu/plees-tracker/
MIT License
149 stars 38 forks source link

[FeatureRequest] Add option for median instead of mean #437

Open le-jun opened 4 months ago

le-jun commented 4 months ago

Would it be possible to add an option for median instead of mean? I'd rather know that I tend to sleep this much daily (or for each sleep including naps) than for it to be under influence of, say, sick days where I undersleep or oversleep. In a way, this is complementary to #388.

vmiklos commented 4 months ago

Sure, it would be reasonably straightforward to add this. Are you interested in trying to do this yourself?

le-jun commented 4 months ago

Ha, I can't code for my life so I'll pass on this. But I'll take notes about your way of doing it!

vmiklos commented 4 months ago

app/src/main/java/hu/vmiklos/plees_tracker/DataModel.kt:411 is where we currently produce a list of daily sums, and then count the average of this list. I believe that's where we can conditionally do a median instead.