Exemplo n.º 1
0
def test_simulation_control_init_from_idf():
    """Test the initialization of SimulationControl from_idf."""
    sizing = SizingParameter(1)

    idf_str = sizing.to_idf()
    rebuilt_sizing = SizingParameter.from_idf(idf_str)
    assert sizing == rebuilt_sizing
    assert rebuilt_sizing.to_idf() == idf_str
Exemplo n.º 2
0
def test_sizing_parameter_init_from_idf():
    """Test the initialization of SimulationControl from_idf."""
    sizing = SizingParameter(None, 1)
    relative_path = './tests/ddy/chicago.ddy'
    sizing.add_from_ddy_996_004(relative_path)

    des_days, idf_str = sizing.to_idf()
    rebuilt_sizing = SizingParameter.from_idf(des_days, idf_str)
    rebuilt_sizing.apply_location(sizing[0].location)
    assert sizing == rebuilt_sizing
    assert rebuilt_sizing.to_idf()[1] == idf_str
    for dday1, dday2 in zip(des_days, rebuilt_sizing.to_idf()[0]):
        assert dday1 == dday2