Skip to content

Commit 2a98db6

Browse files
author
Sigrid Tofte Thiis
committed
making bgi out of prediction causes less drift
1 parent 5171d39 commit 2a98db6

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

loop_to_python_adaptive/autotune_prep.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ def prepare_for_autotune_isf(
292292
*,
293293
loop_algorithm_input: dict,
294294
cfg: AutotunePrepConfig = AutotunePrepConfig(),
295+
json_history: list[dict] | None = None,
295296
) -> dict[str, Any]:
296297
"""
297298
Main entry point.
@@ -316,6 +317,7 @@ def prepare_for_autotune_isf(
316317
include_cob=False,
317318
iob_col=cfg.iob_col,
318319
cob_col=cfg.cob_col,
320+
json_history=json_history,
319321
)
320322

321323

loop_to_python_adaptive/loop_oref_mapping.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ def prepare_isf_glucose_data(
515515
include_cob: bool = False, # <-- (COB not needed by categorizer, but useful for debugging)
516516
iob_col: str = "IOB",
517517
cob_col: str = "COB",
518+
json_history: list[dict] | None = None,
518519
) -> tuple[pd.DataFrame, list[dict]]:
519520
"""
520521
Add BGI/avgDelta/deviation to df and prepare points for autotune_prep.
@@ -527,7 +528,7 @@ def prepare_isf_glucose_data(
527528
5. COB — optional, for debugging only
528529
529530
"""
530-
df2 = add_bgi_to_history_df(df, isf, bgi_col=bgi_col, align="ffill",loop_algorithm_input=loop_algorithm_input,)
531+
df2 = add_bgi_to_history_df(df, isf, bgi_col=bgi_col, align="ffill",loop_algorithm_input=loop_algorithm_input,json_history=json_history,)
531532
df2 = add_avg_delta_to_history_df(df2, cgm_col=cgm_col, avg_delta_col="avgDelta", window_points=4)
532533
df2 = add_deviation_to_history_df(df2, avg_delta_col="avgDelta", bgi_col=bgi_col, deviation_col="deviation")
533534

0 commit comments

Comments
 (0)