def test_erfs_fpr_aggregates_reform():
    survey_scenario = ErfsFprSurveyScenario.create(
        data_year=2012,
        year=2015,
        reform_key='plf2015',
    )

    aggregates = Aggregates(survey_scenario=survey_scenario)
    base_data_frame = aggregates.compute_aggregates()
    return aggregates, base_data_frame
def test_erfs_aggregates_reform():
    '''
    test aggregates value with data
    :param year: year of data and simulation to test agregates
    :param reform: optional argument, put an openfisca_france.refoms object, default None
    '''
    survey_scenario = ErfsFprSurveyScenario.create(data_year = 2012, year = 2015, reform_key = 'plf2015')
    aggregates = Aggregates(survey_scenario = survey_scenario)
    base_data_frame = aggregates.compute_aggregates()

    return aggregates, base_data_frame
Ejemplo n.º 3
0
def test_erfs_fpr_aggregates_reform():
    '''
    test aggregates value with data
    :param year: year of data and simulation to test agregates
    :param reform: optional argument, put an openfisca_france.refoms object, default None
    '''
    survey_scenario = ErfsFprSurveyScenario.create(data_year = 2012, year = 2015, reform_key = 'plf2015')
    aggregates = Aggregates(survey_scenario = survey_scenario)
    base_data_frame = aggregates.compute_aggregates()

    return aggregates, base_data_frame
def test_erfs_survey_simulation(survey_scenario,
                                fake_input_data,
                                year: int = 2009):
    # On ititialise le survey scenario
    survey_scenario = survey_scenario(year)

    # On charge les données
    input_data = fake_input_data(year)

    # On initialise le survey scenario
    survey_scenario.init_from_data(data=dict(input_data_frame=input_data))

    # On calcule les agrégats
    aggregates = Aggregates(survey_scenario=survey_scenario)
    aggregates.compute_aggregates(use_baseline=False)
    return aggregates.base_data_frame
Ejemplo n.º 5
0
def test_erfs_fpr_aggregates_reform():
    '''
    test aggregates value with data
    :param year: year of data and simulation to test agregates
    :param reform: optional argument, put an openfisca_france.refoms object, default None
    '''
    tax_benefit_system = france_data_tax_benefit_system
    year = 2014
    survey_scenario = get_survey_scenario(
        reform = 'plf2015',
        baseline_tax_benefit_system = tax_benefit_system,
        year = year,
        rebuild_input_data = False,
        )
    aggregates = Aggregates(survey_scenario = survey_scenario)
    base_data_frame = aggregates.compute_aggregates()
    difference_data_frame = aggregates.compute_difference()

    return aggregates, base_data_frame, difference_data_frame
def test_erfs_fpr_aggregates_reform():
    '''
    test aggregates value with data
    :param year: year of data and simulation to test agregates
    :param reform: optional argument, put an openfisca_france.refoms object, default None
    '''
    tax_benefit_system = base_survey.france_data_tax_benefit_system
    year = 2012
    survey_scenario = get_survey_scenario(
        reform_key = 'plf2015',
        baseline_tax_benefit_system = tax_benefit_system,
        year = year,
        rebuild_input_data = False,
        )
    aggregates = Aggregates(survey_scenario = survey_scenario)
    base_data_frame = aggregates.compute_aggregates()
    difference_data_frame = aggregates.compute_difference()

    return aggregates, base_data_frame, difference_data_frame
Ejemplo n.º 7
0
def test_erfs_fpr_survey_simulation_aggregates(year = 2014, rebuild_input_data = False):
    np.seterr(all = 'raise')
    tax_benefit_system = france_data_tax_benefit_system

    survey_scenario = get_survey_scenario(
        tax_benefit_system = tax_benefit_system,
        year = year,
        rebuild_input_data = rebuild_input_data,
        )
    aggregates = Aggregates(survey_scenario = survey_scenario)

    return survey_scenario, aggregates
