Skip to content

Commit

Permalink
small change
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelPesce committed Oct 21, 2024
1 parent 14549bc commit e3acdaa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
8 changes: 6 additions & 2 deletions backend/app/internal/pareto_operational_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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={
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion backend/app/internal/scenario_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion backend/app/routers/scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit e3acdaa

Please sign in to comment.