Exemple #1
0
def test_F6():
    f = year_2008.F6()

    x = l.load_cec_auxiliary('F6_o', '2008')

    y = f(x)

    assert y == -140
Exemple #2
0
def test_F1():
    f = year_2008.F1()

    x = l.load_cec_auxiliary('F1_o', '2008')

    y = f(x)

    assert y == -450
Exemple #3
0
def test_F4():
    f = year_2008.F4()

    x = l.load_cec_auxiliary('F4_o', '2008')

    y = f(x)

    assert y == -330
Exemple #4
0
def test_F5():
    f = year_2008.F5()

    x = l.load_cec_auxiliary('F5_o', '2008')

    y = f(x)

    assert y == -180
Exemple #5
0
def test_F10():
    f = year_2010.F10(group_size=50)

    x = l.load_cec_auxiliary('F10_o', '2010')

    y = f(x)

    assert y == 0
Exemple #6
0
def test_F3():
    f = year_2008.F3()

    x = l.load_cec_auxiliary('F3_o', '2008') + 1

    y = f(x)

    assert y == 390
Exemple #7
0
def test_F3():
    f = year_2010.F3()

    x = l.load_cec_auxiliary('F3_o', '2010')

    y = f(x)

    assert y == 0
Exemple #8
0
def test_F8():
    f = year_2013.F8()

    x = l.load_cec_auxiliary('F8_o', '2013')

    y = f(x)

    assert y == 0
Exemple #9
0
def test_F14():
    f = year_2013.F14()

    x = l.load_cec_auxiliary('F14_o', '2013')

    y = f(x)

    assert y >= 0
Exemple #10
0
def test_F8():
    f = year_2010.F8(group_size=50)

    x = l.load_cec_auxiliary('F8_o', '2010')
    x += 1

    y = f(x)

    assert y == 950
Exemple #11
0
def test_F20():
    f = year_2010.F20()

    x = l.load_cec_auxiliary('F20_o', '2010')
    x += 1

    y = f(x)

    assert round(y) == 0
Exemple #12
0
def test_F18():
    f = year_2010.F18(group_size=50)

    x = l.load_cec_auxiliary('F18_o', '2010')
    x += 1

    y = f(x)

    assert round(y) == 0
Exemple #13
0
def test_F13():
    f = year_2010.F13(group_size=50)

    x = l.load_cec_auxiliary('F13_o', '2010')
    x += 1

    y = f(x)

    assert y == 500
Exemple #14
0
def test_F12():
    f = year_2013.F12()

    x = l.load_cec_auxiliary('F12_o', '2013')
    x += 1

    y = f(x)

    assert round(y) == 0
Exemple #15
0
    def _load_auxiliary_data(self, name, year, data):
        """Loads auxiliary data from a set of files.

        Args:
            name (str): Name of the function.
            year (str): Year of the function.
            data (list): List holding the variables to be loaded.

        """

        # Iterates over the `data` list
        for dt in data:
            # Constructs the data file
            # Note that it will always be NAME_VARIABLE
            data_file = f'{name}_{dt}'

            # Loads the data to a temporary variable
            tmp = ld.load_cec_auxiliary(data_file, year)

            # Sets the temporary variable as a property
            setattr(self, dt, tmp)
Exemple #16
0
def test_load_cec_auxiliary():
    data = loader.load_cec_auxiliary('F1_o', '2005')

    assert data.shape[0] == 100