本文整理汇总了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_())