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
df5c5b57
Commit
df5c5b57
authored
Mar 16, 2026
by
Eric Duminil
Browse files
Return version and date
parent
6947ca38
Changes
3
Show whitespace changes
Inline
Side-by-side
src/simstadt/__init__.py
View file @
df5c5b57
...
...
@@ -8,27 +8,28 @@ from .results import (
SolarPotentialResults
,
create_simstadt_results
,
)
from
.runner
import
run_workflow_with_citygml
,
run_regionchooser
from
.runner
import
run_workflow_with_citygml
,
run_regionchooser
,
get_version_and_date
from
.utils
import
clean_old_workflows
from
.workflows
import
greenwater_simulation
,
heatdemand_simulation
,
photovoltaic_simulation
# TODO: Define Template class, with already defined Workflows?
__all__
=
[
"KPI"
,
"SimStadtResults"
,
"GreenWaterResults"
,
"HeatDemandResults"
,
"KPI"
,
"LoadProfileResults"
,
"PhotovoltaicResults"
,
"
GreenWater
Results"
,
"
SimStadt
Results"
,
"SolarPotentialResults"
,
"create_simstadt_results"
,
"clean_old_workflows"
,
"run_workflow_with_citygml"
,
"run_regionchooser"
,
"photovoltaic_simulation"
,
"heatdemand_simulation"
,
"create_simstadt_results"
,
"get_version_and_date"
,
"greenwater_simulation"
,
"heatdemand_simulation"
,
"photovoltaic_simulation"
,
"run_regionchooser"
,
"run_workflow_with_citygml"
,
]
...
...
src/simstadt/runner.py
View file @
df5c5b57
...
...
@@ -67,6 +67,14 @@ def get_template_path() -> Path:
"No template path found. Set SIMSTADT_TEMPLATE_PATH or create a templates/ directory."
)
def
get_version_and_date
()
->
tuple
[
str
,
str
]:
SIMSTADT_VERSION_FORMAT
=
re
.
compile
(
r
"Launching SimStadt (\S+) \((\w+), rev. (\w+), (\d+)\)"
)
output
=
get_simstadt_output
(
get_simstadt_folder
())
m
=
SIMSTADT_VERSION_FORMAT
.
search
(
output
)
if
not
m
:
raise
ValueError
(
f
"No SimStadt version string found in output:
\n
{
output
}
"
)
version
,
_branch
,
_commit
,
date
=
m
.
groups
()
return
version
,
date
# ---------------------------------------------------------------------------
# Low-level workflow helpers
...
...
tests/test_version.py
View file @
df5c5b57
...
...
@@ -4,7 +4,7 @@ import re
import
pytest
from
simstadt
.runner
import
get_
simstadt_output
from
simstadt
import
get_
version_and_date
SIMSTADT_MIN_VERSION
=
"0.14.0"
SIMSTADT_MIN_DATE
=
"20250701"
...
...
@@ -14,11 +14,7 @@ SIMSTADT_VERSION_FORMAT = re.compile(r"Launching SimStadt (\S+) \((\w+), rev. (\
@
pytest
.
mark
.
integration
def
test_version
(
simstadt_folder
):
output
=
get_simstadt_output
(
simstadt_folder
)
m
=
SIMSTADT_VERSION_FORMAT
.
search
(
output
)
if
not
m
:
pytest
.
fail
(
f
"No SimStadt version string found in output:
\n
{
output
}
"
)
version
,
_branch
,
_commit
,
date
=
m
.
groups
()
version
,
date
=
get_version_and_date
()
assert
version
>=
SIMSTADT_MIN_VERSION
,
(
f
"SimStadt version
{
version
}
is older than required
{
SIMSTADT_MIN_VERSION
}
.
\n
"
"https://simstadt.hft-stuttgart.de/download/InstallFiles/SimStadt2_latest.zip"
...
...
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