SanaAdeel commited on
Commit
46a379e
·
verified ·
1 Parent(s): e61982b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -12
app.py CHANGED
@@ -16,10 +16,10 @@ def generate_menu(data, season, outings, dietary_restrictions, bmi, pantry_ingre
16
  # Define the number of dishes based on BMI
17
  if bmi < 18.5: # Underweight
18
  sub_category_pref = {
19
- 'Sabzi': 3, # More vegetables to increase calorie intake
20
- 'Rice': 2, # More rice to increase carbohydrates
21
- 'Daal': 2, # Protein-rich dals
22
- 'Meat': 3, # More meat for proteins
23
  'Chicken': 2,
24
  'Fish': 1
25
  }
@@ -34,19 +34,19 @@ def generate_menu(data, season, outings, dietary_restrictions, bmi, pantry_ingre
34
  }
35
  elif 25 <= bmi < 29.9: # Overweight
36
  sub_category_pref = {
37
- 'Sabzi': 4, # More vegetables
38
- 'Rice': 1, # Limit rice
39
- 'Daal': 2, # Protein-rich dals
40
- 'Meat': 1, # Limit meat intake
41
  'Chicken': 3,
42
  'Fish': 1
43
  }
44
  else: # Obese
45
  sub_category_pref = {
46
- 'Sabzi': 5, # More vegetables
47
- 'Rice': 1, # Very limited rice
48
- 'Daal': 2, # Protein-rich dals
49
- 'Meat': 1, # Very limited meat
50
  'Chicken': 2,
51
  'Fish': 1
52
  }
@@ -117,6 +117,16 @@ def bmi_insights(weight, height_cm):
117
  def pantry_sync(available_ingredients):
118
  return set(available_ingredients)
119
 
 
 
 
 
 
 
 
 
 
 
120
  # Main workflow
121
  def main():
122
  st.title("Roz Roz Ka Masla..... Aaj Kya Pakayen!!! ")
@@ -158,6 +168,10 @@ def main():
158
  bmi = weight / (height_cm / 100) ** 2 # BMI calculation
159
  lunch_menu, dinner_menu, total_cost, shopping_list = generate_menu(data, season, outings, dietary_restrictions, bmi, pantry_ingredients)
160
 
 
 
 
 
161
  st.header("Weekly Menu")
162
  st.subheader("Lunch Menu")
163
  st.write(lunch_menu)
 
16
  # Define the number of dishes based on BMI
17
  if bmi < 18.5: # Underweight
18
  sub_category_pref = {
19
+ 'Sabzi': 3,
20
+ 'Rice': 2,
21
+ 'Daal': 2,
22
+ 'Meat': 3,
23
  'Chicken': 2,
24
  'Fish': 1
25
  }
 
34
  }
35
  elif 25 <= bmi < 29.9: # Overweight
36
  sub_category_pref = {
37
+ 'Sabzi': 4,
38
+ 'Rice': 1,
39
+ 'Daal': 2,
40
+ 'Meat': 1,
41
  'Chicken': 3,
42
  'Fish': 1
43
  }
44
  else: # Obese
45
  sub_category_pref = {
46
+ 'Sabzi': 5,
47
+ 'Rice': 1,
48
+ 'Daal': 2,
49
+ 'Meat': 1,
50
  'Chicken': 2,
51
  'Fish': 1
52
  }
 
117
  def pantry_sync(available_ingredients):
118
  return set(available_ingredients)
119
 
120
+ # Function to assign weekday names to the menu
121
+ def assign_weekdays(menu):
122
+ weekdays = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
123
+ menu_with_weekdays = []
124
+ for i, dish in enumerate(menu):
125
+ dish_with_day = dish.copy()
126
+ dish_with_day["Weekday"] = weekdays[i % 7]
127
+ menu_with_weekdays.append(dish_with_day)
128
+ return pd.DataFrame(menu_with_weekdays)
129
+
130
  # Main workflow
131
  def main():
132
  st.title("Roz Roz Ka Masla..... Aaj Kya Pakayen!!! ")
 
168
  bmi = weight / (height_cm / 100) ** 2 # BMI calculation
169
  lunch_menu, dinner_menu, total_cost, shopping_list = generate_menu(data, season, outings, dietary_restrictions, bmi, pantry_ingredients)
170
 
171
+ # Assign weekdays to the menu
172
+ lunch_menu = assign_weekdays(lunch_menu)
173
+ dinner_menu = assign_weekdays(dinner_menu)
174
+
175
  st.header("Weekly Menu")
176
  st.subheader("Lunch Menu")
177
  st.write(lunch_menu)