awacke1 commited on
Commit
a99f0fe
Β·
1 Parent(s): 46b19ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -1,12 +1,11 @@
1
  import streamlit as st
2
 
3
- # Function to calculate calories burned during swimming based on swim style
4
  def calories_swim(time_hr, weight_kg, style_mets):
5
  return (time_hr * style_mets * 3.5 * weight_kg) / 200
6
 
7
  # Function to calculate calories burned during pull-ups based on grip style
8
  def calories_pullup(reps, weight, grip_style_factor):
9
- # Using formula PUC = (PU * 5 * BW / 150) * grip_style_factor
10
  return (reps * 5 * weight) / 150 * grip_style_factor
11
 
12
  # Streamlit UI
@@ -27,15 +26,15 @@ exercise_type = st.sidebar.selectbox(
27
  ["Swim Jim πŸŠβ€β™‚οΈ", "Ring King πŸ‘‘", "Both Boost πŸš€"]
28
  )
29
 
30
- # Swim Styles with METs
31
  swim_styles = {
32
- "Treading Water 🌊": 3.5,
33
- "Backstroke πŸŠβ€β™‚οΈ": 4.8,
34
- "Breaststroke 🐸": 5.3,
35
- "Freestyle Light πŸ¦‹": 5.8,
36
- "Freestyle Vigorous πŸš€": 8.3,
37
- "Butterfly πŸ¦‹": 7.5,
38
- "Dog Paddle 🐢": 4.0
39
  }
40
 
41
  # Grip Styles with factors
@@ -85,3 +84,4 @@ st.write(f"METS for chosen style: {swim_styles[swim_style]}")
85
 
86
  st.subheader(f"Ring Style: {grip_style} πŸͺ")
87
  st.write(f"Factor for chosen grip: {grip_styles[grip_style]}")
 
 
1
  import streamlit as st
2
 
3
+ # Revised Function to calculate calories burned during swimming based on swim style
4
  def calories_swim(time_hr, weight_kg, style_mets):
5
  return (time_hr * style_mets * 3.5 * weight_kg) / 200
6
 
7
  # Function to calculate calories burned during pull-ups based on grip style
8
  def calories_pullup(reps, weight, grip_style_factor):
 
9
  return (reps * 5 * weight) / 150 * grip_style_factor
10
 
11
  # Streamlit UI
 
26
  ["Swim Jim πŸŠβ€β™‚οΈ", "Ring King πŸ‘‘", "Both Boost πŸš€"]
27
  )
28
 
29
+ # Revised Swim Styles with METs
30
  swim_styles = {
31
+ "Treading Water 🌊": 6.0,
32
+ "Backstroke πŸŠβ€β™‚οΈ": 9.0,
33
+ "Breaststroke 🐸": 10.0,
34
+ "Freestyle Light πŸ¦‹": 11.0,
35
+ "Freestyle Vigorous πŸš€": 13.0,
36
+ "Butterfly πŸ¦‹": 12.0,
37
+ "Dog Paddle 🐢": 7.0
38
  }
39
 
40
  # Grip Styles with factors
 
84
 
85
  st.subheader(f"Ring Style: {grip_style} πŸͺ")
86
  st.write(f"Factor for chosen grip: {grip_styles[grip_style]}")
87
+