Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
SimStadt
simstadtpy
Commits
1f5ddbf5
Commit
1f5ddbf5
authored
Sep 20, 2026
by
Eric Duminil
Browse files
Renamed templates, without 100 prefix
parent
28c17ea5
Changes
122
Hide whitespace changes
Inline
Side-by-side
tests/test_results.py
View file @
1f5ddbf5
...
@@ -48,11 +48,11 @@ def find_output_files(workflow_path: Path) -> list[Path]:
...
@@ -48,11 +48,11 @@ def find_output_files(workflow_path: Path) -> list[Path]:
def
heating_results
()
->
SimStadtResults
:
def
heating_results
()
->
SimStadtResults
:
output_files
=
[
output_files
=
[
TEST_REPOSITORY
TEST_REPOSITORY
/
"CGSC.proj/
101_
HeatDemand.flow/02_WeatherProcessor.step/hourly_GHI_DHI_Ta_meteonorm_Wuerzburg.prn"
,
/
"CGSC.proj/HeatDemand.flow/02_WeatherProcessor.step/hourly_GHI_DHI_Ta_meteonorm_Wuerzburg.prn"
,
TEST_REPOSITORY
TEST_REPOSITORY
/
"CGSC.proj/
101_
HeatDemand.flow/04_MonthlyEnergyBalance.step/Grombuehl_mini_Steinheilstrasse_DIN18599_HEATING.csv"
,
/
"CGSC.proj/HeatDemand.flow/04_MonthlyEnergyBalance.step/Grombuehl_mini_Steinheilstrasse_DIN18599_HEATING.csv"
,
TEST_REPOSITORY
TEST_REPOSITORY
/
"CGSC.proj/
101_
HeatDemand.flow/04_MonthlyEnergyBalance.step/Grombuehl_mini_Steinheilstrasse_DIN18599_HEATING.log"
,
/
"CGSC.proj/HeatDemand.flow/04_MonthlyEnergyBalance.step/Grombuehl_mini_Steinheilstrasse_DIN18599_HEATING.log"
,
]
]
return
create_simstadt_results
(
"Heat demand simulation for Grombühl"
,
output_files
)
return
create_simstadt_results
(
"Heat demand simulation for Grombühl"
,
output_files
)
...
@@ -159,7 +159,7 @@ def test_heating_repr(heating_results):
...
@@ -159,7 +159,7 @@ def test_heating_repr(heating_results):
def
heating_and_cooling_results
()
->
SimStadtResults
:
def
heating_and_cooling_results
()
->
SimStadtResults
:
return
create_simstadt_results
(
return
create_simstadt_results
(
"Heating and cooling demand simulation for Grombühl"
,
"Heating and cooling demand simulation for Grombühl"
,
find_output_files
(
PROJECT1_PATH
/
"
104_
HeatAndCoolDemand.flow"
),
find_output_files
(
PROJECT1_PATH
/
"HeatAndCoolDemand.flow"
),
)
)
...
@@ -196,7 +196,7 @@ def test_heating_and_cooling_diagrams(heating_and_cooling_results):
...
@@ -196,7 +196,7 @@ def test_heating_and_cooling_diagrams(heating_and_cooling_results):
def
cooling_results
()
->
SimStadtResults
:
def
cooling_results
()
->
SimStadtResults
:
return
create_simstadt_results
(
return
create_simstadt_results
(
"Cooling demand simulation for Grombühl"
,
"Cooling demand simulation for Grombühl"
,
find_output_files
(
PROJECT1_PATH
/
"
105_
CoolingDemand.flow"
),
find_output_files
(
PROJECT1_PATH
/
"CoolingDemand.flow"
),
)
)
...
@@ -224,9 +224,9 @@ def test_cooling_kpis(cooling_results):
...
@@ -224,9 +224,9 @@ def test_cooling_kpis(cooling_results):
def
greenwater_results
()
->
SimStadtResults
:
def
greenwater_results
()
->
SimStadtResults
:
output_files
=
[
output_files
=
[
TEST_REPOSITORY
TEST_REPOSITORY
/
"CGSC.proj/
102_
GreenWater.flow/02_WeatherProcessor.step/hourly_GHI_DHI_Ta_meteonorm_Wuerzburg.prn"
,
/
"CGSC.proj/GreenWater.flow/02_WeatherProcessor.step/hourly_GHI_DHI_Ta_meteonorm_Wuerzburg.prn"
,
TEST_REPOSITORY
TEST_REPOSITORY
/
"CGSC.proj/
102_
GreenWater.flow/03_GreenWater.step/Grombühl_mini_with_trees_greenwater.csv"
,
/
"CGSC.proj/GreenWater.flow/03_GreenWater.step/Grombühl_mini_with_trees_greenwater.csv"
,
]
]
return
create_simstadt_results
(
"Green Water simulation for Grombühl"
,
output_files
)
return
create_simstadt_results
(
"Green Water simulation for Grombühl"
,
output_files
)
...
@@ -345,9 +345,9 @@ def test_greenwater_repr(greenwater_results):
...
@@ -345,9 +345,9 @@ def test_greenwater_repr(greenwater_results):
def
pv_results
()
->
SimStadtResults
:
def
pv_results
()
->
SimStadtResults
:
output_files
=
[
output_files
=
[
TEST_REPOSITORY
TEST_REPOSITORY
/
"CGSC.proj/
103_
PV.flow/02_WeatherProcessor.step/hourly_GHI_DHI_Ta_meteonorm_Wuerzburg.prn"
,
/
"CGSC.proj/PV.flow/02_WeatherProcessor.step/hourly_GHI_DHI_Ta_meteonorm_Wuerzburg.prn"
,
TEST_REPOSITORY
TEST_REPOSITORY
/
"CGSC.proj/
103_
PV.flow/04_PhotovoltaicPotential.step/Grombühl_mini_with_trees_meteonorm_Hay_pv_potential.csv"
,
/
"CGSC.proj/PV.flow/04_PhotovoltaicPotential.step/Grombühl_mini_with_trees_meteonorm_Hay_pv_potential.csv"
,
]
]
return
create_simstadt_results
(
"PV for Grombühl"
,
output_files
)
return
create_simstadt_results
(
"PV for Grombühl"
,
output_files
)
...
@@ -435,9 +435,9 @@ def test_pv_no_log(pv_results):
...
@@ -435,9 +435,9 @@ def test_pv_no_log(pv_results):
def
test_greenwater_without_trees
():
def
test_greenwater_without_trees
():
output_files
=
[
output_files
=
[
TEST_REPOSITORY
TEST_REPOSITORY
/
"CGSC.proj/
102_
GreenWater.flow/02_WeatherProcessor.step/hourly_GHI_DHI_Ta_meteonorm_Wuerzburg.prn"
,
/
"CGSC.proj/GreenWater.flow/02_WeatherProcessor.step/hourly_GHI_DHI_Ta_meteonorm_Wuerzburg.prn"
,
TEST_REPOSITORY
TEST_REPOSITORY
/
"CGSC.proj/
102_
GreenWater.flow/03_GreenWater.step/Grombühl_mini_greenwater.csv"
,
/
"CGSC.proj/GreenWater.flow/03_GreenWater.step/Grombühl_mini_greenwater.csv"
,
]
]
results
=
create_simstadt_results
(
"Green Water without trees"
,
output_files
)
results
=
create_simstadt_results
(
"Green Water without trees"
,
output_files
)
with
pytest
.
raises
(
ValueError
,
match
=
"any tree"
):
with
pytest
.
raises
(
ValueError
,
match
=
"any tree"
):
...
@@ -614,9 +614,9 @@ def test_solar_repr(solar_results):
...
@@ -614,9 +614,9 @@ def test_solar_repr(solar_results):
def
test_broken_simulation
():
def
test_broken_simulation
():
output_files
=
[
output_files
=
[
TEST_REPOSITORY
TEST_REPOSITORY
/
"CGSC.proj/
103_
PV.flow/02_WeatherProcessor.step/notATable.log"
,
/
"CGSC.proj/PV.flow/02_WeatherProcessor.step/notATable.log"
,
TEST_REPOSITORY
TEST_REPOSITORY
/
"CGSC.proj/
103_
PV.flow/04_PhotovoltaicPotential.step/StillNotATable.png"
,
/
"CGSC.proj/PV.flow/04_PhotovoltaicPotential.step/StillNotATable.png"
,
]
]
results
=
create_simstadt_results
(
"FakeTests"
,
output_files
)
results
=
create_simstadt_results
(
"FakeTests"
,
output_files
)
with
pytest
.
raises
(
ValueError
,
match
=
"any .csv file"
):
with
pytest
.
raises
(
ValueError
,
match
=
"any .csv file"
):
...
...
tests/test_runner.py
View file @
1f5ddbf5
...
@@ -92,11 +92,11 @@ def test_citygml_creates_temp_repo(mock_simstadt):
...
@@ -92,11 +92,11 @@ def test_citygml_creates_temp_repo(mock_simstadt):
@
pytest
.
mark
.
integration
@
pytest
.
mark
.
integration
def
test_bundled_template_name_resolves_without_env_var
(
simstadt_folder
,
monkeypatch
,
tmp_path
):
def
test_bundled_template_name_resolves_without_env_var
(
simstadt_folder
,
monkeypatch
,
tmp_path
):
"""A bare bundled template name (e.g. "
103_
PV") resolves via get_template_path()'s
"""A bare bundled template name (e.g. "PV") resolves via get_template_path()'s
fallback to the package's own templates/ directory, even with no SIMSTADT_TEMPLATE_PATH
fallback to the package's own templates/ directory, even with no SIMSTADT_TEMPLATE_PATH
set — regression test for a real (non-mocked) SimStadt run."""
set — regression test for a real (non-mocked) SimStadt run."""
monkeypatch
.
delenv
(
"SIMSTADT_TEMPLATE_PATH"
,
raising
=
False
)
monkeypatch
.
delenv
(
"SIMSTADT_TEMPLATE_PATH"
,
raising
=
False
)
results
=
run_workflow_with_citygml
(
results
=
run_workflow_with_citygml
(
"
103_
PV"
,
CITYGML
,
project_path
=
tmp_path
/
"Test.proj"
"PV"
,
CITYGML
,
project_path
=
tmp_path
/
"Test.proj"
)
)
assert
any
(
kpi
.
name
==
"PV potential yield"
for
kpi
in
results
.
kpis
)
assert
any
(
kpi
.
name
==
"PV potential yield"
for
kpi
in
results
.
kpis
)
Prev
1
…
3
4
5
6
7
Next
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