-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReader_JSON.py
More file actions
37 lines (28 loc) · 1.1 KB
/
Copy pathReader_JSON.py
File metadata and controls
37 lines (28 loc) · 1.1 KB
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
import streamlit as st
import pandas as pd
import json
# In the terminal, run:
# streamlit run readJSONonStreamlit.py
# The window will open, then drag and drop the JSON file
st.set_page_config(layout="wide")
st.title("📂 Reading Saved Results")
# === Upload the JSON file ===
uploaded_file = st.file_uploader("📤 Upload a saved JSON file", type="json")
if uploaded_file is not None:
try:
data = json.load(uploaded_file)
st.success("✅ File successfully loaded.")
# === Display tables ===
st.subheader("📊 Parameters set")
df_phys = pd.DataFrame(data["physicals"])
st.dataframe(df_phys, use_container_width=True)
st.subheader("📐 Dimensionless Numbers")
df_adim = pd.DataFrame(data["adimensional_numbers"])
st.table(df_adim)
st.subheader("⚙️ LB-WBS Parameters")
df_eps = pd.DataFrame(data["LB_WBS_parameters"])
st.table(df_eps)
except Exception as e:
st.error(f"❌ Error while reading the file: {e}")
else:
st.info("📝 Please upload a .json file generated by the simulation application.")