minor logging improvement

This commit is contained in:
Khalim Conn-Kowlessar 2025-12-14 22:18:54 +08:00
parent bf7f05108d
commit 8b7c6086ae

View file

@ -567,7 +567,6 @@ def db_read_session():
async def model_engine(body: PlanTriggerRequest):
logger.info("Model Engine triggered with body: %s", json.loads(body.model_dump_json()))
logger.info("Connecting to db")
created_at = datetime.now().isoformat()
start_ms = int(time.time() * 1000)
@ -1330,8 +1329,9 @@ async def model_engine(body: PlanTriggerRequest):
)
scenario_id = engine_scenario.id
new_epc_bands = {}
for i in range(0, len(input_properties), BATCH_SIZE):
for i in tqdm(
range(0, len(input_properties), BATCH_SIZE), total=int(np.ceil(len(input_properties) / BATCH_SIZE))
):
try:
# Take a slice of the input_properties list to make a batch
batch_properties = input_properties[i:i + BATCH_SIZE]
@ -1342,7 +1342,6 @@ async def model_engine(body: PlanTriggerRequest):
total_sap_points = sum([r["sap_points"] for r in default_recommendations])
new_sap_points = float(p.data["current-energy-efficiency"]) + total_sap_points
new_epc = sap_to_epc(new_sap_points)
new_epc_bands[p.id] = new_epc
total_cost = sum([r["total"] for r in default_recommendations])