File size: 1,462 Bytes
e0bab69 |
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 |
"""Global constants and initial session-state defaults."""
from typing import List
import pandas as pd
FREQUENCIES: List[int] = [125, 250, 500, 1000, 2000, 4000]
TOTAL_DOTS = 200
AI_BANDS = {
(0.00, 0.24): "None",
(0.25, 0.40): "Fair",
(0.41, 0.60): "Good",
(0.61, 1.00): "Excellent",
}
MAJOR_TABS = [
"Instructions",
"Initial Data Entry",
"Initial Compliance Checks",
"Acoustic Treatment",
"Final Compliance Checks",
"FAQ / Help",
]
# ββ Streamlit-session defaults ββββββββββββββββββββββββββββββββββββββββββββ
DEFAULTS = dict(
major_tab=MAJOR_TABS[0],
# uploads / inputs
df_current_rt=None, df_existing_mat=None, room_volume=0.0,
df_background_noise=pd.DataFrame(columns=["Location", "dBA"]),
bn_input_loc="", bn_input_val=0.0,
df_spl=None,
# compliance params
rt_min=0.0, rt_max=0.0, bn_min=0.0, bn_max=0.0,
# multi-location AI dictionaries
dots_init_dict={}, ai_init_dict={},
dots_final_dict={}, ai_final_dict={},
# acoustic-treatment data
desired_rt_df=pd.DataFrame(
{"Frequency": FREQUENCIES, "Desired RT60": [0.01]*6}
),
df_new_mat=None,
# derived absorption & figures
current_absorption={}, new_absorption={},
fig_rt_initial=None, fig_bn_initial=None,
fig_rt_final=None, fig_bn_final=None,
)
|