示例#1
0
def produce_graph(name="test", apply_reform=False, reforme=False, conj = False,
                  sal_conj=False, kids = 0, save_figure = False, destination_dir = None,
                  bareme=True, tax_rates=False, year=2011):

    app = QApplication(sys.argv)
    win = ApplicationWindow()
    ax = win.mplwidget.axes
    simulation = run_simulation(year=year,
                                apply_reform=apply_reform,
                                reforme=reforme,
                                conj = conj,
                                sal_conj=sal_conj,
                                kids=kids)

    if bareme:
        draw_simulation_bareme(simulation, ax, legend = True, position = 4)

    if tax_rates:
        draw_simulation_taux(simulation, ax, legend=True)

    win.resize(1400,700)
    win.mplwidget.draw()
    win.show()

    df = simulation.get_results_dataframe()
#    print df.to_string()

    if save_figure and destination_dir is not None:
        win.mplwidget.print_figure(os.path.join(destination_dir, name + '.png'))

    del ax, simulation
def produce_graph(name="test",
                  apply_reform=False,
                  reforme=False,
                  conj=False,
                  sal_conj=False,
                  kids=0,
                  save_figure=False,
                  destination_dir=None,
                  bareme=True,
                  tax_rates=False,
                  year=2011):

    app = QApplication(sys.argv)
    win = ApplicationWindow()
    ax = win.mplwidget.axes
    simulation = run_simulation(year=year,
                                apply_reform=apply_reform,
                                reforme=reforme,
                                conj=conj,
                                sal_conj=sal_conj,
                                kids=kids)

    if bareme:
        draw_simulation_bareme(simulation, ax, legend=True, position=4)

    if tax_rates:
        draw_simulation_taux(simulation, ax, legend=True)

    win.resize(1400, 700)
    win.mplwidget.draw()
    win.show()

    df = simulation.get_results_dataframe()
    #    print df.to_string()

    if save_figure and destination_dir is not None:
        win.mplwidget.print_figure(os.path.join(destination_dir,
                                                name + '.png'))

    del ax, simulation
示例#3
0
    ax = win.mplwidget.axes

    year = 2011

    simulation = ScenarioSimulation()
    simulation.set_config(year=year,
                          nmen=101,
                          x_axis='sali',
                          maxrev=50000,
                          mode='bareme',
                          same_rev_couple=False)
    simulation.set_param()

    #    draw_simulation_bareme(simulation, ax, legend = True, position = 4)
    draw_simulation_taux(simulation, ax, legend=True)

    win.resize(1400, 700)
    if SHOW:
        win.mplwidget.draw()
        win.show()

    df = simulation.get_results_dataframe()
    print df.to_string()

    title = "test"
    if SAVE:
        win.mplwidget.print_figure(
            os.path.join(destination_dir, title + '.png'))

    del ax, simulation
示例#4
0
    app = QApplication(sys.argv)
    win = ApplicationWindow()
    win = ApplicationWindow()

    ax = win.mplwidget.axes

    year = 2011

    simulation = ScenarioSimulation()
    simulation.set_config(year = year, nmen = 101,
                    x_axis = 'sali', maxrev = 50000,
                    mode ='bareme', same_rev_couple = False)
    simulation.set_param()

#    draw_simulation_bareme(simulation, ax, legend = True, position = 4)
    draw_simulation_taux(simulation, ax, legend=True)

    win.resize(1400,700)
    if SHOW:
        win.mplwidget.draw()
        win.show()

    df = simulation.get_results_dataframe()
    print df.to_string()

    title = "test"
    if SAVE:
        win.mplwidget.print_figure(os.path.join(destination_dir, title + '.png'))

    del ax, simulation
    sys.exit(app.exec_())