-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📊 improve etl-explorer tooling (#3220)
* 📊 update war explorer to path-based * bump streamlit * update icons, titles * wip: explorer editor * wip * wip * object to manipulate explorer config * wip * wip * wip * change module name * improve err message, remove unused code * wip * wip * wip * wip * comment explorer tool for now * explorer tools * add beta tool to migrate id->paths in explorers * format * ci/cd * log warning * change to new explorer creation tool * typo in function name
- Loading branch information
1 parent
98605b7
commit 1e26124
Showing
22 changed files
with
788 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
"""Helper tool to create map brackets for all indicators in an indicator-based explorer.""" | ||
from io import StringIO | ||
|
||
import streamlit as st | ||
|
||
from etl.explorer import Explorer | ||
|
||
# PAGE CONFIG | ||
st.set_page_config( | ||
page_title="Wizard: Explorer editor", | ||
page_icon="🪄", | ||
) | ||
st.title(":material/explore: Explorer Editor") | ||
|
||
|
||
with st.container(border=True): | ||
st.subheader("IDs to Paths") | ||
st.markdown("Migrate all references to indicator IDs for their corresponding indicator paths.") | ||
|
||
uploaded_file = st.file_uploader( | ||
label="Upload Explorer config file", | ||
type=["csv", "tsv"], | ||
) | ||
|
||
if uploaded_file: | ||
stringio = StringIO(uploaded_file.getvalue().decode("utf-8")) | ||
string_data = stringio.read() | ||
|
||
if uploaded_file.name.endswith("csv"): | ||
sep = "," | ||
else: | ||
sep = "\t" | ||
|
||
explorer = Explorer.from_raw_string(string_data, sep=sep) | ||
|
||
# explorer.convert_ids_to_etl_paths() | ||
|
||
# with st.popover("config"): | ||
# st.dataframe(pd.DataFrame(explorer.config).T.rename(columns={0: "value"})) | ||
|
||
# with st.popover("graphers"): | ||
# st.dataframe(explorer.df_graphers) | ||
|
||
# with st.popover("columns"): | ||
# st.dataframe(explorer.df_columns) | ||
|
||
# Update | ||
explorer.convert_ids_to_etl_paths() | ||
|
||
# Downloads | ||
st.download_button( | ||
"Download `graphers` (CSV)", | ||
explorer._df_graphers_output.to_csv(sep=",", index=False), # type: ignore | ||
file_name="graphers.csv", | ||
) | ||
if not explorer.df_columns.empty: | ||
st.download_button( | ||
"Download `columns` (CSV)", | ||
explorer._df_columns_output.to_csv(sep=",", index=False), # type: ignore | ||
file_name="columns.csv", | ||
) | ||
|
||
filename = f"modified-{uploaded_file.name.replace('.csv', '.tsv')}" | ||
st.download_button("Download new config (TSV)", explorer.content, file_name=filename) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.