From 3e54843bc18f5f173582347e4700c7666443168d Mon Sep 17 00:00:00 2001 From: Jeff Tang <47529643+jmtang2018@users.noreply.github.com> Date: Fri, 25 Oct 2024 16:01:55 -0400 Subject: [PATCH 1/2] added data path environment --- src/tabs/study_dashboard.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/tabs/study_dashboard.py b/src/tabs/study_dashboard.py index 771cb4c..4bbf68c 100644 --- a/src/tabs/study_dashboard.py +++ b/src/tabs/study_dashboard.py @@ -2,10 +2,17 @@ import pandas as pd import plotly.express as px import json +import os def load_data(): # Read the JSON object from the file - with open('data/dashboard_data.json', 'r') as json_file: + docs_data_path = os.getenv('DOCS_DATA_PATH') + file_path = os.path.join(docs_data_path, 'dashboard_data.json') + + # Check if the file path is valid and the file exists + if not os.path.isfile(file_path): + raise FileNotFoundError(f"The file at path {file_path} does not exist.") + with open(file_path, 'r') as json_file: data = json.load(json_file) return data From 1b3b4754461168f95a6a3d54544a206d1d9fa7fe Mon Sep 17 00:00:00 2001 From: Jeff Tang <47529643+jmtang2018@users.noreply.github.com> Date: Fri, 25 Oct 2024 16:12:54 -0400 Subject: [PATCH 2/2] bump version --- README.md | 2 +- src/dashboard.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a8090e4..9114d2e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Docs for the Bridge2AI Voice Project. -[![Github](https://img.shields.io/badge/github-1.0.0-green?style=flat&logo=github)](https://github.com/eipm/bridge2ai-docs) [![Python 3.11.5](https://img.shields.io/badge/python-3.12.0-blue.svg)](https://www.python.org/downloads/release/python-3120/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![DOI](https://zenodo.org/badge/860006845.svg)](https://zenodo.org/doi/10.5281/zenodo.13834653) +[![Github](https://img.shields.io/badge/github-1.0.1-green?style=flat&logo=github)](https://github.com/eipm/bridge2ai-docs) [![Python 3.11.5](https://img.shields.io/badge/python-3.12.0-blue.svg)](https://www.python.org/downloads/release/python-3120/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![DOI](https://zenodo.org/badge/860006845.svg)](https://zenodo.org/doi/10.5281/zenodo.13834653) ## 🤝 License diff --git a/src/dashboard.py b/src/dashboard.py index 28bb029..0f29d84 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -39,7 +39,7 @@ def create_tabs(tabs_func): def main(): # Current version of the app - version = "1.0.0" + version = "1.0.1" # Map tab names to functions # In this dictionary, the key is the tab name and the value is the function that will be called when the tab is selected # The function is defined in the respective file