From 8b9408657a072ed301163d7cf73573c025140d6f Mon Sep 17 00:00:00 2001 From: MichaMans Date: Wed, 19 Dec 2018 16:24:47 +0100 Subject: [PATCH 1/2] #557 this should solve the wrong export --- .../buildingobjects/calculation/aixlib.py | 20 ++++++--- tests/test_data.py | 41 +++++++++++++++++++ 2 files changed, 55 insertions(+), 6 deletions(-) diff --git a/teaser/logic/buildingobjects/calculation/aixlib.py b/teaser/logic/buildingobjects/calculation/aixlib.py index 7f1190318..c67a391a5 100644 --- a/teaser/logic/buildingobjects/calculation/aixlib.py +++ b/teaser/logic/buildingobjects/calculation/aixlib.py @@ -373,13 +373,19 @@ def modelica_gains_boundary( for i, time in enumerate(time_line): if i == 0: - time.append(0) - time.append(0) - time.append(0) + time.append( + zone_count.use_conditions.profile_persons[i + 1]) + time.append( + zone_count.use_conditions.profile_machines[i + 1]) + time.append( + zone_count.use_conditions.profile_lighting[i + 1]) else: - time.append(zone_count.use_conditions.profile_persons[i - 1]) - time.append(zone_count.use_conditions.profile_machines[i - 1]) - time.append(zone_count.use_conditions.profile_lighting[i - 1]) + time.append( + zone_count.use_conditions.profile_persons[i - 1]) + time.append( + zone_count.use_conditions.profile_machines[i - 1]) + time.append( + zone_count.use_conditions.profile_lighting[i - 1]) internal_boundary = np.array(time_line) @@ -388,3 +394,5 @@ def modelica_gains_boundary( mdict={'Internals': internal_boundary}, appendmat=False, format='4') + + return internal_boundary diff --git a/tests/test_data.py b/tests/test_data.py index 59db8b468..d1dc63e83 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -3159,3 +3159,44 @@ def test_modelica_export_version(self): assert ideas.replace('v', '') == ibpsa.version['IDEAS'] except IndexError: warnings.warn('There was an index error for IDEAS', UserWarning) + + def test_type_bldg_residential_profiles(self): + """ + Verification of the type building generation of an office building. + Values are compared with TEASER3 values. + """ + from teaser.logic.archetypebuildings.bmvbs.singlefamilydwelling \ + import SingleFamilyDwelling + + prj.set_default() + test_residential = SingleFamilyDwelling(parent=prj, + name="TestBuilding", + year_of_construction=1988, + number_of_floors=3, + height_of_floors=3, + net_leased_area=2500) + + test_residential.generate_archetype() + + prj.calc_all_buildings() + + path_to_export = prj.export_aixlib( + internal_id=None, + path=None) + + from scipy.io import loadmat + file = loadmat(os.path.join( + path_to_export, + "TestBuilding", + "InternalGains_TestBuilding.mat")) + + use_cond = test_residential.thermal_zones[0].use_conditions + + assert (file['Internals'].transpose()[1][1:] == + use_cond.profile_persons).all() + + assert (file['Internals'].transpose()[2][1:] == + use_cond.profile_machines).all() + + assert (file['Internals'].transpose()[3][1:] == + use_cond.profile_lighting).all() From 718bb4b5c633db203107dd110c4fcb1f9e1b02af Mon Sep 17 00:00:00 2001 From: MichaMans Date: Wed, 19 Dec 2018 16:28:40 +0100 Subject: [PATCH 2/2] #557 raised version number because of bugfix --- README.md | 2 +- doc/conf.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f84943813..3d3615408 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ models for all libraries supporting the ## Version -TEASER is a ongoing research project, the current version is 0.6.5, which is +TEASER is a ongoing research project, the current version is 0.6.6, which is still a pre-release. ## How to use TEASER diff --git a/doc/conf.py b/doc/conf.py index 39406fc60..e633b5e95 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -60,7 +60,7 @@ # The short X.Y version. version = '0.6.' # The full version, including alpha/beta/rc tags. -release = '0.6.5' +release = '0.6.6' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.py b/setup.py index cdd0d3ed6..0c5aa0601 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup setup(name='teaser', - version='0.6.5', + version='0.6.6', description='Tool for Energy Analysis and Simulation for ' 'Efficient Retrofit ', url='https://github.com/RWTH-EBC/TEASER',