def test_ss_profiles_save_fig(tmpdir): path = os.path.join(tmpdir, 'test_plot.png') output_plots.ss_profiles(base_ss, base_params, reform_ss, reform_params, path=path) img = mpimg.imread(path) assert isinstance(img, np.ndarray)
def comp_output(base_ss, base_params, reform_ss, reform_params, var='nssmat'): ''' Function to create output for the COMP platform ''' fig = op.ss_profiles( base_ss, base_params, reform_ss=reform_ss, reform_params=reform_params, by_j=True, var=var, plot_title='Labor Supply in Baseline and Reform Policy') in_memory_file = io.BytesIO() fig.savefig(in_memory_file, format="png") in_memory_file.seek(0) comp_dict = { "renderable": [{ "media_type": "PNG", "title": 'Labor Supply in Baseline and Reform Policy', "data": in_memory_file.read() }], "downloadable": [] } return comp_dict
def test_ss_profiles(by_j, plot_data): fig = output_plots.ss_profiles(base_ss, base_params, reform_ss, reform_params, by_j=by_j, plot_data=plot_data, plot_title=' Test Plot Title') assert fig
def test_ss_profiles(): fig = output_plots.ss_profiles(base_ss, base_params, reform_ss, reform_params) assert fig