def test_erfs_survey_simulation(year = 2009):
    survey_scenario = ErfsSurveyScenario.create(year = year)
    aggregates = Aggregates(survey_scenario = survey_scenario)
    aggregates.compute_aggregates()
    return aggregates.base_data_frame
    return aggregates.base_data_frame


def test_erfs_aggregates_reform():
    '''
    test aggregates value with data
    :param year: year of data and simulation to test agregates
    :param reform: optional argument, put an openfisca_france.refoms object, default None
    '''
    survey_scenario = ErfsFprSurveyScenario.create(data_year = 2012, year = 2015, reform_key = 'plf2015')
    aggregates = Aggregates(survey_scenario = survey_scenario)
    base_data_frame = aggregates.compute_aggregates()

    return aggregates, base_data_frame


if __name__ == '__main__':
    import logging
    log = logging.getLogger(__name__)
    import sys
    logging.basicConfig(level = logging.INFO, stream = sys.stdout)
    # aggregates_data_frame, difference_data_frame,
    survey_scenario = test_erfs_fpr_survey_simulation_aggregates()

    aggregates = Aggregates(survey_scenario = survey_scenario)
    # df = aggregates.compute_aggregates()
    difference_data_frame = aggregates.compute_difference()
    # return aggregates.base_data_frame, difference_data_frame, survey_scenario

    # df = test_erfs_aggregates_reform()
Ejemplo n.º 10
0
def test_erfs_survey_simulation(year=2009):
    survey_scenario = ErfsSurveyScenario.create(year=year)
    aggregates = Aggregates(survey_scenario=survey_scenario)
    aggregates.compute_aggregates()
    return aggregates.base_data_frame
Ejemplo n.º 11
0
def test_erfs_aggregates_reform():
    '''
    test aggregates value with data
    :param year: year of data and simulation to test agregates
    :param reform: optional argument, put an openfisca_france.refoms object, default None
    '''
    survey_scenario = ErfsFprSurveyScenario.create(data_year=2012,
                                                   year=2015,
                                                   reform_key='plf2015')
    aggregates = Aggregates(survey_scenario=survey_scenario)
    base_data_frame = aggregates.compute_aggregates()

    return aggregates, base_data_frame


if __name__ == '__main__':
    import logging
    log = logging.getLogger(__name__)
    import sys
    logging.basicConfig(level=logging.INFO, stream=sys.stdout)
    # aggregates_data_frame, difference_data_frame,
    survey_scenario = test_erfs_fpr_survey_simulation_aggregates()

    aggregates = Aggregates(survey_scenario=survey_scenario)
    # df = aggregates.compute_aggregates()
    difference_data_frame = aggregates.compute_difference()
    # return aggregates.base_data_frame, difference_data_frame, survey_scenario

    # df = test_erfs_aggregates_reform()
Ejemplo n.º 12
0

def test_erfs_fpr_aggregates_reform():
    '''
    test aggregates value with data
    :param year: year of data and simulation to test agregates
    :param reform: optional argument, put an openfisca_france.refoms object, default None
    '''
    survey_scenario = ErfsFprSurveyScenario.create(data_year = 2012, year = 2015, reform_key = 'plf2015')
    aggregates = Aggregates(survey_scenario = survey_scenario)
    base_data_frame = aggregates.compute_aggregates()

    return aggregates, base_data_frame


if __name__ == '__main__':
    import logging
    log = logging.getLogger(__name__)
    import sys
    logging.basicConfig(level = logging.INFO, stream = sys.stdout)
    # aggregates_data_frame, difference_data_frame,
    survey_scenario = test_erfs_fpr_survey_simulation_aggregates(rebuild_input_data = False)

    aggregates = Aggregates(survey_scenario = survey_scenario)
    df = aggregates.compute_aggregates(use_baseline = False)
    # difference_data_frame = aggregates.compute_difference()
    # return aggregates.base_data_frame, difference_data_frame, survey_scenario

    # df = test_erfs_aggregates_reform()