Update py

This commit is contained in:
DingZQ
2025-05-22 23:10:20 +08:00
parent 28eb0ee94c
commit 5fc5bc5ecc

View File

@@ -2795,7 +2795,7 @@ class Run_Simulation_Manually_by_Date(BaseModel):
name: str
simulation_date: str
def run_simulation_manually_by_date(network_name: str, simulation_date: str) -> None:
def run_simulation_manually_by_date(network_name: str, base_date: datetime) -> None:
# 循环生成96个时间点15分钟间隔
for i in range(96):
# 计算当前时间偏移
@@ -2842,7 +2842,7 @@ async def fastapi_run_simulation_manually_by_date(data: Run_Simulation_Manually_
base_date = datetime.strptime(item['simulation_date'], "%Y-%m-%d")
thread = threading.Thread(target=lambda: run_simulation_manually_by_date(item['name'], item['simulation_date']))
thread = threading.Thread(target=lambda: run_simulation_manually_by_date(item['name'], base_date))
thread.start()
############################################################