diff --git a/dash_app/definitions.py b/dash_app/definitions.py index 2c5cc6f..29bc82e 100644 --- a/dash_app/definitions.py +++ b/dash_app/definitions.py @@ -17,7 +17,7 @@ if CONNECT_TO_LAMBDA: - print("DEPLOYMENT 13") + print("DEPLOYMENT 14") DATASET_ID = "1ffea-emt93" # MSD-LIVE added dataset id that goes to DEV DATA_DIR = "" @@ -26,14 +26,17 @@ if LAMBDA_TASK_ROOT is None: print(" ********** ", "LAMBDA_TASK_ROOT is None") METADATA_DIR = './metadata' + SERVE_LOCALLY = True else: print("********** LAMBDA_TASK_ROOT is ", os.getenv('LAMBDA_TASK_ROOT')) METADATA_DIR = os.path.join(LAMBDA_TASK_ROOT, "dash_app", "metadata") + SERVE_LOCALLY = False else: DATA_DIR = "../../data/msdlive-gridcerf" METADATA_DIR = "./metadata" LAMBDA_TASK_ROOT = "" + SERVE_LOCALLY = True COMPILED_DIR = os.path.join(DATA_DIR, "gridcerf/compiled/compiled_technology_layers") diff --git a/dash_app/layout.py b/dash_app/layout.py index dbb7581..bd6a413 100644 --- a/dash_app/layout.py +++ b/dash_app/layout.py @@ -29,7 +29,7 @@ # SOURCED SCRIPTS from src.utilities import recur_dictify -from definitions import LAMBDA_TASK_ROOT, CONNECT_TO_LAMBDA, REQUESETS_PATHNAME_PREFIX, METADATA_DIR, OUTDIR +from definitions import LAMBDA_TASK_ROOT, CONNECT_TO_LAMBDA, SERVE_LOCALLY, REQUESETS_PATHNAME_PREFIX, METADATA_DIR, OUTDIR # PATHS tech_pathways_df = pd.read_csv(os.path.join(METADATA_DIR, "msdlive_tech_paths.csv")) @@ -130,7 +130,7 @@ def create_app(): {"name": "viewport", "content": "width=device-width, initial-scale=1"}, {"name": "description", "content": "Geospatial Raster Input Data for Capacity Expansion Regional Feasibility (GRIDCERF). A high-resolution energy mapper."} ], - serve_locally = False if LAMBDA_TASK_ROOT is not (None, "") else True, # must be False for app deployment on AWS lambda + serve_locally = SERVE_LOCALLY, # must be False for app deployment on AWS lambda server=server, )