<jupyter_start><jupyter_text>How Loop Dosing Decision Works Instructions*   If you see a figure below, then you don't need to run any code.    *   Press play or adjust the slider at the bottom of the figure to see the animation* If you don't see a figure, then you will just need to select **Run all**, which is under the **Runtime** Menu above.<jupyter_code># %% REQUIRED LIBRARIES
!pip install pyloopkit-test==0.0.15
!git clone -b etn/examples-for-bolus-rec-doc https://github.com/tidepool-org/data-science--explore--how-loop-dosing-decisions-work.git 
%cd data-science--explore--how-loop-dosing-decisions-work/
from src.how_loop_dosing_works import make_animation
import os
import pandas as pd
filename = "dosing-threshold-example-1"
scenario = pd.read_csv(os.path.join("data", filename + ".csv"), index_col=[0])
print("scenario successfully loaded")
# %% VIEW DOSING DECISION ANIMATION
scenario_fig = make_animation(scenario)
scenario_fig.show(renderer='colab')
# %% OPTIONAL VIEW SCENARIO TABLE (IF YOU ARE INTERESTED)
print(scenario)<jupyter_output>settings  ...            136
setting_name                                                          ...               
model                                                    [360.0, 75]  ...            NaN
momentum_data_interval                                            15  ...            NaN
suspend_threshold                                                 70  ...            NaN
dynamic_carb_absorption_enabled                                 TRUE  ...            NaN
retrospective_correction_integration_interval                     30  ...            NaN
recency_interval                                                  15  ...            NaN
retrospective_correction_grouping_interval                        30  ...            NaN
rate_rounder                                                    0.05  ...            NaN
insulin_delay                                                     10  ...            NaN
carb_delay           [...]
{'fraction_non_alphanumeric': 0.081, 'fraction_numerical': 0.015, 'mean_word_length': 1.4343065693430657, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 21, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '130610', 'license': 'BSD-2-Clause', 'n_tokens_mistral': 530, 'n_tokens_neox': 474, 'n_words': 137, 'path': 'notebooks/how_loop_dosing_decisions_work_etn_2020_05_11_v_0_1_0.ipynb', 'repo_name': 'tidepool-org/data-science--explore--how-loop-dosing-decisions-work', 'size': '2000'}