Пример #1
0
def test_calculate_avg_delta_values3():
    
    expected = {'PET' : {'January': 1.25, 'February': 2.75, 'March': 3.25, 'April': 4.75, 'May': 5.25, 'June': 6.75, 'July': 7.25, 'August': 8.75, 'September': 9.25, 'October': 10.75, 'November': 11.25, 'December': 12.75}}    
    
    actual = deltas.calculate_avg_delta_values(deltas_data = fixture["sample_data_bad"], tile_list = ["11", "12"])
    
    nose.tools.assert_equals(np.array(expected["PET"]["January"]).all(), np.array(actual["PET"]["January"]).all())
    nose.tools.assert_equals(np.array(expected["PET"]["February"]).all(), np.array(actual["PET"]["February"]).all())
    nose.tools.assert_equals(np.array(expected["PET"]["April"]).all(), np.array(actual["PET"]["April"]).all())
    nose.tools.assert_equals(np.array(expected["PET"]["May"]).all(), np.array(actual["PET"]["May"]).all())
    nose.tools.assert_equals(np.array(expected["PET"]["June"]).all(), np.array(actual["PET"]["June"]).all())
    nose.tools.assert_equals(np.array(expected["PET"]["July"]).all(), np.array(actual["PET"]["July"]).all())
    nose.tools.assert_equals(np.array(expected["PET"]["August"]).all(), np.array(actual["PET"]["August"]).all())
    nose.tools.assert_equals(np.array(expected["PET"]["September"]).all(), np.array(actual["PET"]["September"]).all())
    nose.tools.assert_equals(np.array(expected["PET"]["October"]).all(), np.array(actual["PET"]["October"]).all())
    nose.tools.assert_equals(np.array(expected["PET"]["November"]).all(), np.array(actual["PET"]["November"]).all())
    nose.tools.assert_equals(np.array(expected["PET"]["December"]).all(), np.array(actual["PET"]["December"]).all())   
    
    
    
    
    
    
    
    
    
Пример #2
0
def test_calculate_avg_delta_values3():

    expected = {
        'PET': {
            'January': 1.25,
            'February': 2.75,
            'March': 3.25,
            'April': 4.75,
            'May': 5.25,
            'June': 6.75,
            'July': 7.25,
            'August': 8.75,
            'September': 9.25,
            'October': 10.75,
            'November': 11.25,
            'December': 12.75
        }
    }

    actual = deltas.calculate_avg_delta_values(
        deltas_data=fixture["sample_data_bad"], tile_list=["11", "12"])

    nose.tools.assert_equals(
        np.array(expected["PET"]["January"]).all(),
        np.array(actual["PET"]["January"]).all())
    nose.tools.assert_equals(
        np.array(expected["PET"]["February"]).all(),
        np.array(actual["PET"]["February"]).all())
    nose.tools.assert_equals(
        np.array(expected["PET"]["April"]).all(),
        np.array(actual["PET"]["April"]).all())
    nose.tools.assert_equals(
        np.array(expected["PET"]["May"]).all(),
        np.array(actual["PET"]["May"]).all())
    nose.tools.assert_equals(
        np.array(expected["PET"]["June"]).all(),
        np.array(actual["PET"]["June"]).all())
    nose.tools.assert_equals(
        np.array(expected["PET"]["July"]).all(),
        np.array(actual["PET"]["July"]).all())
    nose.tools.assert_equals(
        np.array(expected["PET"]["August"]).all(),
        np.array(actual["PET"]["August"]).all())
    nose.tools.assert_equals(
        np.array(expected["PET"]["September"]).all(),
        np.array(actual["PET"]["September"]).all())
    nose.tools.assert_equals(
        np.array(expected["PET"]["October"]).all(),
        np.array(actual["PET"]["October"]).all())
    nose.tools.assert_equals(
        np.array(expected["PET"]["November"]).all(),
        np.array(actual["PET"]["November"]).all())
    nose.tools.assert_equals(
        np.array(expected["PET"]["December"]).all(),
        np.array(actual["PET"]["December"]).all())
Пример #3
0
def test_calculate_avg_delta_values2():
    
    expected = {'PET' : {'January': 1.3666666666666667, 'February': 2.6, 'March': 3.3666666666666667, 'April': 4.6, 'May': 5.3666666666666667, 'June': 6.6, 'July': 7.3666666666666667, 'August': 8.6, 'September': 9.3666666666666667, 'October': 10.6, 'November': 11.3666666666666667, 'December': 12.6}}    
    
    actual = deltas.calculate_avg_delta_values(deltas_data = fixture["sample_data"], tile_list = ["11", "12", "32"])
    
    nose.tools.assert_almost_equals(expected["PET"]["January"], actual["PET"]["January"])
    nose.tools.assert_almost_equals(expected["PET"]["February"], actual["PET"]["February"])
    nose.tools.assert_almost_equals(expected["PET"]["April"], actual["PET"]["April"])
    nose.tools.assert_almost_equals(expected["PET"]["May"], actual["PET"]["May"])
    nose.tools.assert_almost_equals(expected["PET"]["June"], actual["PET"]["June"])
    nose.tools.assert_almost_equals(expected["PET"]["July"], actual["PET"]["July"])
    nose.tools.assert_almost_equals(expected["PET"]["August"], actual["PET"]["August"])
    nose.tools.assert_almost_equals(expected["PET"]["September"], actual["PET"]["September"])
    nose.tools.assert_almost_equals(expected["PET"]["October"], actual["PET"]["October"])
    nose.tools.assert_almost_equals(expected["PET"]["November"], actual["PET"]["November"])
    nose.tools.assert_almost_equals(expected["PET"]["December"], actual["PET"]["December"]) 
Пример #4
0
def test_calculate_avg_delta_values2():

    expected = {
        'PET': {
            'January': 1.3666666666666667,
            'February': 2.6,
            'March': 3.3666666666666667,
            'April': 4.6,
            'May': 5.3666666666666667,
            'June': 6.6,
            'July': 7.3666666666666667,
            'August': 8.6,
            'September': 9.3666666666666667,
            'October': 10.6,
            'November': 11.3666666666666667,
            'December': 12.6
        }
    }

    actual = deltas.calculate_avg_delta_values(
        deltas_data=fixture["sample_data"], tile_list=["11", "12", "32"])

    nose.tools.assert_almost_equals(expected["PET"]["January"],
                                    actual["PET"]["January"])
    nose.tools.assert_almost_equals(expected["PET"]["February"],
                                    actual["PET"]["February"])
    nose.tools.assert_almost_equals(expected["PET"]["April"],
                                    actual["PET"]["April"])
    nose.tools.assert_almost_equals(expected["PET"]["May"],
                                    actual["PET"]["May"])
    nose.tools.assert_almost_equals(expected["PET"]["June"],
                                    actual["PET"]["June"])
    nose.tools.assert_almost_equals(expected["PET"]["July"],
                                    actual["PET"]["July"])
    nose.tools.assert_almost_equals(expected["PET"]["August"],
                                    actual["PET"]["August"])
    nose.tools.assert_almost_equals(expected["PET"]["September"],
                                    actual["PET"]["September"])
    nose.tools.assert_almost_equals(expected["PET"]["October"],
                                    actual["PET"]["October"])
    nose.tools.assert_almost_equals(expected["PET"]["November"],
                                    actual["PET"]["November"])
    nose.tools.assert_almost_equals(expected["PET"]["December"],
                                    actual["PET"]["December"])