Commit db9f4b15 authored by Eric Duminil's avatar Eric Duminil
Browse files

Added log

parent 8adda141
......@@ -93,7 +93,7 @@ simstadt --install
simstadt --gui
# Run a workflow from the command line
simstadt HeatDemandWithShadow path/to/city.gml -v
simstadt HeatDemandWithShadow.flow path/to/city.gml -v
# Save results to CSV or JSON
simstadt PVWithShadow path/to/city.gml --save results.csv
......@@ -102,7 +102,7 @@ simstadt PVWithShadow path/to/city.gml --save results.csv
simstadt HeatDemand path/to/city.gml --save results.csv
# List output files
simstadt HeatDemand path/to/city.gml --files
simstadt HeatDemand.flow path/to/city.gml --files
# Debug information
simstadt PV path/to/city.gml --verbose
......
......@@ -111,7 +111,7 @@ def build_parser() -> argparse.ArgumentParser:
parser.add_argument(
"template",
nargs="?",
help="Template name (from SIMSTADT_TEMPLATE_PATH) or path to a .flow directory.",
help="Template name (from SIMSTADT_TEMPLATE_PATH), path to a .flow directory, or a bundled template name.",
)
parser.add_argument(
"citygml", nargs="?", type=Path, help="Path to the CityGML input file."
......
......@@ -66,10 +66,12 @@ def get_template_path() -> Path:
local_templates = Path.cwd() / "templates"
if local_templates.exists():
return local_templates
bundled = Path(__file__).parent / "templates"
if bundled.exists():
bundled_templates = Path(__file__).parent / "templates"
if bundled_templates.exists():
log.info("SIMSTADT_TEMPLATE_PATH undefined, and templates/ not present. Trying bundled templates.")
return bundled
for template in bundled_templates.glob("*.flow"):
log.debug("Available template : %s", template.name)
return bundled_templates
raise ValueError(
"No template path found. Set SIMSTADT_TEMPLATE_PATH or create a templates/ directory."
)
......
Supports Markdown
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