Commit 987ac3ce authored by ZZH's avatar ZZH

update inv eval 2024-12-31 11:45

parent e5638b51
This diff is collapsed.
...@@ -35,8 +35,11 @@ class EmsInvEvalReq(Model): ...@@ -35,8 +35,11 @@ class EmsInvEvalReq(Model):
@dataclass @dataclass
class EmsInvEvalRsp(Model): class EmsInvEvalRsp(Model):
pv: float = Opt(Float("光伏配置").eg(4500)) pv: float = Opt(Float("光伏配置").eg(4500))
es: float = Opt(Float("储能配置").eg(4500)) es_p: float = Opt(Float("储能功率配置").eg(4500))
es_cap: float = Opt(Float("储能容量配置").eg(4500))
cg: float = Opt(Float("煤制气").eg(4500)) cg: float = Opt(Float("煤制气").eg(4500))
income_year: float = Opt(Float("年收益").eg(4500)) income_year: float = Opt(Float("年收益").eg(4500))
total_inv_cost: float = Opt(Float("总投资成本").eg(4500)) total_inv_cost: float = Opt(Float("总投资成本").eg(4500))
irr: float = Opt(Float("投资回报率").eg(0.1)) irr: float = Opt(Float("内部收益率 ").eg(0.1))
ior: float = Opt(Float("投资回报率").eg(0.1))
cost_kWh: float = Opt(Float("度电成本").eg(0.1))
...@@ -44,9 +44,13 @@ async def post_inv_eval(req, body: EmsInvEvalReq) -> EmsInvEvalRsp: ...@@ -44,9 +44,13 @@ async def post_inv_eval(req, body: EmsInvEvalReq) -> EmsInvEvalRsp:
sale_price=sale_price, sale_limit=sale_limit, sale_price=sale_price, sale_limit=sale_limit,
sale_cost=sale_cost, goal=goal) sale_cost=sale_cost, goal=goal)
cfg = await inv_eval(d_params) cfg = await inv_eval(d_params)
return EmsInvEvalRsp(pv=cfg.get("pv", 0), es=cfg.get("es", 0), return EmsInvEvalRsp(pv=cfg.get("pv", 0), es_p=cfg.get("es_p", 0),
es_cap=cfg.get("es_cap", 0),
cg=cfg.get("cg", 0), cg=cfg.get("cg", 0),
income_year=cfg.get("income_year", 0), income_year=cfg.get("income_year", 0),
irr=cfg.get("irr", 0)) total_inv_cost=cfg.get("total_inv_cost", 0),
irr=cfg.get("irr", 0), ior=cfg.get("ior", 0),
cost_kWh=cfg.get("cost_kWh", 0), )
except Exception as e: except Exception as e:
return EmsInvEvalRsp(pv=0, es=0, cg=0, income_year=0, irr=0) return EmsInvEvalRsp(pv=0, es_p=0, es_cap=0, cg=0, income_year=0,
total_inv_cost=0, irr=0, ior=0, cost_kWh=0)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment