def _get_other_bg(bg_df, pred_array, pred_time_array, curr, miss, start_index, data_index, bg_str):
pred_time_array[curr] = (bg_df.iloc[data_index]['created_at'] - bg_df.iloc[start_index]['created_at']) / np.timedelta64(1, 'm')
try:
pred_array[curr] = bg_df.iloc[data_index]['openaps']['enacted'][bg_str]
curr, miss = _check_pred_nan(pred_array, curr, miss)
except:
try:
pred_array[curr] = bg_df.iloc[data_index]['openaps']['suggested'][bg_str]
curr, miss = _check_pred_nan(pred_array, curr, miss)
except:
miss += 1
return pred_array, pred_time_array, curr, miss
#Function to get the predicted bg for the IOB, COB, and aCOB predictions
#Looks at enacted directory first before looking at suggested directory.
#If there is no data, then it increases the miss count by 1.
评论列表
文章目录