Exemplo n.º 1
0
def test_lighting_dict_methods():
    """Test the to/from dict methods."""
    ideal_air = IdealAirSystem(sensible_heat_recovery=0.75,
                               latent_heat_recovery=0.6)

    hvac_dict = ideal_air.to_dict()
    new_ideal_air = IdealAirSystem.from_dict(hvac_dict)
    assert new_ideal_air == ideal_air
    assert hvac_dict == new_ideal_air.to_dict()
Exemplo n.º 2
0
def test_ideal_air_system_equality():
    """Test the equality of IdealAirSystem objects."""
    ideal_air = IdealAirSystem()
    ideal_air_dup = ideal_air.duplicate()
    ideal_air_alt = IdealAirSystem(sensible_heat_recovery=0.75,
                                   latent_heat_recovery=0.6)

    assert ideal_air is ideal_air
    assert ideal_air is not ideal_air_dup
    assert ideal_air == ideal_air_dup
    ideal_air_dup.sensible_heat_recovery = 0.6
    assert ideal_air != ideal_air_dup
    assert ideal_air != ideal_air_alt
Exemplo n.º 3
0
def test_ideal_air_lockability():
    """Test the lockability of IdealAirSystem objects."""
    ideal_air = IdealAirSystem()

    ideal_air.sensible_heat_recovery = 0.6
    ideal_air.lock()
    with pytest.raises(AttributeError):
        ideal_air.sensible_heat_recovery = 0.75
    ideal_air.unlock()
    ideal_air.sensible_heat_recovery = 0.75
Exemplo n.º 4
0
def test_energy_properties():
    """Test the existence of the Model energy properties."""
    room = Room.from_box('Tiny House Zone', 5, 10, 3)
    room.properties.energy.program_type = office_program
    room.properties.energy.hvac = IdealAirSystem()
    south_face = room[3]
    south_face.apertures_by_ratio(0.4, 0.01)
    south_face.apertures[0].overhang(0.5, indoor=False)
    south_face.apertures[0].overhang(0.5, indoor=True)
    south_face.apertures[0].move_shades(Vector3D(0, 0, -0.5))
    fritted_glass_trans = ScheduleRuleset.from_constant_value(
        'Fritted Glass', 0.5, schedule_types.fractional)
    south_face.apertures[0].outdoor_shades[0].properties.energy.transmittance_schedule = \
        fritted_glass_trans
    model = Model('Tiny House', [room])

    assert hasattr(model.properties, 'energy')
    assert isinstance(model.properties.energy, ModelEnergyProperties)
    assert isinstance(model.properties.host, Model)
    assert len(model.properties.energy.materials) == 15
    for mat in model.properties.energy.materials:
        assert isinstance(mat, _EnergyMaterialBase)
    assert len(model.properties.energy.constructions) == 14
    for cnst in model.properties.energy.constructions:
        assert isinstance(
            cnst, (WindowConstruction, OpaqueConstruction, ShadeConstruction))
    assert len(model.properties.energy.face_constructions) == 0
    assert len(model.properties.energy.construction_sets) == 0
    assert isinstance(model.properties.energy.global_construction_set,
                      ConstructionSet)
    assert len(model.properties.energy.schedule_type_limits) == 3
    assert len(model.properties.energy.schedules) == 8
    assert len(model.properties.energy.shade_schedules) == 1
    assert len(model.properties.energy.room_schedules) == 0
    assert len(model.properties.energy.program_types) == 1
