Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Mayer
CircularGreenSimCity
Commits
380754ae
Commit
380754ae
authored
1 year ago
by
Eric Duminil
Browse files
Options
Download
Email Patches
Plain Diff
window ratio as parameter
parent
beac7c5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python_scripts/run_simstadt_from_python/variable_window_ratio.py
+23
-18
...scripts/run_simstadt_from_python/variable_window_ratio.py
with
23 additions
and
18 deletions
+23
-18
python_scripts/run_simstadt_from_python/variable_window_ratio.py
+
23
-
18
View file @
380754ae
...
@@ -62,7 +62,7 @@ def parse_library(library_path: Path) -> et.ElementTree:
...
@@ -62,7 +62,7 @@ def parse_library(library_path: Path) -> et.ElementTree:
return
et
.
parse
(
library_path
)
return
et
.
parse
(
library_path
)
def
set_custom_window_ratio
(
tree
:
et
.
ElementTree
,
window_ratio_node
:
float
,
export_path
:
Path
):
def
set_custom_window_ratio
(
window_ratio
:
float
,
tree
:
et
.
ElementTree
,
window_ratio_node
:
float
,
export_path
:
Path
):
root
=
tree
.
getroot
()
root
=
tree
.
getroot
()
root
.
find
(
'name'
,
NAMESPACE
).
text
=
f
"Custom Physics Library with Window Ratio :
{
window_ratio
}
"
root
.
find
(
'name'
,
NAMESPACE
).
text
=
f
"Custom Physics Library with Window Ratio :
{
window_ratio
}
"
for
surface
in
SURFACES
:
for
surface
in
SURFACES
:
...
@@ -90,26 +90,31 @@ def parse_results(window_ratio, heat_demand_csv):
...
@@ -90,26 +90,31 @@ def parse_results(window_ratio, heat_demand_csv):
'CoolingDemand'
:
cooling_demand_MWh
}
'CoolingDemand'
:
cooling_demand_MWh
}
workflow_path
,
physics_processor_step
=
copy_workflow_from_template
(
TEMPLATE_NAME
,
PROJECT_PATH
)
def
main
():
custom_library_path
=
set_custom_library
(
physics_processor_step
)
workflow_path
,
physics_processor_step
=
copy_workflow_from_template
(
TEMPLATE_NAME
,
PROJECT_PATH
)
lib_tree
=
parse_library
(
custom_library_path
)
custom_library_path
=
set_custom_library
(
physics_processor_step
)
lib_tree
=
parse_library
(
custom_library_path
)
all_results
=
[]
all_results
=
[]
for
window_ratio
in
WINDOW_RATIOS
:
for
window_ratio
in
WINDOW_RATIOS
:
# TODO: Status quo too
# TODO: Status quo too
set_custom_window_ratio
(
lib_tree
,
window_ratio
,
custom_library_path
)
set_custom_window_ratio
(
window_ratio
,
lib_tree
,
window_ratio
,
custom_library_path
)
output_files
=
run_workflow
(
find_simstadt
(
SIMSTADT2_GLOB
),
workflow_path
,
[
CITYGML
])
output_files
=
run_workflow
(
find_simstadt
(
SIMSTADT2_GLOB
),
workflow_path
,
[
CITYGML
])
heat_demand_csv
=
next
(
file
for
file
in
output_files
if
'HEATING_AND_COOLING.csv'
in
file
.
name
)
heat_demand_csv
=
next
(
file
for
file
in
output_files
if
'HEATING_AND_COOLING.csv'
in
file
.
name
)
################### Parse heat demand ########################
################### Parse heat demand ########################
all_results
.
append
(
parse_results
(
window_ratio
,
heat_demand_csv
))
all_results
.
append
(
parse_results
(
window_ratio
,
heat_demand_csv
))
df
=
pd
.
DataFrame
(
all_results
).
set_index
(
'WindowRatio'
)
df
=
pd
.
DataFrame
(
all_results
).
set_index
(
'WindowRatio'
)
print
(
df
)
print
(
df
)
df
.
plot
()
df
.
plot
()
plt
.
ylabel
(
'MWh'
)
plt
.
ylabel
(
'MWh'
)
plt
.
title
(
"Demands depending on Window Ratio"
)
plt
.
title
(
"Demands depending on Window Ratio"
)
plt
.
show
()
plt
.
show
()
if
__name__
==
"__main__"
:
main
()
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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
Menu
Explore
Projects
Groups
Snippets