oldpred.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:OpenAPS 作者: medicinexlab 项目源码 文件源码
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.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号