Display-Lab / precision-feedback-pipeline

Apache License 2.0
1 stars 0 forks source link

[Bug] Multi-measure failure #70

Closed mackgalante closed 10 months ago

mackgalante commented 1 year ago

Input: (all_cptest.json)

"Performance_data":[
      ["staff_number","measure","month","passed_count","flagged_count","denominator","peer_average_comparator","peer_75th_percentile_benchmark","peer_90th_percentile_benchmark","MPOG_goal"],
      [7,"GLU03","2023-09-01",90,10,100,1,1,1,95],
      [7,"GLU03","2023-10-01",90,10,100,1,1,1,95],
      [7,"GLU03","2023-11-01",92,8,100,1,1,1,95],
      [7,"GLU03","2023-12-01",94,6,100,1,1,1,95],

      [7,"TOC01","2023-09-01",89,11,100,1,1,1,90],
      [7,"TOC01","2023-10-01",89,11,100,1,1,1,90],
      [7,"TOC01","2023-11-01",89,11,100,1,1,1,90],
      [7,"TOC01","2023-12-01",91,9,100,1,1,1,90],

      [7,"SUS04","2023-09-01",15,85,100,100,100,100,11],
      [7,"SUS04","2023-10-01",15,85,100,100,100,100,11],
      [7,"SUS04","2023-11-01",15,85,100,100,100,100,11],
      [7,"SUS04","2023-12-01",10,90,100,100,100,100,11],

      [7,"BP03","2023-09-01",2,98,100,99,99,99,99],
      [7,"BP03","2023-10-01",3,97,100,99,99,99,99],
      [7,"BP03","2023-11-01",4,96,100,99,99,99,99],
      [7,"BP03","2023-12-01",5,95,100,99,99,99,99],

      [7,"TOC02","2023-09-01",1,99,100,5,100,100,100],
      [7,"TOC02","2023-10-01",1,99,100,5,100,100,100],
      [7,"TOC02","2023-11-01",2,98,100,5,100,100,100],
      [7,"TOC02","2023-12-01",4,96,100,5,100,100,100],

      [7,"SUS04","2023-09-01",98,2,100,1,1,96,1],
      [7,"SUS04","2023-10-01",98,2,100,1,1,96,1],
      [7,"SUS04","2023-11-01",98,2,100,1,1,96,1],
      [7,"SUS04","2023-12-01",98,2,100,1,1,96,1],

      [7,"PUL01","2023-09-01",45,55,100,50,99,99,99],
      [7,"PUL01","2023-10-01",45,55,100,50,99,99,99],
      [7,"PUL01","2023-11-01",45,55,100,50,99,99,99],
      [7,"PUL01","2023-12-01",52,48,100,50,99,99,99],

      [7,"PONV05","2023-09-01",6,94,100,5,100,100,100],
      [7,"PONV05","2023-10-01",6,94,100,5,100,100,100],
      [7,"PONV05","2023-11-01",6,94,100,5,100,100,100],
      [7,"PONV05","2023-12-01",4,96,100,5,100,100,100],

      [7,"GLU01","2023-09-01",45,55,100,45,45,50,1],
      [7,"GLU01","2023-10-01",45,55,100,45,45,50,1],
      [7,"GLU01","2023-11-01",45,55,100,45,45,50,1],
      [7,"GLU01","2023-12-01",45,55,100,45,45,50,1],

      [7,"SUS04","2023-09-01",88,12,100,1,1,1,1],
      [7,"SUS04","2023-10-01",88,12,100,1,1,1,1],
      [7,"SUS04","2023-11-01",86,14,100,1,1,1,1],
      [7,"SUS04","2023-12-01",80,20,100,1,1,1,1]
    ],
  "History":{

Output:

PS C:\Users\galan\.snakepit\Leakdown-Tester> & C:/Users/galan/AppData/Local/Programs/Python/Python310/python.exe c:/Users/galan/.snakepit/Leakdown-Tester/LDT.py --CP all --respond --tests 3          

                Welcome to the Leakdown Tester, Version 2.0.0!
 Reading one JSON file from 'Causal Pathway Test Suite'...
 Sending 3 total POST requests...
 Sending POST request(s) to API at 'http://127.0.0.1:8000/createprecisionfeedback/'...

 Testing input_message file for causal pathway 'ALL'
 Bad response from target API:
                        Status Code:    500
Headers: {'date': 'Tue, 05 Sep 2023 19:15:26 GMT', 'server': 'uvicorn', 'content-length': '21', 'content-type': 'text/plain; charset=utf-8'}
'Internal Server Error'
 Testing input_message file for causal pathway 'ALL'
 Bad response from target API:
                        Status Code:    500
Headers: {'date': 'Tue, 05 Sep 2023 19:15:26 GMT', 'server': 'uvicorn', 'content-length': '21', 'content-type': 'text/plain; charset=utf-8'}
'Internal Server Error'
 Testing input_message file for causal pathway 'ALL'
 Bad response from target API:
                        Status Code:    500
Headers: {'date': 'Tue, 05 Sep 2023 19:15:26 GMT', 'server': 'uvicorn', 'content-length': '21', 'content-type': 'text/plain; charset=utf-8'}
'Internal Server Error'

                Leakdown test complete.

PS C:\Users\galan\.snakepit\Leakdown-Tester> 
mackgalante commented 1 year ago

Local server console output:

File "C:\Users\galan\.snakepit\precision-feedback-pipeline\.\main_windows.py", line 132, in createprecisionfeedback
    BS=bs.annotate()
  File "C:\Users\galan\.snakepit\precision-feedback-pipeline\.\bit_stomach\bit_stomach.py", line 159, in annotate
    a=pr.goal_trend_annotate(measure_name,**self.goal1_dicts)
  File "C:\Users\galan\.snakepit\precision-feedback-pipeline\.\bit_stomach\prepare_data_annotate.py", line 115, in goal_trend_annotate
    a = trend_annotate(self.a,self.s13,measure_data2,comparator_bnode)
  File "C:\Users\galan\.snakepit\precision-feedback-pipeline\.\bit_stomach\trend_annotate.py", line 58, in trend_annotate
    number=find_number(back_up_df,trend_sign1)
  File "C:\Users\galan\.snakepit\precision-feedback-pipeline\.\bit_stomach\trend_annotate.py", line 141, in find_number
    if lista[z]>=lista[y]:
IndexError: list index out of range
zachll commented 11 months ago

The input contains repeated measures for the same time period, which is unexpected and should result in an error message. If the repeated measures are removed, is this issue resolved?