cleanup
This commit is contained in:
21
stand.py
21
stand.py
@ -5,9 +5,11 @@ import hacks
|
||||
from aggrid import aggrid
|
||||
from download import download
|
||||
from restapi import restapi
|
||||
from utils.st_utils import get_session_id, rerun, hide_UI_elements
|
||||
from utils.st_utils import get_session_id, hide_UI_elements
|
||||
|
||||
|
||||
print(">>> start of streamlit run")
|
||||
|
||||
|
||||
st.set_page_config(
|
||||
page_title="stand",
|
||||
@ -18,17 +20,12 @@ st.set_page_config(
|
||||
hide_UI_elements()
|
||||
|
||||
|
||||
|
||||
restapi.sid = get_session_id() # rest api needs current session ID to trigger the next rerun
|
||||
|
||||
changed = restapi.changed
|
||||
df = restapi.data
|
||||
|
||||
|
||||
|
||||
print(">>> start of streamlit run")
|
||||
|
||||
|
||||
download(df)
|
||||
|
||||
|
||||
@ -41,20 +38,10 @@ response = aggrid(
|
||||
new_df = response["data"]
|
||||
if not new_df.equals(df) and not changed:
|
||||
restapi.data = new_df
|
||||
# print("old:")
|
||||
# print(df)
|
||||
# print("new:")
|
||||
# print(new_df)
|
||||
# print(">>> force rerun")
|
||||
# rerun()
|
||||
|
||||
#st.dataframe(df.astype(str))
|
||||
#st.dataframe(new_df.astype(str))
|
||||
|
||||
if not new_df.empty:
|
||||
# new_df.to_excel("output.xlsx")
|
||||
new_df.to_hdf("output.h5", key="stand")
|
||||
|
||||
new_df.to_hdf("stand.h5", key="data")
|
||||
|
||||
|
||||
print(">>> end of streamlit run")
|
||||
|
Reference in New Issue
Block a user