Exemplo n.º 5
0
def test_check_duplicate_schedule_type_limit_names():
    """Test the check_duplicate_schedule_type_limit_names method."""
    room = Room.from_box('Tiny House Zone', 5, 10, 3)
    room.properties.energy.program_type = office_program
    room.properties.energy.hvac = IdealAirSystem()
    south_face = room[3]
    south_face.apertures_by_ratio(0.4, 0.01)
    south_face.apertures[0].overhang(0.5, indoor=False)
    south_face.apertures[0].overhang(0.5, indoor=True)
    south_face.apertures[0].move_shades(Vector3D(0, 0, -0.5))
    fritted_glass_trans = ScheduleRuleset.from_constant_value(
        'Fritted Glass', 0.6, schedule_types.fractional)
    on_off = ScheduleTypeLimit('On-off', 0, 1, 'Discrete')
    full_occ = ScheduleRuleset.from_constant_value('Occupied', 1, on_off)
    south_face.apertures[0].outdoor_shades[0].properties.energy.transmittance_schedule = \
        fritted_glass_trans
    room.properties.energy.people = People('Office Occ', 0.05, full_occ)
    model = Model('Tiny House', [room])

    assert model.properties.energy.check_duplicate_schedule_type_limit_names(
        False)
    full_occ.unlock()
    new_sch_type = ScheduleTypeLimit('Fractional', 0, 1, 'Discrete')
    full_occ.schedule_type_limit = new_sch_type
    full_occ.lock()
    assert not model.properties.energy.check_duplicate_schedule_type_limit_names(
        False)
    with pytest.raises(ValueError):
        model.properties.energy.check_duplicate_schedule_type_limit_names(True)
Exemplo n.º 6
0
def test_ideal_air_system_init():
    """Test the initialization of IdealAirSystem and basic properties."""
    ideal_air = IdealAirSystem()
    str(ideal_air)  # test the string representation

    assert ideal_air.heating_limit == 'autosize'
    assert ideal_air.cooling_limit == 'autosize'
    assert ideal_air.economizer_type == 'DifferentialDryBulb'
    assert not ideal_air.demand_controlled_ventilation
    assert ideal_air.sensible_heat_recovery == 0
    assert ideal_air.latent_heat_recovery == 0
Exemplo n.º 7
0
def test_ideal_air_system_setability():
    """Test the setting of properties of IdealAirSystem."""
    ideal_air = IdealAirSystem()

    ideal_air.heating_limit = 1000
    assert ideal_air.heating_limit == 1000
    ideal_air.cooling_limit = 2000
    assert ideal_air.cooling_limit == 2000
    ideal_air.economizer_type = 'DifferentialEnthalpy'
    assert ideal_air.economizer_type == 'DifferentialEnthalpy'
    ideal_air.sensible_heat_recovery = 0.75
    assert ideal_air.sensible_heat_recovery == 0.75
    ideal_air.latent_heat_recovery = 0.65
    assert ideal_air.latent_heat_recovery == 0.65
Exemplo n.º 8
0
def test_writer_to_idf():
    """Test the Room to_idf method."""
    room = Room.from_box('ClosedOffice', 5, 10, 3)
    room.properties.energy.program_type = office_program
    room.properties.energy.hvac = IdealAirSystem()

    assert hasattr(room.to, 'idf')
    idf_string = room.to.idf(room)
    assert 'ClosedOffice,' in idf_string
    assert 'Zone,' in idf_string
    assert 'People' in idf_string
    assert 'Lights' in idf_string
    assert 'ElectricEquipment' in idf_string
    assert 'GasEquipment' not in idf_string
    assert 'ZoneInfiltration:DesignFlowRate' in idf_string
    assert 'DesignSpecification:OutdoorAir' in idf_string
    assert 'HVACTemplate:Thermostat' in idf_string
    assert 'HVACTemplate:Zone:IdealLoadsAirSystem' in idf_string
Exemplo n.º 9
0
def test_energy_properties():
    """Test the existence of the Room energy properties."""
    room = Room.from_box('Shoe Box', 5, 10, 3, 90, Point3D(0, 0, 3))
    room.properties.energy.program_type = office_program
    room.properties.energy.hvac = IdealAirSystem()

    assert hasattr(room.properties, 'energy')
    assert isinstance(room.properties.energy, RoomEnergyProperties)
    assert isinstance(room.properties.energy.construction_set, ConstructionSet)
    assert isinstance(room.properties.energy.program_type, ProgramType)
    assert isinstance(room.properties.energy.hvac, IdealAirSystem)
    assert room.properties.energy.program_type == office_program
    assert room.properties.energy.is_conditioned
    assert room.properties.energy.people == office_program.people
    assert room.properties.energy.lighting == office_program.lighting
    assert room.properties.energy.electric_equipment == office_program.electric_equipment
    assert room.properties.energy.gas_equipment == office_program.gas_equipment
    assert room.properties.energy.infiltration == office_program.infiltration
    assert room.properties.energy.ventilation == office_program.ventilation
    assert room.properties.energy.setpoint == office_program.setpoint
