Skip to content

01 Top Level Functions

Marion Barker edited this page Jun 14, 2024 · 2 revisions

For tidy storage of report files, it is assumed that the LoopReport.md will be placed in a LoopReportFiles folder under a sub-folder with the individual's name. This allows for easy reference for the source of the report.

The code that identifies where the LoopReport.md files are saved is defined in fileio.getAnalysisIO. For anyone pulling this repo to their machine, this should be the only function that requires editing prior to running the top-level functions.

main.py

Process the LoopReport.md file with output modified by flags

Required input: (thisPath, thisFile, outFile, vFlag)

  • thisPath: absolute or relative path to LoopReportFiles folder
  • thisFile: filename including the subfolder name, e.g., 'Marion/Loop Report 2020-07-01 05_28_33-07_00.md'
  • outFile: depending on vFlag setting, this is the name or folder for output file generated by main.py
  • vFlag: used primarily to drive what if any output files are requested
    • 0: output analysis to terminal window
    • 1: deprecated
    • 2: like 0, + printPodInitFrame if exceeds nominal steps
    • 3: output podInitCmdCount to outFlag, skip balance and return
    • 4: like 2, + verboseOutput (init, podState, full df) to csv
    • 5: same as 4 plus add extra for Dash

whatIsLastReport.py

Automatically find most recent file in Loop Report Files directory and FreeAPS X report directory and report filenames

For example:

*** Last Loop Report: Marion/Loop Report 2024-06-04 10:27:45-07:00.md

*** Last FreeAPS X Report: Marion_Simulator_Trio/log_prev 4 copy.txt

runLastDashReport.py

Automatically find most recent Loop Report file and pass it on to main

  • Used to add Dash Statistics to the one-line summary csv file (vFlag = 5)

runLastLoopReport.py

Automatically find most recent Loop Report file and pass it on to main

  • Used when most pods were Eros, different items were sent to the one-line summary csv file (vFlag = 4)

runLastFAPSXlog.py

Automatically find most recent file in the FreeAPS X input folder from what is now iAPS or Trio and pass it on to main

  • Because these files, log.txt are today since midnight and log_prev.txt is the 24 hours from yesterday, local time, the full pod history is not found in a single file, unless there is a fault
  • The log_prev.txt files are automatically renamed to have a date prefix so that multiple log_prev.txt files can reside in a given person's folder

test.py

Execute main using test files found in test folder.

  • Runs with no modifications required to fileio.getAnalysisIO.
Clone this wiki locally