Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
U
unify_api2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chaonan
unify_api2
Commits
987ac3ce
Commit
987ac3ce
authored
Dec 31, 2024
by
ZZH
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update inv eval 2024-12-31 11:45
parent
e5638b51
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
180 additions
and
111 deletions
+180
-111
ems.py
unify_api/algo/ems/ems.py
+168
-106
ems_cps.py
unify_api/modules/inv_eval/components/ems_cps.py
+5
-2
ems.py
unify_api/modules/inv_eval/views/ems.py
+7
-3
No files found.
unify_api/algo/ems/ems.py
View file @
987ac3ce
This diff is collapsed.
Click to expand it.
unify_api/modules/inv_eval/components/ems_cps.py
View file @
987ac3ce
...
...
@@ -35,8 +35,11 @@ class EmsInvEvalReq(Model):
@
dataclass
class
EmsInvEvalRsp
(
Model
):
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
))
income_year
:
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
))
unify_api/modules/inv_eval/views/ems.py
View file @
987ac3ce
...
...
@@ -44,9 +44,13 @@ async def post_inv_eval(req, body: EmsInvEvalReq) -> EmsInvEvalRsp:
sale_price
=
sale_price
,
sale_limit
=
sale_limit
,
sale_cost
=
sale_cost
,
goal
=
goal
)
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
),
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
:
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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment