Update app.py
Browse files
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 π":
|
33 |
-
"Backstroke πββοΈ":
|
34 |
-
"Breaststroke πΈ":
|
35 |
-
"Freestyle Light π¦":
|
36 |
-
"Freestyle Vigorous π":
|
37 |
-
"Butterfly π¦":
|
38 |
-
"Dog Paddle πΆ":
|
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 |
+
|