From 9fade9229bc61d27f0b2d0949ebe90a34d900a96 Mon Sep 17 00:00:00 2001 From: Eric Ma Date: Sat, 18 Jan 2020 10:29:04 -0500 Subject: [PATCH] Minor updates - format function - add hvplot --- requirements.txt | 3 +++ st_runner.py | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 9b12307..5a15114 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,6 @@ numpy matplotlib streamlit scipy +hvplot +bokeh +holoviews diff --git a/st_runner.py b/st_runner.py index d24abb6..4dfc11a 100644 --- a/st_runner.py +++ b/st_runner.py @@ -21,9 +21,13 @@ for basename in os.listdir(folder): fnames.append(fname) # Make a UI to run different files. -files = {f.split("/")[-1].split(".")[0]: f for f in fnames} -filename = st.sidebar.selectbox("Select an app", list(files.keys())) -fname_to_run = files[filename] +def format_func(s): + return s.split("/")[-1].split(".")[0] + + +fname_to_run = st.sidebar.selectbox( + "Select an app", fnames, format_func=format_func +) # Create module from filepath and put in sys.modules, so Streamlit knows # to watch it for changes.