def test_create_shadowcalculation(self): pyidf.validation_level = ValidationLevel.error obj = ShadowCalculation() # alpha var_calculation_method = "AverageOverDaysInFrequency" obj.calculation_method = var_calculation_method # integer var_calculation_frequency = 1 obj.calculation_frequency = var_calculation_frequency # integer var_maximum_figures_in_shadow_overlap_calculations = 200 obj.maximum_figures_in_shadow_overlap_calculations = var_maximum_figures_in_shadow_overlap_calculations # alpha var_polygon_clipping_algorithm = "ConvexWeilerAtherton" obj.polygon_clipping_algorithm = var_polygon_clipping_algorithm # alpha var_sky_diffuse_modeling_algorithm = "SimpleSkyDiffuseModeling" obj.sky_diffuse_modeling_algorithm = var_sky_diffuse_modeling_algorithm idf = IDF() idf.add(obj) idf.save(self.path, check=False) with open(self.path, mode='r') as f: for line in f: log.debug(line.strip()) idf2 = IDF(self.path) self.assertEqual(idf2.shadowcalculations[0].calculation_method, var_calculation_method) self.assertEqual(idf2.shadowcalculations[0].calculation_frequency, var_calculation_frequency) self.assertEqual(idf2.shadowcalculations[0].maximum_figures_in_shadow_overlap_calculations, var_maximum_figures_in_shadow_overlap_calculations) self.assertEqual(idf2.shadowcalculations[0].polygon_clipping_algorithm, var_polygon_clipping_algorithm) self.assertEqual(idf2.shadowcalculations[0].sky_diffuse_modeling_algorithm, var_sky_diffuse_modeling_algorithm)
def test_create_shadowcalculation(self): pyidf.validation_level = ValidationLevel.error obj = ShadowCalculation() # alpha var_calculation_method = "AverageOverDaysInFrequency" obj.calculation_method = var_calculation_method # integer var_calculation_frequency = 1 obj.calculation_frequency = var_calculation_frequency # integer var_maximum_figures_in_shadow_overlap_calculations = 200 obj.maximum_figures_in_shadow_overlap_calculations = var_maximum_figures_in_shadow_overlap_calculations # alpha var_polygon_clipping_algorithm = "ConvexWeilerAtherton" obj.polygon_clipping_algorithm = var_polygon_clipping_algorithm # alpha var_sky_diffuse_modeling_algorithm = "SimpleSkyDiffuseModeling" obj.sky_diffuse_modeling_algorithm = var_sky_diffuse_modeling_algorithm idf = IDF() idf.add(obj) idf.save(self.path, check=False) with open(self.path, mode='r') as f: for line in f: log.debug(line.strip()) idf2 = IDF(self.path) self.assertEqual(idf2.shadowcalculations[0].calculation_method, var_calculation_method) self.assertEqual(idf2.shadowcalculations[0].calculation_frequency, var_calculation_frequency) self.assertEqual( idf2.shadowcalculations[0]. maximum_figures_in_shadow_overlap_calculations, var_maximum_figures_in_shadow_overlap_calculations) self.assertEqual(idf2.shadowcalculations[0].polygon_clipping_algorithm, var_polygon_clipping_algorithm) self.assertEqual( idf2.shadowcalculations[0].sky_diffuse_modeling_algorithm, var_sky_diffuse_modeling_algorithm)
idf.add(obj3) obj4 = SurfaceConvectionAlgorithmInside() obj4.algorithm = "TARP" idf.add(obj4) obj5 = SurfaceConvectionAlgorithmOutside() obj5.algorithm = "TARP" idf.add(obj5) obj6 = HeatBalanceAlgorithm() obj6.algorithm = "ConductionTransferFunction" idf.add(obj6) obj7 = ShadowCalculation() obj7.calculation_method = "AverageOverDaysInFrequency" obj7.calculation_frequency = 20 idf.add(obj7) obj8 = SimulationControl() obj8.do_zone_sizing_calculation = "No" obj8.do_system_sizing_calculation = "No" obj8.do_plant_sizing_calculation = "No" obj8.run_simulation_for_sizing_periods = "Yes" obj8.run_simulation_for_weather_file_run_periods = "No" idf.add(obj8) obj9 = SiteLocation() obj9.name = "CHICAGO_IL_USA TMY2-94846" obj9.latitude = 41.78 obj9.longitude = -87.75