Maximofn commited on
Commit
6359252
·
1 Parent(s): 0f4e197

feat(SRC): :rocket: When there aren't hotorical data return all 0

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -74,8 +74,18 @@ def calcular_macros(esfuerzo_dieta, objetivo, cumplimiento_entrenamiento,
74
  print(f"Macros:\n{macros_differences_list}")
75
 
76
  # Calculate macros min, max and mean
77
- (train_day_protein_std, train_day_carbs_std, train_day_fat_std, intratrain_protein_std, intratrain_carbs_std,
78
- rest_day_protein_std, rest_day_carbs_std, rest_day_fat_std) = get_min_max_mean_mode_macros_differences(macros_differences_list)
 
 
 
 
 
 
 
 
 
 
79
 
80
  # Print macros min, max and mean
81
  print(f"Macros min, max and mean:\n{train_day_protein_std}, {train_day_carbs_std}, {train_day_fat_std}, {intratrain_protein_std}, {intratrain_carbs_std}, {rest_day_protein_std}, {rest_day_carbs_std}, {rest_day_fat_std}")
 
74
  print(f"Macros:\n{macros_differences_list}")
75
 
76
  # Calculate macros min, max and mean
77
+ if len(macros_differences_list) > 0:
78
+ (train_day_protein_std, train_day_carbs_std, train_day_fat_std, intratrain_protein_std, intratrain_carbs_std,
79
+ rest_day_protein_std, rest_day_carbs_std, rest_day_fat_std) = get_min_max_mean_mode_macros_differences(macros_differences_list)
80
+ else:
81
+ train_day_protein_std = [0, 0, 0, 0]
82
+ train_day_carbs_std = [0, 0, 0, 0]
83
+ train_day_fat_std = [0, 0, 0, 0]
84
+ intratrain_protein_std = [0, 0, 0, 0]
85
+ intratrain_carbs_std = [0, 0, 0, 0]
86
+ rest_day_protein_std = [0, 0, 0, 0]
87
+ rest_day_carbs_std = [0, 0, 0, 0]
88
+ rest_day_fat_std = [0, 0, 0, 0]
89
 
90
  # Print macros min, max and mean
91
  print(f"Macros min, max and mean:\n{train_day_protein_std}, {train_day_carbs_std}, {train_day_fat_std}, {intratrain_protein_std}, {intratrain_carbs_std}, {rest_day_protein_std}, {rest_day_carbs_std}, {rest_day_fat_std}")