From e3acdaa989c995c3b3de615ff1d849228980a08d Mon Sep 17 00:00:00 2001 From: MichaelPesce Date: Mon, 21 Oct 2024 14:20:25 -0400 Subject: [PATCH] small change --- backend/app/internal/pareto_operational_model.py | 8 ++++++-- backend/app/internal/scenario_handler.py | 1 - backend/app/routers/scenarios.py | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/app/internal/pareto_operational_model.py b/backend/app/internal/pareto_operational_model.py index f9798e1..595e31b 100644 --- a/backend/app/internal/pareto_operational_model.py +++ b/backend/app/internal/pareto_operational_model.py @@ -52,6 +52,10 @@ def run_operational_model(input_file, output_file, id, modelParameters, override _log.info(f"getting data from excel sheet") [df_sets, df_parameters] = get_data(input_file, set_list, parameter_list) + # Additional input data + df_parameters["MinTruckFlow"] = 0 # barrels/day + df_parameters["MaxTruckFlow"] = 259000 # barrels/day + _log.info(f"creating model") default={ @@ -62,9 +66,9 @@ def run_operational_model(input_file, output_file, id, modelParameters, override operational_model = create_model( df_sets, df_parameters, - default=default + default=default, ) - + _log.info("created model") scenario = scenario_handler.get_scenario(int(id)) results = {"data": {}, "status": "Solving model"} scenario["results"] = results diff --git a/backend/app/internal/scenario_handler.py b/backend/app/internal/scenario_handler.py index dc509ed..40dd2e9 100644 --- a/backend/app/internal/scenario_handler.py +++ b/backend/app/internal/scenario_handler.py @@ -201,7 +201,6 @@ def update_scenario(self, updatedScenario): def upload_excelsheet(self, output_path, scenarioName, filename, model_type="strategic", kmz_data=None): _log.info(f"Uploading excel sheet: {scenarioName}") - [set_list, parameter_list] = get_input_lists(model_type) # read in data from uploaded excel sheet diff --git a/backend/app/routers/scenarios.py b/backend/app/routers/scenarios.py index dd301f0..725ce31 100644 --- a/backend/app/routers/scenarios.py +++ b/backend/app/routers/scenarios.py @@ -192,7 +192,7 @@ async def run_model(request: Request, background_tasks: BackgroundTasks): _log.error(f'unable to find override values') overrideValues = {} - model_type = data['scenario'].get("model_type", "strategic") == "strategic" + model_type = data['scenario'].get("model_type", "strategic") if model_type == "strategic": print("RUNNING STRATEGIC MODEL BOII") background_tasks.add_task(