@@ -535,15 +535,18 @@ def run(self, data, bw):
535535 vo2 = vo2 , data = data , rbg = self )
536536
537537 # Save results
538+ results = dict ()
538539 if self .environment .save_workspace :
539540 if self .environment .verbose :
540541 print ('Saving results in ' + os .path .join (self .environment .replay_bg_path , 'results' , 'workspaces' , self .environment .modality + '_' + self .environment .save_name + self .environment .save_suffix + '.pkl' ))
541- self .__save_results (data , bw , glucose , cgm , insulin_bolus , correction_bolus , insulin_basal , cho , hypotreatments ,
542+ results = self .__save_results (data , bw , glucose , cgm , insulin_bolus , correction_bolus , insulin_basal , cho , hypotreatments ,
542543 meal_announcement , vo2 , analysis )
543544
544545 if self .environment .verbose :
545546 print ('Done. Bye!' )
546547
548+ return results
549+
547550 def __analyze_results (self , glucose , cgm , insulin_bolus , correction_bolus , insulin_basal , cho , hypotreatments , meal_announcement , vo2 , data ):
548551 """
549552 Analyzes ReplayBG results.
@@ -711,3 +714,5 @@ def __save_results(self, data, BW, glucose, cgm, insulin_bolus, correction_bolus
711714 self .environment .modality + '_' + self .environment .save_name + self .environment .save_suffix + '.pkl' ),
712715 'wb' ) as file :
713716 pickle .dump (results , file )
717+
718+ return results
0 commit comments