jxx123 / simglucose

A Type-1 Diabetes simulator implemented in Python for Reinforcement Learning purpose
MIT License
232 stars 109 forks source link

Fix Risk Index calculation and add data sanitization #62

Closed yihuicai closed 11 months ago

yihuicai commented 1 year ago
  1. The length of chunk_BG should be 20 to calculate ri_per_hour, since the gap between two records is 3 mins.
  2. The last element of chunk_BG may not be full. This will affect the accuracy of the ri_mean.
  3. np.mean() is no longer compatible (see #61 ) Use similar caculation in risk.py
yihuicai commented 11 months ago

@yihuicai Would you mind adding a test for report.py? I know the code in report.py is really crappy, so it would be nice to have a test for it. Thank you for fixing the compatibility issue BTW! Really appreciate it.

Sure, just added a test for risk index report.

yihuicai commented 11 months ago

Seems the workflow didn't pass the test I wrote but did pass locally for me. I changed the accuracy of float number results. Let's see if it works.