def test_error(master=False, remove=True, show=False): name = osjoin(MASTER, 'error_master') if master else 'error' # Make the plot fcp.bar(df=df, x='Liquid', y='pH', show=SHOW, tick_labels_major_x_rotation=90, error_bars=True, filename=name + '.png', inline=False, jitter=False) # Compare with master if master: return elif show: os.startfile(osjoin(MASTER, name + '_master.png')) os.startfile(name + '.png') else: compare = utl.img_compare(name + '.png', osjoin(MASTER, name + '_master.png')) if remove: os.remove(name + '.png') assert not compare
def test_vertical(master=False, remove=True, show=False): name = osjoin(MASTER, 'vertical_master') if master else 'vertical' # Make the plot fcp.bar(df=df, x='Liquid', y='pH', show=SHOW, filter='Measurement=="A" & T [C]==25', tick_labels_major_x_rotation=90, filename=name + '.png', inline=False, jitter=False) # Compare with master if master: return elif show: os.startfile(osjoin(MASTER, name + '_master.png')) os.startfile(name + '.png') else: compare = utl.img_compare(name + '.png', osjoin(MASTER, name + '_master.png')) if remove: os.remove(name + '.png') assert not compare
def test_horizontal(master=False, remove=True, show=False): name = osjoin(MASTER, 'horizontal_master') if master else 'horizontal' # Make the plot fcp.bar(df=df, x='Liquid', y='pH', show=SHOW, filter='Measurement=="A"', horizontal=True, filename=name + '.png', inline=False, jitter=False) # Compare with master if master: return elif show: os.startfile(osjoin(MASTER, name + '_master.png')) os.startfile(name + '.png') else: compare = utl.img_compare(name + '.png', osjoin(MASTER, name + '_master.png')) if remove: os.remove(name + '.png') assert not compare
def test_wrap(master=False, remove=True, show=False): name = osjoin(MASTER, 'wrap_master') if master else 'wrap' # Make the plot fcp.bar(df, x='Liquid', y='pH', show=SHOW, tick_labels_major_x_rotation=90, wrap='Measurement', ax_size=[300, 300], filename=name + '.png', inline=False, jitter=False) # Compare with master if master: return elif show: os.startfile(osjoin(MASTER, name + '_master.png')) os.startfile(name + '.png') else: compare = utl.img_compare(name + '.png', osjoin(MASTER, name + '_master.png')) if remove: os.remove(name + '.png') assert not compare
def test_stacked(master=False, remove=True, show=False): name = osjoin(MASTER, 'stacked_master') if master else 'stacked' # Make the plot fcp.bar(df=df, x='Liquid', y='pH', show=SHOW, tick_labels_major_x_rotation=90, stacked=True, legend='Measurement', filename=name + '.png', inline=False, jitter=False) # Compare with master if master: return elif show: os.startfile(osjoin(MASTER, name + '_master.png')) os.startfile(name + '.png') compare = utl.img_compare(name + '.png', osjoin(MASTER, name + '_master.png'), show=True) else: compare = utl.img_compare(name + '.png', osjoin(MASTER, name + '_master.png')) if remove: os.remove(name + '.png') assert not compare