Commit 6e40942d authored by Eric Duminil's avatar Eric Duminil
Browse files

Allow meteonorm_filename to be None

parent 394cea67
...@@ -13,8 +13,11 @@ from .utils import remove_random_id, set_random_seed ...@@ -13,8 +13,11 @@ from .utils import remove_random_id, set_random_seed
BUNDLED_TEMPLATES = Path(__file__).parent / "templates" BUNDLED_TEMPLATES = Path(__file__).parent / "templates"
def _set_weather_file(meteonorm_filename: str) -> dict[str, str]: def _set_weather_file(meteonorm_filename: str | None) -> dict[str, str]:
"""Build the params.xml replacement for the weather file.""" """Build the params.xml replacement for the weather file."""
if meteonorm_filename is None:
# No meteonorm file has been specified, fall back to PVGIS
return {"<string>TMY3_HOURLY_FILE</string>": "<string>PVGIS_DATABASE</string>"}
return { return {
"<string>METEONORM_FILE</string>": f"<string>{Path(meteonorm_filename).name}</string>" "<string>METEONORM_FILE</string>": f"<string>{Path(meteonorm_filename).name}</string>"
} }
...@@ -33,7 +36,7 @@ def _set_refurbishment(geg_ratio: float) -> dict[str, str]: ...@@ -33,7 +36,7 @@ def _set_refurbishment(geg_ratio: float) -> dict[str, str]:
def photovoltaic_simulation( def photovoltaic_simulation(
citygml_path: Path | str, citygml_path: Path | str,
meteonorm_filename: str, meteonorm_filename: str | None = None,
roof_percentage: float = 100.0, roof_percentage: float = 100.0,
pv_share_flat: float = 40, pv_share_flat: float = 40,
pv_share_tilted: float = 50, pv_share_tilted: float = 50,
...@@ -79,7 +82,7 @@ def photovoltaic_simulation( ...@@ -79,7 +82,7 @@ def photovoltaic_simulation(
def heatdemand_simulation( def heatdemand_simulation(
citygml_path: Path | str, citygml_path: Path | str,
meteonorm_filename: str, meteonorm_filename: str | None = None,
with_shadows: bool = True, with_shadows: bool = True,
calculation_mode: str = "HEATING", calculation_mode: str = "HEATING",
refurbishment_ratio: float = 0.0, refurbishment_ratio: float = 0.0,
......
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