nightscout / Trio

MIT License
46 stars 129 forks source link

Amend TDD calculation to respect 24 hours and 14 days #220

Closed avouspierre closed 1 month ago

avouspierre commented 1 month ago

Modify weighted_average to respect the 24 hours of data and 14 days of total TDD.

MikePlante1 commented 1 month ago

From my understanding, it looks like this PR does two things:

  1. Changes the long term TDD average from a 10-day TDD average into a 14-day TDD average

I'm not saying this is a bad idea, I just don't know the reasoning behind it. Looks like iAPS has been using 10-days for over a year now.

  1. Change the short term TDD average from the last two hours to the last 24 hours.

Currently, Trio populates an array with the TDD value collected every loop cycle from the past two hours and then averages them together. Each of these values is the total insulin dosed in the past 24 hours. This means it includes up to 24 values with insulin data from the past 26 hours

This PR, however, would increase the size of this array to include the TDD value from every loop from the past 24 hours instead, which would include *up to 288 values with insulin data from the past 48 hours.

dnzxy commented 1 month ago

I‘m genuinely confused. This was brought up as a topic of discussion and is now PR‘d with any further conversation about it or its side effects.

avouspierre commented 1 month ago

@dnzxy Sorry if the PR is too quickly. I noted the PR interested more than discussion in GitHub ;-)

@MikePlante1 :

I close the PR and update the discussion.

dnzxy commented 1 month ago

Oh, please don’t close, let’s just make it a draft for now. You did the work already, let’s not waste it 😊 Is that okay with you? I‘ll re-open and change to draft, if so 🤔

JohnKitching commented 1 month ago

I could be wrong but I think I recall Tim Street commenting somewhere that in AAPS they found two hours unsafe.

avouspierre commented 1 month ago

Oh, please don’t close, let’s just make it a draft for now. You did the work already, let’s not waste it 😊 Is that okay with you? I‘ll re-open and change to draft, if so 🤔

Don't worry. it is more the argument of Mike than your remark 😂