From 7778e72efd991f20bc5c17ab83b739128accf524 Mon Sep 17 00:00:00 2001 From: Hendrik van der Stok Date: Wed, 18 Dec 2024 11:40:22 +0100 Subject: [PATCH 1/2] add test of export only non-hydraulic system --- tests/test_besmod_output.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_besmod_output.py b/tests/test_besmod_output.py index 44661f067..25f4ff2ab 100644 --- a/tests/test_besmod_output.py +++ b/tests/test_besmod_output.py @@ -48,6 +48,8 @@ def test_export_besmod(self): with self.assertRaises(ValueError): prj.export_besmod(examples=examples) + prj.export_besmod(examples=["TEASERHeatLoadCalculation"]) + prj.export_besmod(examples=examples, THydSup_nominal=55 + 273.15) From 7e2d10b4ea274466e4f9e65d5802f18c40eaded1 Mon Sep 17 00:00:00 2001 From: Hendrik van der Stok Date: Wed, 18 Dec 2024 12:02:28 +0100 Subject: [PATCH 2/2] fix export of non-hydraulic system without THydSup_nominal --- teaser/data/output/besmod_output.py | 7 +++++++ tests/test_besmod_output.py | 1 + 2 files changed, 8 insertions(+) diff --git a/teaser/data/output/besmod_output.py b/teaser/data/output/besmod_output.py index ddf11c9d8..c7e29173b 100644 --- a/teaser/data/output/besmod_output.py +++ b/teaser/data/output/besmod_output.py @@ -1,6 +1,7 @@ """This module contains function for BESMod model generation""" import os +import warnings from typing import Optional, Union, List, Dict from mako.template import Template from mako.lookup import TemplateLookup @@ -103,6 +104,12 @@ def export_besmod( "Examples 'HeatPumpMonoenergetic' and 'GasBoilerBuildingOnly' " "require the `THydSup_nominal` parameter." ) + elif THydSup_nominal is None: + THydSup_nominal = 328.15 + if custom_examples: + warnings.warn("If you set THydSup_nominal in your custom examples template, " + "please provide it in the export. " + "Otherwise, the default value of 328.15 K will be used.") t_hyd_sup_nominal_bldg = convert_input(THydSup_nominal, buildings) t_hyd_sup_old_design_bldg = ( diff --git a/tests/test_besmod_output.py b/tests/test_besmod_output.py index 25f4ff2ab..102934dad 100644 --- a/tests/test_besmod_output.py +++ b/tests/test_besmod_output.py @@ -112,6 +112,7 @@ def test_export_besmod(self): THydSupOld_design=t_hyd_sup_nominal_old, custom_examples=custom_example_template, custom_script=custom_script) + prj.export_besmod(custom_examples=custom_example_template) def test_convert_heating_profile(self): """Test the conversion of heating profiles for BESMod"""