Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Add additional info about random data
Browse files Browse the repository at this point in the history
  • Loading branch information
t03i committed Jan 3, 2024
1 parent 9f1493c commit 03e5de0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ def show_table(df: pd.DataFrame):
) # , update_mode='manual')#theme='alpine',


@st.cache_data(ttl=600, show_spinner=False)
@st.cache_data(ttl=60, show_spinner=False)
def display_random_data(_db_conn, db_filter: DBFilter):
with st.spinner("Loading random data..."):
st.session_state.data = db.get_random_data(_db_conn, db_filter.num_sequences)
st.session_state.user_display = "The table below shows a random selection. Use the sidebar filters for a personalized selection." # noqa: E501
st.session_state.user_display = "The table below shows a random selection. You can generate a new selection every 20 min. Use the sidebar filters for a personalized selection." # noqa: E501


@st.cache_data(ttl=600, show_spinner=False)
Expand Down
4 changes: 4 additions & 0 deletions streamlitapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ def handle_database_tab(db_conn):
else:
database.display_filtered_data(db_conn, database_filter)

if not st.st.session_state.user_display.empty:
st.write(st.session_state.user_display)
st.markdown("---")

if not st.session_state.data.empty:
database.show_table(st.session_state.data)
st.download_button(
Expand Down

0 comments on commit 03e5de0

Please sign in to comment.