Exemplo n.º 10
0
def test_ideal_air_init_from_idf():
    """Test the initialization of IdealAirSystem from_idf."""
    ideal_air = IdealAirSystem()
    zone_name = 'ShoeBox'
    room = Room.from_box(zone_name, 5, 10, 3, 90, Point3D(0, 0, 3))
    heat_setpt = ScheduleRuleset.from_constant_value(
        'Office Heating', 21, schedule_types.temperature)
    cool_setpt = ScheduleRuleset.from_constant_value(
        'Office Cooling', 24, schedule_types.temperature)
    setpoint = Setpoint('Office Setpoint', heat_setpt, cool_setpt)

    with pytest.raises(AssertionError):
        ideal_air.to_idf()

    room.properties.energy.hvac = ideal_air
    with pytest.raises(AssertionError):
        ideal_air.to_idf()

    room.properties.energy.setpoint = setpoint
    idf_str = ideal_air.to_idf()
    rebuilt_ideal_air, rebuilt_zone_name = IdealAirSystem.from_idf(idf_str)
    assert ideal_air == rebuilt_ideal_air
    assert zone_name == rebuilt_zone_name
Exemplo n.º 11
0
def test_to_dict_multizone_house():
    """Test the Model to_dict method with a multi-zone house."""
    first_floor = Room.from_box('First Floor',
                                10,
                                10,
                                3,
                                origin=Point3D(0, 0, 0))
    second_floor = Room.from_box('Second Floor',
                                 10,
                                 10,
                                 3,
                                 origin=Point3D(0, 0, 3))
    first_floor.properties.energy.program_type = office_program
    second_floor.properties.energy.program_type = office_program
    first_floor.properties.energy.hvac = IdealAirSystem()
    second_floor.properties.energy.hvac = IdealAirSystem()
    for face in first_floor[1:5]:
        face.apertures_by_ratio(0.2, 0.01)
    for face in second_floor[1:5]:
        face.apertures_by_ratio(0.2, 0.01)

    pts_1 = [
        Point3D(0, 0, 6),
        Point3D(0, 10, 6),
        Point3D(10, 10, 6),
        Point3D(10, 0, 6)
    ]
    pts_2 = [
        Point3D(0, 0, 6),
        Point3D(5, 0, 9),
        Point3D(5, 10, 9),
        Point3D(0, 10, 6)
    ]
    pts_3 = [
        Point3D(10, 0, 6),
        Point3D(10, 10, 6),
        Point3D(5, 10, 9),
        Point3D(5, 0, 9)
    ]
    pts_4 = [Point3D(0, 0, 6), Point3D(10, 0, 6), Point3D(5, 0, 9)]
    pts_5 = [Point3D(10, 10, 6), Point3D(0, 10, 6), Point3D(5, 10, 9)]
    face_1 = Face('Attic Face 1', Face3D(pts_1))
    face_2 = Face('Attic Face 2', Face3D(pts_2))
    face_3 = Face('Attic Face 3', Face3D(pts_3))
    face_4 = Face('Attic Face 4', Face3D(pts_4))
    face_5 = Face('Attic Face 5', Face3D(pts_5))
    attic = Room('Attic', [face_1, face_2, face_3, face_4, face_5], 0.01, 1)

    constr_set = ConstructionSet('Attic Construction Set')
    polyiso = EnergyMaterial('PolyIso', 0.2, 0.03, 43, 1210, 'MediumRough')
    roof_constr = OpaqueConstruction('Attic Roof Construction',
                                     [roof_membrane, polyiso, wood])
    floor_constr = OpaqueConstruction('Attic Floor Construction',
                                      [wood, insulation, wood])
    constr_set.floor_set.interior_construction = floor_constr
    constr_set.roof_ceiling_set.exterior_construction = roof_constr
    attic.properties.energy.construction_set = constr_set

    Room.solve_adjcency([first_floor, second_floor, attic], 0.01)

    model = Model('Multi Zone Single Family House',
                  [first_floor, second_floor, attic])
    model_dict = model.to_dict()

    assert 'energy' in model_dict['properties']
    assert 'materials' in model_dict['properties']['energy']
    assert 'constructions' in model_dict['properties']['energy']
    assert 'construction_sets' in model_dict['properties']['energy']
    assert 'global_construction_set' in model_dict['properties']['energy']

    assert len(model_dict['properties']['energy']['materials']) == 16
    assert len(model_dict['properties']['energy']['constructions']) == 16
    assert len(model_dict['properties']['energy']['construction_sets']) == 2

    assert model_dict['rooms'][0]['faces'][5]['boundary_condition'][
        'type'] == 'Surface'
    assert model_dict['rooms'][1]['faces'][0]['boundary_condition'][
        'type'] == 'Surface'
    assert model_dict['rooms'][1]['faces'][5]['boundary_condition'][
        'type'] == 'Surface'
    assert model_dict['rooms'][2]['faces'][0]['boundary_condition'][
        'type'] == 'Surface'

    assert model_dict['rooms'][2]['properties']['energy']['construction_set'] == \
        constr_set.name

    assert model_dict['rooms'][0]['properties']['energy']['program_type'] == \
        model_dict['rooms'][1]['properties']['energy']['program_type'] == \
        office_program.name
    assert model_dict['rooms'][0]['properties']['energy']['hvac'] == \
        model_dict['rooms'][1]['properties']['energy']['hvac'] == \
        IdealAirSystem().to_dict()
    """
Exemplo n.º 12
0
def test_to_dict_single_zone():
    """Test the Model to_dict method with a single zone model."""
    room = Room.from_box('Tiny House Zone', 5, 10, 3)
    room.properties.energy.program_type = office_program
    room.properties.energy.hvac = IdealAirSystem()

    stone = EnergyMaterial('Thick Stone', 0.3, 2.31, 2322, 832, 'Rough', 0.95,
                           0.75, 0.8)
    thermal_mass_constr = OpaqueConstruction('Thermal Mass Floor', [stone])
    room[0].properties.energy.construction = thermal_mass_constr

    south_face = room[3]
    south_face.apertures_by_ratio(0.4, 0.01)
    south_face.apertures[0].overhang(0.5, indoor=False)
    south_face.apertures[0].overhang(0.5, indoor=True)
    south_face.move_shades(Vector3D(0, 0, -0.5))
    light_shelf_out = ShadeConstruction('Outdoor Light Shelf', 0.5, 0.5)
    light_shelf_in = ShadeConstruction('Indoor Light Shelf', 0.7, 0.7)
    south_face.apertures[0].outdoor_shades[
        0].properties.energy.construction = light_shelf_out
    south_face.apertures[0].indoor_shades[
        0].properties.energy.construction = light_shelf_in

    north_face = room[1]
    north_face.overhang(0.25, indoor=False)
    door_verts = [
        Point3D(2, 10, 0.1),
        Point3D(1, 10, 0.1),
        Point3D(1, 10, 2.5),
        Point3D(2, 10, 2.5)
    ]
    door = Door('Front Door', Face3D(door_verts))
    north_face.add_door(door)

    aperture_verts = [
        Point3D(4.5, 10, 1),
        Point3D(2.5, 10, 1),
        Point3D(2.5, 10, 2.5),
        Point3D(4.5, 10, 2.5)
    ]
    aperture = Aperture('Front Aperture', Face3D(aperture_verts))
    triple_pane = WindowConstruction(
        'Triple Pane Window',
        [clear_glass, air_gap, clear_glass, air_gap, clear_glass])
    aperture.properties.energy.construction = triple_pane
    north_face.add_aperture(aperture)

    tree_canopy_geo = Face3D.from_regular_polygon(
        6, 2, Plane(Vector3D(0, 0, 1), Point3D(5, -3, 4)))
    tree_canopy = Shade('Tree Canopy', tree_canopy_geo)

    table_geo = Face3D.from_rectangle(2, 2, Plane(o=Point3D(1.5, 4, 1)))
    table = Shade('Table', table_geo)
    room.add_indoor_shade(table)

    model = Model('Tiny House', [room], orphaned_shades=[tree_canopy])
    model.north_angle = 15

    model_dict = model.to_dict()

    assert 'energy' in model_dict['properties']
    assert 'materials' in model_dict['properties']['energy']
    assert 'constructions' in model_dict['properties']['energy']
    assert 'construction_sets' in model_dict['properties']['energy']
    assert 'global_construction_set' in model_dict['properties']['energy']

    assert len(model_dict['properties']['energy']['materials']) == 16
    assert len(model_dict['properties']['energy']['constructions']) == 18
    assert len(model_dict['properties']['energy']['construction_sets']) == 1

    assert model_dict['rooms'][0]['faces'][0]['properties']['energy']['construction'] == \
        thermal_mass_constr.name
    south_ap_dict = model_dict['rooms'][0]['faces'][3]['apertures'][0]
    assert south_ap_dict['outdoor_shades'][0]['properties']['energy']['construction'] == \
        light_shelf_out.name
    assert south_ap_dict['indoor_shades'][0]['properties']['energy']['construction'] == \
        light_shelf_in.name
    assert model_dict['rooms'][0]['faces'][1]['apertures'][0]['properties']['energy']['construction'] == \
        triple_pane.name

    assert model_dict['rooms'][0]['properties']['energy']['program_type'] == \
        office_program.name
    assert model_dict['rooms'][0]['properties']['energy']['hvac'] == \
        IdealAirSystem().to_dict()
    """
