Exemple #1
0
def test_import_hpxml(consumption_hpxml_filename):
    ch = import_hpxml(consumption_hpxml_filename)

    consumptions_e = ch.electricity
    consumptions_g = ch.natural_gas
    assert_allclose([ c.kWh for c in consumptions_e],[10.,11.,12.],rtol=RTOL,atol=ATOL)
    assert_allclose([ c.therms for c in consumptions_g],[10.,11.,12.],rtol=RTOL,atol=ATOL)
    assert len(consumptions_e) == 3
    assert len(consumptions_g) == 3
    assert not consumptions_e[0].estimated
    assert not consumptions_e[1].estimated
    assert not consumptions_g[0].estimated
    assert not consumptions_g[1].estimated
    assert consumptions_e[2].estimated
    assert consumptions_g[2].estimated
def test_import_hpxml(consumption_hpxml_filename):
    consumption = import_hpxml(consumption_hpxml_filename)

    elec_data = consumption[0].data
    gas_data = consumption[1].data
    elec_estimated = consumption[0].estimated
    gas_estimated = consumption[1].estimated
    assert_allclose(elec_data.values, [10.,11.,12., np.nan],
            rtol=RTOL, atol=ATOL)
    assert_allclose(gas_data.values, [10.,11.,12., np.nan],
            rtol=RTOL, atol=ATOL)
    assert_allclose(elec_estimated.values, [False, False, True, False],
            rtol=RTOL, atol=ATOL)
    assert_allclose(gas_estimated.values, [False, False, True, False],
            rtol=RTOL, atol=ATOL)