From ed6f1d52a643db7e11c68ca860ad8c5360ee3015 Mon Sep 17 00:00:00 2001 From: ebalogun01 <42688418+ebalogun01@users.noreply.github.com> Date: Wed, 13 Dec 2023 09:20:10 -0800 Subject: [PATCH] updating app.py to work with agnostic path --- app.py | 8 +++++--- charging_sim/simulate.py | 7 +++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index c33147f5..5866d7f7 100644 --- a/app.py +++ b/app.py @@ -88,10 +88,12 @@ def simulate(user_inputs, sequential_run=True, parallel_run=False): # Updating the user inputs based on frontend inputs. create_results_folder() # Make a results folder if it does not exist. - path_prefix = os.getcwd() + path_prefix = os.getcwd() # TODO WORK ON THIS + # repo_name = path_prefix.split('\\')[-1] + # print("path_prefix is ", path_prefix) + # print(path_prefix.split('\\')) # Change below to name of the repo. - results_folder_path = path_prefix[: path_prefix.index('EV-EcoSim')] + 'EV-EcoSim/analysis/results' - path_prefix = path_prefix[: path_prefix.index('EV-EcoSim')] + 'EV-EcoSim' + results_folder_path = path_prefix + '/analysis/results' # PRELOAD station_config = open(path_prefix + '/test_cases/battery/feeder_population/config.txt', 'r') diff --git a/charging_sim/simulate.py b/charging_sim/simulate.py index a2dfd9da..13ce63be 100644 --- a/charging_sim/simulate.py +++ b/charging_sim/simulate.py @@ -82,6 +82,13 @@ def make_month_str(month_int: int): return f'0{str(month_int)}' +def get_repository_name(): + """ + Helps obtain the current directory which houses the repository currently in. + + :return: + """ + # GET THE PATH PREFIX FOR SAVING THE INPUTS # user_inputs = load_default_input()