Exemplo n.º 13
0
def test_to_from_dict():
    """Test the Model to_dict and from_dict method with a single zone model."""
    room = Room.from_box('Tiny House Zone', 5, 10, 3)
    room.properties.energy.program_type = office_program
    room.properties.energy.hvac = IdealAirSystem()

    stone = EnergyMaterial('Thick Stone', 0.3, 2.31, 2322, 832, 'Rough', 0.95,
                           0.75, 0.8)
    thermal_mass_constr = OpaqueConstruction('Thermal Mass Floor', [stone])
    room[0].properties.energy.construction = thermal_mass_constr

    south_face = room[3]
    south_face.apertures_by_ratio(0.4, 0.01)
    south_face.apertures[0].overhang(0.5, indoor=False)
    south_face.apertures[0].overhang(0.5, indoor=True)
    south_face.apertures[0].move_shades(Vector3D(0, 0, -0.5))
    light_shelf_out = ShadeConstruction('Outdoor Light Shelf', 0.5, 0.5)
    light_shelf_in = ShadeConstruction('Indoor Light Shelf', 0.7, 0.7)
    south_face.apertures[0].shades[
        0].properties.energy.construction = light_shelf_out
    south_face.apertures[0].shades[
        1].properties.energy.construction = light_shelf_in

    north_face = room[1]
    door_verts = [
        Point3D(2, 10, 0.1),
        Point3D(1, 10, 0.1),
        Point3D(1, 10, 2.5),
        Point3D(2, 10, 2.5)
    ]
    door = Door('Front Door', Face3D(door_verts))
    north_face.add_door(door)

    aperture_verts = [
        Point3D(4.5, 10, 1),
        Point3D(2.5, 10, 1),
        Point3D(2.5, 10, 2.5),
        Point3D(4.5, 10, 2.5)
    ]
    aperture = Aperture('Front Aperture', Face3D(aperture_verts))
    aperture.is_operable = True
    triple_pane = WindowConstruction(
        'Triple Pane Window',
        [clear_glass, air_gap, clear_glass, air_gap, clear_glass])
    aperture.properties.energy.construction = triple_pane
    north_face.add_aperture(aperture)

    tree_canopy_geo = Face3D.from_regular_polygon(
        6, 2, Plane(Vector3D(0, 0, 1), Point3D(5, -3, 4)))
    tree_canopy = Shade('Tree Canopy', tree_canopy_geo)
    tree_trans = ScheduleRuleset.from_constant_value('Tree Transmittance',
                                                     0.75,
                                                     schedule_types.fractional)
    tree_canopy.properties.energy.transmittance_schedule = tree_trans

    model = Model('Tiny House', [room], orphaned_shades=[tree_canopy])
    model.north_angle = 15
    model_dict = model.to_dict()
    new_model = Model.from_dict(model_dict)
    assert model_dict == new_model.to_dict()

    assert stone in new_model.properties.energy.materials
    assert thermal_mass_constr in new_model.properties.energy.constructions
    assert new_model.rooms[0][
        0].properties.energy.construction == thermal_mass_constr
    assert new_model.rooms[0][3].apertures[0].indoor_shades[
        0].properties.energy.construction == light_shelf_in
    assert new_model.rooms[0][3].apertures[0].outdoor_shades[
        0].properties.energy.construction == light_shelf_out
    assert triple_pane in new_model.properties.energy.constructions
    assert new_model.rooms[0][1].apertures[
        0].properties.energy.construction == triple_pane
    assert new_model.rooms[0][1].apertures[0].is_operable
    assert len(new_model.orphaned_shades) == 1
    assert new_model.north_angle == 15

    assert new_model.rooms[0][0].type == face_types.floor
    assert new_model.rooms[0][1].type == face_types.wall
    assert isinstance(new_model.rooms[0][0].boundary_condition, Ground)
    assert isinstance(new_model.rooms[0][1].boundary_condition, Outdoors)

    assert new_model.rooms[0].properties.energy.program_type == office_program
    assert len(new_model.properties.energy.schedule_type_limits) == 3
    assert len(model.properties.energy.schedules) == 8
    assert new_model.rooms[0].properties.energy.is_conditioned
    assert new_model.rooms[0].properties.energy.hvac == IdealAirSystem()

    assert new_model.orphaned_shades[
        0].properties.energy.transmittance_schedule == tree_trans
