Upload 127 files
Browse files- app.py +2 -2
- requirements.txt +10 -10
- ui/layout.py +108 -110
app.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
from ui.layout import build_layout
|
| 2 |
|
| 3 |
def main():
|
| 4 |
-
app = build_layout()
|
| 5 |
-
app.launch(share=True)
|
| 6 |
|
| 7 |
if __name__ == "__main__":
|
| 8 |
main()
|
|
|
|
| 1 |
from ui.layout import build_layout
|
| 2 |
|
| 3 |
def main():
|
| 4 |
+
app, theme, css = build_layout()
|
| 5 |
+
app.launch(share=True, theme=theme, css=css)
|
| 6 |
|
| 7 |
if __name__ == "__main__":
|
| 8 |
main()
|
requirements.txt
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
-
gradio
|
| 2 |
-
pandas
|
| 3 |
-
numpy
|
| 4 |
-
matplotlib
|
| 5 |
-
seaborn
|
| 6 |
-
scipy
|
| 7 |
-
statsmodels
|
| 8 |
-
openpyxl
|
| 9 |
-
Pillow
|
| 10 |
-
pingouin
|
|
|
|
| 1 |
+
gradio
|
| 2 |
+
pandas
|
| 3 |
+
numpy
|
| 4 |
+
matplotlib
|
| 5 |
+
seaborn
|
| 6 |
+
scipy
|
| 7 |
+
statsmodels
|
| 8 |
+
openpyxl
|
| 9 |
+
Pillow
|
| 10 |
+
pingouin
|
ui/layout.py
CHANGED
|
@@ -1,110 +1,108 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
|
| 3 |
-
from state.app_state import AppState
|
| 4 |
-
from ui.styles import DATA_SELECTOR_CSS
|
| 5 |
-
from ui.assets import LOGOS
|
| 6 |
-
|
| 7 |
-
from ui.tabs.data_tab import build as build_data_tab
|
| 8 |
-
from ui.tabs.estimation.descriptive_tab import build as build_descriptive_tab
|
| 9 |
-
from ui.tabs.estimation.inference_tab import build as build_inference_tab
|
| 10 |
-
from ui.tabs.estimation.graphical_tab import build as build_graphical_tab
|
| 11 |
-
from ui.tabs.hypothesis_testing_tab import build as build_hypothesis_tab
|
| 12 |
-
from ui.tabs.linear_regression_tab import build as build_linear_regression_tab
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
def build_layout():
|
| 16 |
-
"""
|
| 17 |
-
Global application layout.
|
| 18 |
-
|
| 19 |
-
Responsibilities:
|
| 20 |
-
- Instantiate AppState once
|
| 21 |
-
- Apply theme and CSS globally
|
| 22 |
-
- Render persistent header (logos + title)
|
| 23 |
-
- Define main navigation tabs
|
| 24 |
-
"""
|
| 25 |
-
|
| 26 |
-
state = AppState()
|
| 27 |
-
|
| 28 |
-
with gr.Blocks(
|
| 29 |
-
title="Thotsakan Statistics",
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
# ==================================================
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
gr.Image(LOGOS["
|
| 39 |
-
gr.Image(LOGOS["
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
# ==================================================
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
# -------------------------
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
# -------------------------
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
# -------------------------
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
# -------------------------
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
# -------------------------
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
# -------------------------
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
return demo
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
from state.app_state import AppState
|
| 4 |
+
from ui.styles import DATA_SELECTOR_CSS
|
| 5 |
+
from ui.assets import LOGOS
|
| 6 |
+
|
| 7 |
+
from ui.tabs.data_tab import build as build_data_tab
|
| 8 |
+
from ui.tabs.estimation.descriptive_tab import build as build_descriptive_tab
|
| 9 |
+
from ui.tabs.estimation.inference_tab import build as build_inference_tab
|
| 10 |
+
from ui.tabs.estimation.graphical_tab import build as build_graphical_tab
|
| 11 |
+
from ui.tabs.hypothesis_testing_tab import build as build_hypothesis_tab
|
| 12 |
+
from ui.tabs.linear_regression_tab import build as build_linear_regression_tab
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
def build_layout():
|
| 16 |
+
"""
|
| 17 |
+
Global application layout.
|
| 18 |
+
|
| 19 |
+
Responsibilities:
|
| 20 |
+
- Instantiate AppState once
|
| 21 |
+
- Apply theme and CSS globally
|
| 22 |
+
- Render persistent header (logos + title)
|
| 23 |
+
- Define main navigation tabs
|
| 24 |
+
"""
|
| 25 |
+
|
| 26 |
+
state = AppState()
|
| 27 |
+
|
| 28 |
+
with gr.Blocks(
|
| 29 |
+
title="Thotsakan Statistics",
|
| 30 |
+
) as demo:
|
| 31 |
+
|
| 32 |
+
# ==================================================
|
| 33 |
+
# Global header (always visible)
|
| 34 |
+
# ==================================================
|
| 35 |
+
with gr.Row(equal_height=True):
|
| 36 |
+
gr.Image(LOGOS["thotsakan"], height=80, show_label=False)
|
| 37 |
+
gr.Image(LOGOS["cmkl"], height=80, show_label=False)
|
| 38 |
+
gr.Image(LOGOS["aice"], height=80, show_label=False)
|
| 39 |
+
#gr.Image(LOGOS["himmapan"], height=80, show_label=False)
|
| 40 |
+
|
| 41 |
+
gr.Markdown(
|
| 42 |
+
"""
|
| 43 |
+
# Thotsakan Statistics
|
| 44 |
+
*Probability and Statistics Interactive Laboratory*
|
| 45 |
+
"""
|
| 46 |
+
)
|
| 47 |
+
|
| 48 |
+
# ==================================================
|
| 49 |
+
# Main application tabs
|
| 50 |
+
# ==================================================
|
| 51 |
+
with gr.Tabs():
|
| 52 |
+
|
| 53 |
+
# -------------------------
|
| 54 |
+
# Home
|
| 55 |
+
# -------------------------
|
| 56 |
+
with gr.Tab("๐ Home"):
|
| 57 |
+
gr.Markdown("What is Himmapan lab. Its goal, its vision, products.")
|
| 58 |
+
gr.Markdown("What is Thotsakan Statistics. Links to repository.")
|
| 59 |
+
|
| 60 |
+
# -------------------------
|
| 61 |
+
# Data
|
| 62 |
+
# -------------------------
|
| 63 |
+
with gr.Tab("๐ Data"):
|
| 64 |
+
build_data_tab(state)
|
| 65 |
+
|
| 66 |
+
# -------------------------
|
| 67 |
+
# Probability
|
| 68 |
+
# -------------------------
|
| 69 |
+
with gr.Tab("๐ฒ Probability"):
|
| 70 |
+
with gr.Tabs():
|
| 71 |
+
with gr.Tab("๐ Common Distributions"):
|
| 72 |
+
gr.Markdown("๐ง Building.")
|
| 73 |
+
|
| 74 |
+
with gr.Tab("โ๏ธ Custom Distribution"):
|
| 75 |
+
gr.Markdown("๐ง Building.")
|
| 76 |
+
|
| 77 |
+
with gr.Tab("๐ค Approximations"):
|
| 78 |
+
gr.Markdown("๐ง Building.")
|
| 79 |
+
|
| 80 |
+
# -------------------------
|
| 81 |
+
# Estimation
|
| 82 |
+
# -------------------------
|
| 83 |
+
with gr.Tab("๐ Estimation"):
|
| 84 |
+
with gr.Tabs():
|
| 85 |
+
with gr.Tab("๐งฎ Descriptive Statistics"):
|
| 86 |
+
build_descriptive_tab(state)
|
| 87 |
+
|
| 88 |
+
with gr.Tab("๐ญ Statistical Inference"):
|
| 89 |
+
build_inference_tab(state)
|
| 90 |
+
|
| 91 |
+
with gr.Tab("๐ Graphical Analysis"):
|
| 92 |
+
build_graphical_tab(state)
|
| 93 |
+
|
| 94 |
+
# -------------------------
|
| 95 |
+
# Hypothesis Testing
|
| 96 |
+
# -------------------------
|
| 97 |
+
with gr.Tab("๐งช Hypothesis Testing"):
|
| 98 |
+
build_hypothesis_tab(state)
|
| 99 |
+
|
| 100 |
+
# -------------------------
|
| 101 |
+
# Linear Regression
|
| 102 |
+
# -------------------------
|
| 103 |
+
with gr.Tab("๐ Linear Regression"):
|
| 104 |
+
build_linear_regression_tab(state)
|
| 105 |
+
|
| 106 |
+
gr.Markdown("### ๐ค Developed by Himmapan Lab at CMKL University, version 5.0.0, February 2026.")
|
| 107 |
+
|
| 108 |
+
return demo, gr.themes.Soft(), DATA_SELECTOR_CSS
|
|
|
|
|
|