Coverage for bim2sim/plugins/PluginTEASER/test/integration/test_teaser.py: 0%
156 statements
« prev ^ index » next coverage.py v7.6.12, created at 2025-03-12 17:09 +0000
« prev ^ index » next coverage.py v7.6.12, created at 2025-03-12 17:09 +0000
1import unittest
2from pathlib import Path
4import bim2sim
5from bim2sim.kernel.decision.console import ConsoleDecisionHandler
6from bim2sim.kernel.decision.decisionhandler import DebugDecisionHandler
7from bim2sim.utilities.test import IntegrationBase
8from bim2sim.utilities.types import LOD, IFCDomain, ZoningCriteria
11class IntegrationBaseTEASER(IntegrationBase):
12 def model_domain_path(self) -> str:
13 return 'arch'
16class TestIntegrationTEASER(IntegrationBaseTEASER, unittest.TestCase):
17 def test_run_kitoffice_spaces_medium_layers_low(self):
18 """Run project with AC20-Institute-Var-2.ifc"""
19 ifc_names = {IFCDomain.arch: 'AC20-Institute-Var-2.ifc'}
20 project = self.create_project(ifc_names, 'TEASER')
21 project.sim_settings.ahu_tz_overwrite = False
22 project.sim_settings.zoning_criteria = ZoningCriteria.all_criteria
23 answers = (2015,)
24 handler = DebugDecisionHandler(answers)
25 for decision, answer in handler.decision_answer_mapping(project.run()):
26 decision.value = answer
27 self.assertEqual(0, handler.return_value,
28 "Project did not finish successfully.")
30 def test_run_kitoffice_spaces_low_layers_low(self):
31 """Run project with AC20-Institute-Var-2.ifc"""
32 ifc_names = {IFCDomain.arch: 'AC20-Institute-Var-2.ifc'}
33 project = self.create_project(ifc_names, 'TEASER')
34 project.sim_settings.ahu_tz_overwrite = False
35 answers = (2015, )
36 handler = DebugDecisionHandler(answers)
37 for decision, answer in handler.decision_answer_mapping(project.run()):
38 decision.value = answer
39 self.assertEqual(0, handler.return_value,
40 "Project did not finish successfully.")
42 def test_DH_spaces_medium_material_low(self):
43 """Test DigitalHub IFC"""
44 ifc_names = {IFCDomain.arch: 'FM_ARC_DigitalHub_with_SB_neu.ifc'}
45 project = self.create_project(ifc_names, 'TEASER')
46 project.sim_settings.ahu_tz_overwrite = False
47 project.sim_settings.zoning_criteria = ZoningCriteria.all_criteria
48 project.sim_settings.prj_use_conditions = Path(
49 bim2sim.__file__).parent.parent / \
50 "test/resources/arch/custom_usages/" \
51 "UseConditionsFM_ARC_DigitalHub.json"
52 project.sim_settings.prj_custom_usages = Path(
53 bim2sim.__file__).parent.parent / \
54 "test/resources/arch/custom_usages/" \
55 "customUsagesFM_ARC_DigitalHub_with_SB_neu.json"
56 answers = ('Other', *(None,)*12, 2015)
57 handler = DebugDecisionHandler(answers)
58 for decision, answer in handler.decision_answer_mapping(project.run()):
59 decision.value = answer
60 self.assertEqual(0, handler.return_value,
61 "Project did not finish successfully.")
63 # @unittest.skip('Done in regression tests')
64 def test_run_kitfzkhaus_spaces_low_layers_low(self):
65 """Run project with AC20-FZK-Haus.ifc"""
66 ifc_names = {IFCDomain.arch: 'AC20-FZK-Haus.ifc'}
67 project = self.create_project(ifc_names, 'TEASER')
68 project.sim_settings.ahu_tz_overwrite = False
69 project.sim_settings.zoning_criteria = ZoningCriteria.combined_single_zone
70 answers = ()
71 handler = DebugDecisionHandler(answers)
72 for decision, answer in handler.decision_answer_mapping(project.run()):
73 decision.value = answer
74 self.assertEqual(0, handler.return_value,
75 "Project export did not finish successfully.")
77 @unittest.skip('skip layers_full test until new answers are created')
78 def test_ERC_Full(self):
79 """Test ERC Main Building"""
80 ifc_names = {IFCDomain.arch: 'ERC_Mainbuilding_Arch.ifc'}
81 project = self.create_project(ifc_names, 'TEASER')
82 project.sim_settings.ahu_tz_overwrite = False
83 project.sim_settings.zoning_criteria = ZoningCriteria.individual_spaces
84 project.sim_settings.layers_and_materials = LOD.full
85 answers = ("Kitchen in non-residential buildings",
86 "Library - reading room",
87 "MultiUseComputerRoom",
88 "Laboratory",
89 "Parking garages (office and private usage)",
90 "Stock, technical equipment, archives", True,
91 "Air_layer_DK", "perlite", True, "heavy", 1,
92 "beton", "Concrete_DK", "EnEv", 1, 0.3,
93 "beton", 1, "beton", 1, "beton", *(1,) * 8)
94 handler = DebugDecisionHandler(answers)
95 for decision, answer in handler.decision_answer_mapping(project.run()):
96 decision.value = answer
97 self.assertEqual(0, handler.return_value,
98 "Project did not finish successfully.")
100 @unittest.skip('Skip because takes to long in CI')
101 def test_ERC_Medium(self):
102 """Test ERC Main Building"""
103 ifc_names = {IFCDomain.arch: 'ERC_Mainbuilding_Arch.ifc'}
104 project = self.create_project(ifc_names, 'TEASER')
105 project.sim_settings.zoning_criteria = ZoningCriteria.all_criteria
106 answers = ()
107 handler = DebugDecisionHandler(answers)
108 for decision, answer in handler.decision_answer_mapping(project.run()):
109 decision.value = answer
110 self.assertEqual(0, handler.return_value,
111 "Project did not finish successfully.")
113 # @unittest.skip('Skip because takes to long in CI')
114 def test_ERC_Low(self):
115 """Test ERC Main Building"""
116 ifc_names = {IFCDomain.arch: 'ERC_Mainbuilding_Arch.ifc'}
117 project = self.create_project(ifc_names, 'TEASER')
118 project.sim_settings.ahu_tz_overwrite = False
119 answers = ()
120 handler = DebugDecisionHandler(answers)
121 for decision, answer in handler.decision_answer_mapping(project.run()):
122 decision.value = answer
123 self.assertEqual(0, handler.return_value,
124 "Project did not finish successfully.")
126 @unittest.skip('Skip because is covered in Regression tests')
127 def test_run_kitfzkhaus_spaces_medium_layers_low(self):
128 """Run project with AC20-FZK-Haus.ifc"""
129 ifc_names = {IFCDomain.arch: 'AC20-FZK-Haus.ifc'}
130 project = self.create_project(ifc_names, 'TEASER')
131 project.sim_settings.zoning_criteria = ZoningCriteria.all_criteria
132 answers = ()
133 handler = DebugDecisionHandler(answers)
134 for decision, answer in handler.decision_answer_mapping(project.run()):
135 decision.value = answer
136 self.assertEqual(0, handler.return_value,
137 "Project did not finish successfully.")
139 @unittest.skip('skip layers_full test until new answers are created')
140 def test_run_kitfzkhaus_spaces_medium_layers_full(self):
141 """Run project with AC20-FZK-Haus.ifc"""
142 ifc_names = {IFCDomain.arch: 'AC20-FZK-Haus.ifc'}
143 project = self.create_project(ifc_names, 'TEASER')
144 project.sim_settings.layers_and_materials = LOD.full
145 project.sim_settings.zoning_criteria = ZoningCriteria.all_criteria
146 answers = ('vertical_core_brick_700',
147 'solid_brick_h',)
148 handler = DebugDecisionHandler(answers)
149 for decision, answer in handler.decision_answer_mapping(project.run()):
150 decision.value = answer
151 self.assertEqual(0, handler.return_value,
152 "Project did not finish successfully.")
154 @unittest.skip('skip layers_full test until new answers are created')
155 def test_run_kitoffice_spaces_medium_layers_full(self):
156 """Run project with AC20-Institute-Var-2.ifc"""
157 ifc_names = {IFCDomain.arch: 'AC20-Institute-Var-2.ifc'}
158 project = self.create_project(ifc_names, 'TEASER')
159 project.sim_settings.layers_and_materials = LOD.full
160 project.sim_settings.zoning_criteria = ZoningCriteria.all_criteria
161 answers = (2015, 'concrete_CEM_II_BS325R_wz05', 'clay_brick',
162 'Concrete_DK',)
163 handler = DebugDecisionHandler(answers)
164 for decision, answer in handler.decision_answer_mapping(project.run()):
165 decision.value = answer
166 self.assertEqual(0, handler.return_value,
167 "Project did not finish successfully.")
169 @unittest.skip('skip layers_full test until new answers are created')
170 def test_run_kitfzkhaus_spaces_full_layers_full(self):
171 """Run project with AC20-FZK-Haus.ifc"""
172 ifc_names = {IFCDomain.arch: 'AC20-FZK-Haus.ifc'}
173 project = self.create_project(ifc_names, 'TEASER')
174 project.sim_settings.layers_and_materials = LOD.full
175 project.sim_settings.zoningCriteria = ZoningCriteria.individual_spaces
176 answers = (True, 'solid_brick_h', True, 'hardwood', True,
177 'Concrete_DK', True, 'Light_Concrete_DK',
178 'heavy', 1, 'Door', 1, 'Brick', 'solid_brick_h', 'EnEv',
179 *(1,) * 8)
180 handler = DebugDecisionHandler(answers)
181 for decision, answer in handler.decision_answer_mapping(project.run()):
182 decision.value = answer
183 self.assertEqual(0, handler.return_value,
184 "Project did not finish successfully.")
186 @unittest.skip('skip layers_full test until new answers are created')
187 def test_run_kitoffice_spaces_full_layers_full(self):
188 """Run project with AC20-Institute-Var-2.ifc"""
189 ifc_names = {IFCDomain.arch: 'AC20-Institute-Var-2.ifc'}
190 project = self.create_project(ifc_names, 'TEASER')
191 project.sim_settings.zoning_criteria = ZoningCriteria.individual_spaces
192 project.sim_settings.layers_and_materials = LOD.full
193 answers = ('Glas', True, 'glas_generic', 500, 1.5, 0.2,
194 True, 'air_layer', 'sandstone', True, 'lime_sandstone_1',
195 True, 'aluminium', 0.1, True, 'Concrete_DK', 2015,
196 "heavy", 1, 'Beton', 'Light_Concrete_DK', 1, 'Door', 1,
197 'Beton', 1, 'Beton', 1, 'fenster', 'Glas1995_2015Aluoder'
198 'StahlfensterWaermeschutzverglasungzweifach', 1, 'Door',
199 1, 'Beton', 1, 'Beton', *(1,) * 8)
200 handler = DebugDecisionHandler(answers)
201 for decision, answer in handler.decision_answer_mapping(project.run()):
202 decision.value = answer
203 self.assertEqual(0, handler.return_value,
204 "Project did not finish successfully.")
206 @unittest.skip('just available to console test')
207 def test_live_decisions(self):
208 ifc_names = {IFCDomain.arch: 'AC20-FZK-Haus.ifc'}
209 # ifc_names = {IFCDomain.arch: 'AC20-Institute-Var-2.ifc'
210 project = self.create_project(ifc_names, 'TEASER')
211 project.sim_settings.zoning_criteria = ZoningCriteria.individual_spaces
212 # answers = ('Glas', True, 'generic', 500, 1.5, 0.2,
213 # True, 'air_layer_DK', 'sandstone', True, 'lime',
214 # 'lime_sandstone_1', True, 'aluminium', 0.1, True,
215 # 'Concrete_DK', 2015, "heavy",
216 # 1, 'Beton', 'Light_Concrete_DK', 1, 'Door', 1, 'Beton', 1,
217 # 'Beton', 1, 'fenster', 'Glas1995_2015AluoderStahlfensterWaer'
218 # 'meschutzverglasungzweifach', 1,
219 # 'Door', 1, 'Beton', 1,
220 # 'Beton', *(1,) * 8)
221 answers_haus = ('Kitchen - preparations, storage', True,
222 'solid_brick_h', True, 'hard', 'hardwood', True,
223 'DKConcrete_DK', 'light', 'DK', 'heavy', 1, 'Door', 1,
224 'Brick', 'brick_H', 'EnEv', *(1,) * 8)
226 ConsoleDecisionHandler().handle(project.run(), project.loaded_decisions)
228 @unittest.skip("just with no internet test")
229 def test_run_kitfzkhaus_spaces_medium_layers_full_no_translator(self):
230 """Run project with AC20-FZK-Haus.ifc"""
231 ifc_names = {IFCDomain.arch: 'AC20-FZK-Haus.ifc'}
232 project = self.create_project(ifc_names, 'TEASER')
233 project.sim_settings.layers_and_materials = LOD.full
234 project.sim_settings.zoning_criteria = ZoningCriteria.all_criteria
235 answers = ('Kitchen - preparations, storage', True,
236 'solid_brick_h', True, None, 'wood', 'hardwood', 'concrete',
237 True, 'Concrete_DK', 'concrete', True, 'Light_Concrete_DK',
238 "heavy", 1, ' Door', 1, 'Brick', 'brick_H', "EnEv",
239 *(1,) * 8,)
240 ConsoleDecisionHandler().handle(project.run(), project.loaded_decisions)
242 handler = DebugDecisionHandler(answers)
243 for decision, answer in handler.decision_answer_mapping(project.run()):
244 decision.value = answer
245 self.assertEqual(0, handler.return_value,
246 "Project did not finish successfully.")