Exemplo n.º 14
0
def test_writer_to_idf():
    """Test the Model to.idf method."""
    room = Room.from_box('Tiny House Zone', 5, 10, 3)
    room.properties.energy.program_type = office_program
    room.properties.energy.hvac = IdealAirSystem()

    stone = EnergyMaterial('Thick Stone', 0.3, 2.31, 2322, 832, 'Rough', 0.95,
                           0.75, 0.8)
    thermal_mass_constr = OpaqueConstruction('Thermal Mass Floor', [stone])
    room[0].properties.energy.construction = thermal_mass_constr

    south_face = room[3]
    south_face.apertures_by_ratio(0.4, 0.01)
    south_face.apertures[0].overhang(0.5, indoor=False)
    south_face.apertures[0].overhang(0.5, indoor=True)
    south_face.move_shades(Vector3D(0, 0, -0.5))
    light_shelf_out = ShadeConstruction('Outdoor Light Shelf', 0.5, 0.5)
    light_shelf_in = ShadeConstruction('Indoor Light Shelf', 0.7, 0.7)
    south_face.apertures[0].outdoor_shades[
        0].properties.energy.construction = light_shelf_out
    south_face.apertures[0].indoor_shades[
        0].properties.energy.construction = light_shelf_in

    north_face = room[1]
    north_face.overhang(0.25, indoor=False)
    door_verts = [
        Point3D(2, 10, 0.1),
        Point3D(1, 10, 0.1),
        Point3D(1, 10, 2.5),
        Point3D(2, 10, 2.5)
    ]
    door = Door('Front Door', Face3D(door_verts))
    north_face.add_door(door)

    aperture_verts = [
        Point3D(4.5, 10, 1),
        Point3D(2.5, 10, 1),
        Point3D(2.5, 10, 2.5),
        Point3D(4.5, 10, 2.5)
    ]
    aperture = Aperture('Front Aperture', Face3D(aperture_verts))
    triple_pane = WindowConstruction(
        'Triple Pane Window',
        [clear_glass, air_gap, clear_glass, air_gap, clear_glass])
    aperture.properties.energy.construction = triple_pane
    north_face.add_aperture(aperture)

    tree_canopy_geo = Face3D.from_regular_polygon(
        6, 2, Plane(Vector3D(0, 0, 1), Point3D(5, -3, 4)))
    tree_canopy = Shade('Tree Canopy', tree_canopy_geo)

    table_geo = Face3D.from_rectangle(2, 2, Plane(o=Point3D(1.5, 4, 1)))
    table = Shade('Table', table_geo)
    room.add_indoor_shade(table)

    model = Model('TinyHouse', [room], orphaned_shades=[tree_canopy])
    model.north_angle = 15

    assert hasattr(model.to, 'idf')
    idf_string = model.to.idf(model, schedule_directory='./tests/idf/')
    assert 'TinyHouse,' in idf_string
    assert 'Building,' in idf_string
