From 2f8b2162ee0aa2ecbeaebab5031f89f43c52028f Mon Sep 17 00:00:00 2001 From: Cizz22 Date: Tue, 24 Jun 2025 11:18:50 +0700 Subject: [PATCH] minor fir --- src/aeros_simulation/service.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/aeros_simulation/service.py b/src/aeros_simulation/service.py index 7b59c6f..1bf4f7e 100644 --- a/src/aeros_simulation/service.py +++ b/src/aeros_simulation/service.py @@ -137,6 +137,12 @@ async def execute_simulation( ) +async def get_all_aeros_node(*, db_session: DbSession): + query = select(AerosNode) + results = await db_session.execute(query) + return results.scalars().all() + + async def save_simulation_result( *, db_session: DbSession, simulation_id: UUID, result: dict ): @@ -146,10 +152,8 @@ async def save_simulation_result( """Save the simulation result""" avaiable_nodes = { - node["nodeId"]: await get_simulation_node_by( - db_session=db_session, node_id=node["nodeId"] - ) - for node in calc_result + node.node_id: node + for node in await get_all_aeros_node(db_session=db_session) } calc_objects = [] plot_objects = []