当前位置: 首页>>代码示例>>Python>>正文


Python ScenarioSimulation.get_varying_revenues方法代码示例

本文整理汇总了Python中openfisca_core.simulations.ScenarioSimulation.get_varying_revenues方法的典型用法代码示例。如果您正苦于以下问题:Python ScenarioSimulation.get_varying_revenues方法的具体用法?Python ScenarioSimulation.get_varying_revenues怎么用?Python ScenarioSimulation.get_varying_revenues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在openfisca_core.simulations.ScenarioSimulation的用法示例。


在下文中一共展示了ScenarioSimulation.get_varying_revenues方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_bareme

# 需要导入模块: from openfisca_core.simulations import ScenarioSimulation [as 别名]
# 或者: from openfisca_core.simulations.ScenarioSimulation import get_varying_revenues [as 别名]
def test_bareme(x_axis="sali"):
    """
    Use to test and debug bareme mode test-case
    """

    yr = 2012
    # Changes in individualized characteristics
    # salaires: sali
    # retraites: choi
    # intérêts: f2ee intpfl; f2tr intb
    # dividendes: f2da divplf; f2dc divb
    # foncier  f4ba fon (micro foncier f4be)


    maxrev = 500000
    year = 2012
    simulation = ScenarioSimulation()

    # Changes in individualized caracteristics
    # salaires: sali
    # retraites: choi
    # intérêts: f2ee intpfl; f2tr intb
    # dividendes: f2da divplf; f2dc divb
    # foncier  f4ba fon (micro foncier f4be)

    simulation.set_config(year = yr, nmen = 101, x_axis = x_axis, maxrev=maxrev,
                          reforme = False, mode ='bareme', decomp_file="decomp_contrib.xml")
    simulation.set_param()
    # Hack to get rid of missing parameters in 2012
    if yr == 2012:
        complete_2012_param(simulation.P)


    test_case = simulation.scenario

    if SHOW_OPENFISCA:
        app = QApplication(sys.argv)
        win = ApplicationWindow()
        ax = win.mplwidget.axes
        title ="Barème openfisca"
        ax.set_title(title)
        graph_x_axis = simulation.get_varying_revenues(x_axis)
        draw_simulation_bareme(simulation, ax, graph_x_axis = graph_x_axis, legend = True, position = 4)
        win.resize(1400,700)
        win.mplwidget.draw()
        win.show()

    if EXPORT:
        win.mplwidget.print_figure(DESTINATION_DIR + title + '.png')

    if ax:
        del ax
    del simulation
    sys.exit(app.exec_())
开发者ID:Iliato,项目名称:openfisca-qt,代码行数:56,代码来源:cecilia.py


注:本文中的openfisca_core.simulations.ScenarioSimulation.get_varying_revenues方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。