Exemplo n.º 15
0
def test_to_dict_single_zone_schedule_fixed_interval():
    """Test the Model to_dict method with a single zone model and fixed interval schedules."""
    room = Room.from_box('Tiny House Zone', 5, 10, 3)
    room.properties.energy.program_type = office_program
    room.properties.energy.hvac = IdealAirSystem()

    occ_sched = ScheduleFixedInterval(
        'Random Occupancy', [round(random.random(), 4) for i in range(8760)],
        schedule_types.fractional)
    new_people = room.properties.energy.people.duplicate()
    new_people.occupancy_schedule = occ_sched
    room.properties.energy.people = new_people

    south_face = room[3]
    south_face.apertures_by_ratio(0.4, 0.01)
    south_face.apertures[0].overhang(0.5, indoor=False)
    south_face.apertures[0].overhang(0.5, indoor=True)
    south_face.move_shades(Vector3D(0, 0, -0.5))
    light_shelf_out = ShadeConstruction('Outdoor Light Shelf', 0.5, 0.5)
    light_shelf_in = ShadeConstruction('Indoor Light Shelf', 0.7, 0.7)
    south_face.apertures[0].outdoor_shades[
        0].properties.energy.construction = light_shelf_out
    south_face.apertures[0].indoor_shades[
        0].properties.energy.construction = light_shelf_in

    north_face = room[1]
    north_face.overhang(0.25, indoor=False)
    door_verts = [
        Point3D(2, 10, 0.1),
        Point3D(1, 10, 0.1),
        Point3D(1, 10, 2.5),
        Point3D(2, 10, 2.5)
    ]
    door = Door('Front Door', Face3D(door_verts))
    north_face.add_door(door)

    aperture_verts = [
        Point3D(4.5, 10, 1),
        Point3D(2.5, 10, 1),
        Point3D(2.5, 10, 2.5),
        Point3D(4.5, 10, 2.5)
    ]
    aperture = Aperture('Front Aperture', Face3D(aperture_verts))
    north_face.add_aperture(aperture)

    tree_canopy_geo = Face3D.from_regular_polygon(
        6, 2, Plane(Vector3D(0, 0, 1), Point3D(5, -3, 4)))
    tree_canopy = Shade('Tree Canopy', tree_canopy_geo)
    winter = [0.75] * 2190
    spring = [0.75 - ((x / 2190) * 0.5) for x in range(2190)]
    summer = [0.25] * 2190
    fall = [0.25 + ((x / 2190) * 0.5) for x in range(2190)]
    trans_sched = ScheduleFixedInterval('Seasonal Tree Transmittance',
                                        winter + spring + summer + fall,
                                        schedule_types.fractional)
    tree_canopy.properties.energy.transmittance_schedule = trans_sched

    model = Model('Tiny House', [room], orphaned_shades=[tree_canopy])
    model.north_angle = 15

    model_dict = model.to_dict()

    assert 'energy' in model_dict['properties']
    assert 'schedules' in model_dict['properties']['energy']
    assert 'program_types' in model_dict['properties']['energy']

    assert len(model_dict['properties']['energy']['program_types']) == 1
    assert len(model_dict['properties']['energy']['schedules']) == 9

    assert 'people' in model_dict['rooms'][0]['properties']['energy']
    assert model_dict['rooms'][0]['properties']['energy']['people']['occupancy_schedule'] \
        == 'Random Occupancy'
    assert model_dict['orphaned_shades'][0]['properties']['energy']['transmittance_schedule'] \
        == 'Seasonal Tree Transmittance'

    assert model_dict['rooms'][0]['properties']['energy']['program_type'] == \
        office_program.name
    """