Maximofn commited on
Commit
9525575
·
1 Parent(s): 349ff65

feat(SRC): :rocket: If there aren't people with first query, then make second query more basic

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -80,9 +80,16 @@ def calcular_macros(esfuerzo_dieta, objetivo, cumplimiento_entrenamiento,
80
 
81
  # Crear diccionario de matches
82
  matches_dict = find_user_dates_matches(query, debug=False)
 
 
 
 
 
 
 
83
 
84
  # Print matches
85
- print(f"Matches ({len(matches_dict)}):")
86
  for match in matches_dict:
87
  print(f"\t{match}")
88
 
 
80
 
81
  # Crear diccionario de matches
82
  matches_dict = find_user_dates_matches(query, debug=False)
83
+ num_matches = len(matches_dict)
84
+
85
+ # Si no hay matches, intentamos con una query más básica
86
+ if num_matches == 0:
87
+ query = make_query(cluster_esfuerzo_dieta, cluster_objetivo, cluster_entrenamiento, cluster_cumplimiento_dieta, cluster_compromiso, diff_peso_min, diff_peso_max, basic_query=True)
88
+ matches_dict = find_user_dates_matches(query)
89
+ num_matches = len(matches_dict)
90
 
91
  # Print matches
92
+ print(f"Matches ({num_matches})")
93
  for match in matches_dict:
94
  print(f"\t{match}")
95