-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
45 lines (34 loc) · 957 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""This is the main module to run the app"""
# Importing the necessary Python modules.
import streamlit as st
# Import necessary functions from web_functions
from web_functions import load_data
# Import pages
from Tabs import home, data, predict, visualise
# Configure the app
st.set_page_config(
page_title = 'Water Quality Inspector',
layout = 'wide',
initial_sidebar_state = 'auto'
)
# Dictionary for pages
Tabs = {
"Home": home,
"Data Info": data,
"Prediction": predict,
"Visualisation": visualise
}
# Create a sidebar
# Add title to sidear
st.sidebar.title("Navigation")
# Create radio option to select the page
page = st.sidebar.radio("Pages", list(Tabs.keys()))
# Loading the dataset.
df, X, y = load_data()
# Call the app funciton of selected page to run
if page in ["Prediction", "Visualisation"]:
Tabs[page].app(df, X, y)
elif (page == "Data Info"):
Tabs[page].app(df)
else:
Tabs[page].app()