Skip to content

Commit

Permalink
fix/feat(app.py): fix relative path of example_data folder in product…
Browse files Browse the repository at this point in the history
…ion server and add button for example analysis
  • Loading branch information
bmascat committed Mar 23, 2024
1 parent 35a495c commit eedfc3d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ figures/
#Files
notebooks/crossref-api-review.ipynb
notebooks/resultados.json
app/.streamlit/*
.streamlit/*
app/header.png
9 changes: 5 additions & 4 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# Función para cargar los DataFrames de ejemplo desde la carpeta example_data
def load_example_dataframe(filename):
return pd.read_csv(f'example_data/{filename}')
return pd.read_csv(f'./app/example_data/{filename}')

# Función para generar enlace de descarga para un DataFrame en CSV
def get_table_download_link(df, filename):
Expand Down Expand Up @@ -92,9 +92,6 @@ def analysis_layout(df_diseases, df_drugs, df_adverse_effects = None):

left_column, right_column = st.columns(2)

if diseases_file is None and drugs_file is None:
analysis_layout(df_example_diseases, df_example_drugs, df_example_adverse_effects)

# Botón para realizar el análisis
if st.sidebar.button('Analizar'):
if diseases_file is not None and drugs_file is not None:
Expand All @@ -107,3 +104,7 @@ def analysis_layout(df_diseases, df_drugs, df_adverse_effects = None):
analysis_layout(df_diseases, df_drugs, df_adverse_effects)
else:
st.warning('Por favor, carga ambos archivos CSV antes de analizar.')

#Realizar un análisis de ejemplo para mostrar como se debería ver el resultado
if st.sidebar.button('Analisis de Ejemplo'):
analysis_layout(df_example_diseases, df_example_drugs, df_example_adverse_effects)

0 comments on commit eedfc3d

Please sign in to comment.