Beispiel #1
0
def test_shared_no(master=False, remove=True, show=False):

    name = osjoin(MASTER, 'shared_no_master') if master else 'shared_no'

    # Make the plot
    fcp.plot(df, x='Voltage', y='I [A]', legend='Die', col='Boost Level', row='Temperature [C]', \
             ax_size=[225, 225], filter='Substrate=="Si" & Target Wavelength==450', label_rc_font_size=14,
             xmin=[0, 0.1, 0.2, 0.3, 0.4], ymax=[1, 2, 3, 4, 5, 6],
             filename=name + '.png', inline=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
Beispiel #2
0
def test_legend_multiple_xy(master=False, remove=True, show=False):

    name = osjoin(
        MASTER,
        'legend_multiple_xy_master') if master else 'legend_multiple_xy'

    # Make the plot
    fcp.plot(
        df=df1,
        x='Voltage',
        y=['I [A]', 'Voltage'],
        lines=False,
        filter='Substrate=="Si" & Target Wavelength==450 & Boost Level==0.2',
        filename=name + '.png',
        inline=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
Beispiel #3
0
def test_shared_cols(master=False, remove=True, show=False):

    name = osjoin(MASTER,
                  'shared_columns_master') if master else 'shared_columns'

    # Make the plot
    sub = df[(df.Substrate == 'Si') & (df['Target Wavelength'] == 450)].copy()
    fcp.plot(df=sub,
             x='Voltage',
             y='I [A]',
             legend='Die',
             col='Boost Level',
             row='Temperature [C]',
             show=SHOW,
             ax_size=[225, 225],
             share_col=True,
             filename=name + '.png',
             inline=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
Beispiel #4
0
def test_multiple_xy_both(master=False, remove=True, show=False):

    name = osjoin(MASTER,
                  'multiple-xy_both_master') if master else 'multiple-xy_both'

    # Make the plot
    fcp.plot(
        df,
        x=['Boost Level', 'I [A]'],
        y=['Voltage', 'Temperature [C]'],
        legend='Die',
        show=SHOW,
        filter=
        'Substrate=="Si" & Target Wavelength==450 & Boost Level==0.2 & Temperature [C]==25',
        filename=name + '.png',
        inline=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
Beispiel #5
0
def test_primary_explicit(master=False, remove=True, show=False):

    name = osjoin(MASTER,
                  'primary_explicit_master') if master else 'primary_explicit'

    # Make the plot
    fcp.plot(
        df=df,
        x='Voltage',
        y='I [A]',
        legend='Die',
        show=SHOW,
        filter=
        'Substrate=="Si" & Target Wavelength==450 & Boost Level==0.2 & Temperature [C]==25',
        xmax=1.2,
        auto_scale=False,
        filename=name + '.png',
        inline=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
Beispiel #6
0
def test_xy_categorical(master=False, remove=True, show=False):

    name = osjoin(MASTER,
                  'xy_categorical_master') if master else 'xy_categorical'

    # Make the plot
    fcp.plot(
        df,
        x='Die',
        y='I [A]',
        show=SHOW,
        filter=
        'Substrate=="Si" & Target Wavelength==450 & Boost Level==0.2 & Temperature [C]==25 & Voltage==1.5',
        filename=name + '.png',
        inline=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
def test_groups_wrap_names_no_sharing(master=False, remove=True, show=False):

    name = osjoin(MASTER, 'groups_wrap_names-no-sharing_master'
                  ) if master else 'groups_wrap_names-no-sharing'

    # Make the plot
    fcp.plot(df=df1,
             x='Voltage',
             y=['I Set', 'I [A]'],
             legend='Die',
             wrap='y',
             groups=['Boost Level', 'Temperature [C]'],
             ax_size=[525, 170],
             filter='Substrate=="Si" & Target Wavelength==450',
             ncol=1,
             ws_row=0,
             separate_labels=False,
             separate_ticks=False,
             filename=name + '.png',
             inline=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_figure(master=False, remove=True, show=False):

    name = osjoin(MASTER, 'figure_master') if master else 'figure'

    # Make the plot
    fcp.plot(df=df1,
             x='Voltage',
             y='I [A]',
             fig_groups='Die',
             wrap=['Temperature [C]', 'Boost Level'],
             ax_size=[225, 225],
             filter='Substrate=="Si" & Target Wavelength==450',
             filename=name + '.png',
             inline=False)

    # Compare with master
    if master:
        return
    elif show:
        for die in df1.Die.unique():
            tag = ' where %s=%s' % ('Die', die)
            os.startfile(osjoin(MASTER, name + '_master' + tag + '.png'))
            os.startfile(name + tag + '.png')
    else:
        for die in df1.Die.unique():
            tag = ' where %s=%s' % ('Die', die)
            compare = utl.img_compare(
                name + tag + '.png',
                osjoin(MASTER, name + '_master' + tag + '.png'))
            if remove:
                os.remove(name + tag + '.png')

            assert not compare
def test_groups_wrap_column_ncol(master=False, remove=True, show=False):

    name = osjoin(MASTER, 'groups_wrap_column_ncol_master'
                  ) if master else 'groups_wrap_column_ncol'

    # Make the plot
    fcp.plot(df=df1,
             x='Voltage',
             y='I [A]',
             legend='Die',
             wrap=['Temperature [C]', 'Boost Level'],
             ax_size=[225, 225],
             filter='Substrate=="Si" & Target Wavelength==450',
             ncol=2,
             filename=name + '.png',
             inline=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_groups_row_col_x(master=False, remove=True, show=False):

    name = osjoin(MASTER,
                  'groups_row_col_x_master') if master else 'groups_row_col_x'

    # Make the plot
    fcp.plot(
        df=df1,
        x=['Voltage', 'I [A]'],
        y='Voltage',
        legend='Die',
        row='Boost Level',
        col='x',
        ax_size=[225, 225],
        filter='Substrate=="Si" & Target Wavelength==450 & Temperature [C]==75',
        label_rc_font_size=14,
        filename=name + '.png',
        inline=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_legend_single(master=False, remove=True, show=False):

    name = osjoin(MASTER,
                  'legend_single_master') if master else 'legend_single'

    # Make the plot
    fcp.plot(
        df=df1,
        x='Voltage',
        y='I [A]',
        legend='Die',
        filter=
        'Substrate=="Si" & Target Wavelength==450 & Boost Level==0.2 & Temperature [C]==25',
        filename=name + '.png',
        inline=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
Beispiel #12
0
def test_xy_ts(master=False, remove=True, show=False):

    name = osjoin(MASTER, 'xy_ts_master') if master else 'xy_ts'

    # Make the plot
    fcp.plot(ts,
             x='Date',
             y='Happiness Quotient',
             markers=False,
             ax_size=[1000, 250],
             filename=name + '.png',
             inline=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
Beispiel #13
0
def test_secondary_xy_shared_x(master=False, remove=True, show=False):

    name = osjoin(
        MASTER,
        'secondary-xy_shared-x_master') if master else 'secondary-xy_shared-x'

    # Make the plot
    fcp.plot(
        df,
        x=['Voltage', 'I [A]'],
        y='Voltage',
        legend='Die',
        twin_y=True,
        show=SHOW,
        filter=
        'Substrate=="Si" & Target Wavelength==450 & Boost Level==0.2 & Temperature [C]==25 & Die=="(-1,2)"',
        filename=name + '.png',
        inline=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
def test_alpha_legend_marker(master=False, remove=True, show=False):

    name = osjoin(
        MASTER,
        'alpha_legend_marker_master') if master else 'alpha_legend_marker'

    # Make the plot
    fcp.plot(df=df,
             x='Voltage',
             y='I [A]',
             legend=['Die', 'Substrate'],
             filter=
             'Target Wavelength==450 & Boost Level==0.2 & Temperature [C]==25',
             marker_edge_alpha=0.3,
             legend_marker_alpha=0.3,
             filename=name + '.png',
             inline=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
Beispiel #15
0
def test_other_conf_int(master=False, remove=True, show=False):

    name = osjoin(MASTER,
                  'other_conf-int_master') if master else 'other_conf-int'

    # Make the plot
    fcp.plot(
        df,
        x='Voltage',
        y='I [A]',
        title='IV Data',
        lines=False,
        show=SHOW,
        filter=
        'Substrate=="Si" & Target Wavelength==450 & Boost Level==0.2 & Temperature [C]==25',
        conf_int=0.95,
        filename=name + '.png',
        inline=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
Beispiel #16
0
def test_other_stat_good_mult(master=False, remove=True, show=False):

    name = osjoin(MASTER, 'other_stat-lines-good-multipe-y_master'
                  ) if master else 'other_stat-lines-good-multipe-y'

    # Make the plot
    fcp.plot(
        df,
        x='Voltage',
        y=['Boost Level', 'I [A]'],
        show=SHOW,
        legend=True,
        stat='median',
        filter=
        'Substrate=="Si" & Target Wavelength==450 & Boost Level==0.2 & Temperature [C]==25',
        filename=name + '.png',
        inline=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
Beispiel #17
0
def test_groups_enabled2(master=False, remove=True, show=False):

    name = osjoin(MASTER,
                  'groups_enabled2_master') if master else 'groups_enabled2'

    # Make the plot
    fcp.plot(
        df=df1,
        x='Voltage',
        y='I [A]',
        groups=['Die', 'Temperature [C]'],
        filter='Substrate=="Si" & Target Wavelength==450 & Boost Level==0.2',
        filename=name + '.png',
        inline=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
Beispiel #18
0
def test_wrap(master=False, remove=True, show=False):

    name = osjoin(MASTER,
                  'grid-plots-wrap_master') if master else 'grid-plots-wrap'

    # Make the plot
    fcp.plot(df,
             x='Voltage',
             y='I [A]',
             legend='Die',
             wrap=['Temperature [C]', 'Boost Level'],
             show=SHOW,
             ax_size=[225, 225],
             filter='Substrate=="Si" & Target Wavelength==450',
             label_rc_font_size=13,
             filename=name + '.png',
             inline=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
Beispiel #19
0
def test_default(master=False, remove=True, show=False):

    name = osjoin(MASTER, 'default_master') if master else 'default'

    # Make the plot
    sub = df[(df.Substrate == 'Si') & (df['Target Wavelength'] == 450) &
             (df['Boost Level'] == 0.2) & (df['Temperature [C]'] == 25)]
    fcp.plot(df=sub,
             x='Voltage',
             y='I [A]',
             legend='Die',
             show=SHOW,
             filename=name + '.png',
             inline=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
Beispiel #20
0
def test_other_ref_line_mult(master=False, remove=True, show=False):

    name = osjoin(
        MASTER,
        'other_ref-line_mult_master') if master else 'other_ref-line_mult'

    # Make the plot
    df['2*Voltage'] = 2 * df['Voltage']
    fcp.plot(
        df,
        x='Voltage',
        y='I [A]',
        title='IV Data',
        show=SHOW,
        legend='Die',
        filter=
        'Substrate=="Si" & Target Wavelength==450 & Boost Level==0.2 & Temperature [C]==25',
        xmin=0,
        ymin=0,
        xmax=1.6,
        ymax=1.6,
        ref_line=['Voltage', '2*Voltage'],
        ref_line_legend_text=['y=x', 'y=2*x'],
        ref_line_style=['-', '--'],
        ref_line_color=[5, 6],
        filename=name + '.png',
        inline=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
def test_text_box_single_style(master=False, remove=True, show=False):

    name = osjoin(
        MASTER,
        'text_box_single_style_master') if master else 'text_box_single_style'

    # Make the plot
    fcp.plot(
        df,
        x='Voltage',
        y='I [A]',
        ax_scale='loglog',
        legend='Die',
        show=SHOW,
        xmin=0.9,
        filter=
        'Substrate=="Si" & Target Wavelength==450 & Boost Level==0.2 & Temperature [C]==25',
        text='Die (-1,2) shows\nbest response',
        text_position=[10, 340],
        text_font_size=20,
        text_edge_color='#FF0000',
        text_font_color='#00FF00',
        text_fill_color='#ffffff',
        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
def test_alpha(master=False, remove=True, show=False):

    name = osjoin(MASTER, 'alpha_master') if master else 'alpha'

    # Make the plot
    fcp.plot(df=df,
             x='Voltage',
             y='I [A]',
             legend=['Die', 'Substrate'],
             filter=
             'Target Wavelength==450 & Boost Level==0.2 & Temperature [C]==25',
             fig_fill_color='#00FF00',
             fig_fill_alpha=0.5,
             legend_fill_color='#FF0000',
             legend_fill_alpha=0.52,
             ax_fill_color='#FFFFFF',
             ax_fill_alpha=0.7,
             label_x_fill_color='#0000FF',
             label_x_fill_alpha=0.2,
             label_y_fill_color='#FF00FF',
             label_y_fill_alpha=0.2,
             tick_labels_major_fill_color='#AAFB05',
             tick_labels_major_fill_alpha=0.45,
             filename=name + '.png',
             inline=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
Beispiel #23
0
def test_other_curve_fitting_legend2(master=False, remove=True, show=False):

    name = osjoin(MASTER, 'other_curve-fitting-legend2_master'
                  ) if master else 'other_curve-fitting-legend2'

    # Make the plot
    fcp.plot(
        df,
        x='Voltage',
        y='I [A]',
        title='IV Data',
        lines=False,
        show=SHOW,
        wrap='Die',
        legend='Die',
        filter=
        'Substrate=="Si" & Target Wavelength==450 & Boost Level==0.2 & Temperature [C]==25',
        fit=1,
        fit_range_x=[1.3, 2],
        fit_width=2,
        fit_color='#555555',
        ax_size=[250, 250],
        filename=name + '.png',
        inline=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
Beispiel #24
0
def test_legend_position_below(master=False, remove=True, show=False):

    name = osjoin(
        MASTER,
        'legend_position_below_master') if master else 'legend_position_below'

    # Make the plot
    df1.loc[df1.Die == '(1,1)',
            'Long Legend'] = 'Sample #ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    df1.loc[df1.Die == '(2,-1)',
            'Long Legend'] = 'Sample #RUNFORYOURLIFEWITHME'
    df1.loc[df1.Die == '(-1,2)',
            'Long Legend'] = 'Sample #THESKYISANEIGHBORHOOD!!!!!!!!!'
    fcp.plot(
        df1,
        x='Voltage',
        y='I [A]',
        legend='Long Legend',
        show=SHOW,
        filter=
        'Substrate=="Si" & Target Wavelength==450 & Boost Level==0.2 & Temperature [C]==25',
        legend_location='below',
        filename=name + '.png',
        inline=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
Beispiel #25
0
def test_lin_sci_off(master=False, remove=True, show=False):

    name = osjoin(MASTER, 'lin_sci_off_master') if master else 'lin_sci_off'

    # Make the plot
    x = np.linspace(1, 10, 10)
    y = np.linspace(1E18, 1E19, 10)
    fcp.plot(pd.DataFrame({'x': x, 'y': y}), x='x', y='y', sci_y=False,
             filename=name + '.png', inline=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_text_box_position_units(master=False, remove=True, show=False):

    name = osjoin(MASTER, 'text_box_position_units_master'
                  ) if master else 'text_box_position_units'

    # Make the plot
    fcp.plot(
        df,
        x='Voltage',
        y='I [A]',
        ax_scale='loglog',
        legend='Die',
        show=SHOW,
        xmin=0.9,
        filter=
        'Substrate=="Si" & Target Wavelength==450 & Boost Level==0.2 & Temperature [C]==25',
        text='Die (-1,2) shows best response',
        text_position=[0, 0.95],
        text_units='relative',
        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
Beispiel #27
0
def test_multiple_scaled(master=False, remove=True, show=False):

    name = osjoin(MASTER, 'multiple_scaled_master') if master else 'multiple_scaled'

    # Make the plot
    fcp.plot(df=df, x='Voltage', y=['Voltage', 'I [A]'], twin_x=False, show=SHOW, legend='Die',
             filter='Substrate=="Si" & Target Wavelength==450 & Boost Level==0.2 & Temperature [C]==25 & Die=="(-1,2)"',
             ymin=0.05,
             filename=name + '.png', inline=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
Beispiel #28
0
def test_spines(master=False, remove=True, show=False):

    name = osjoin(MASTER, 'spines_master') if master else 'spines'

    # Make the plot
    fcp.plot(df=df, x='Voltage', y='I [A]', legend=['Die', 'Substrate'],
             filter='Target Wavelength==450 & Boost Level==0.2 & Temperature [C]==25',
             ax_edge_color='#FF0000', spine_left=False, spine_right=False,
             filename=name + '.png', inline=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
Beispiel #29
0
def test_marker_type_none(master=False, remove=True, show=False):

    name = osjoin(MASTER, 'marker_type_none_master') if master else 'marker_type_none'

    # Make the plot
    fcp.plot(df=df, x='Voltage', y='I [A]', legend=['Die', 'Substrate'], \
             filter='Target Wavelength==450 & Boost Level==0.2 & Temperature [C]==25',
             markers=['o', None, '+', '*', 'B', None],
             filename=name + '.png', inline=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
Beispiel #30
0
def test_log_exp(master=False, remove=True, show=False):

    name = osjoin(MASTER, 'log_exp_master') if master else 'log_exp'

    # Make the plot
    fcp.plot(df=df, x='Voltage', y='Voltage', show=SHOW, legend='Die',
             filter='Substrate=="Si" & Target Wavelength==450 & Boost Level==0.2 & Temperature [C]==25 & Die=="(-1,2)"',
             ax_scale='logy', ymin=0.00001, ymax=100000000, sci_y=True,
             filename=name + '.png', inline=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
import sys
sys.path.append(r'C:\GitHub\fivecentplots')
import fivecentplots as fcp
import pandas as pd

df = pd.read_csv(r'C:\GitHub\fivecentplots\fivecentplots\tests\fake_data.csv')
df_box = pd.read_csv(r'C:\GitHub\fivecentplots\fivecentplots\tests\fake_data_box.csv')
df_c = pd.read_csv(r'C:\GitHub\fivecentplots\fivecentplots\tests\fake_data_contour.csv')

# Single IV curve grouped by die
sub = df[(df.Substrate=='Si') &
         (df['Target Wavelength']==450) &
         (df['Boost Level']==0.2) &
         (df['Temperature [C]']==25).copy()
        ]
d = fcp.plot(df=sub, x='Voltage', y='I [A]', leg_groups='Die', show=True)

# Facet grid by boost level and temperature
sub = df[(df.Substrate=='Si') &
          (df['Target Wavelength']==450)].copy()
d = fcp.plot(df=sub, x='Voltage', y='I [A]', leg_groups='Die',
             row='Boost Level', col='Temperature [C]', xticks=4, show=True)

# Facet grid by boost level and temperature (no axis sharing)
sub = df[(df.Substrate=='Si') &
         (df['Target Wavelength']==450)].copy()
d = fcp.plot(df=sub, x='Voltage', y='I [A]', leg_groups='Die',
             row='Boost Level', col='Temperature [C]',
             sharex=False, sharey=False, ax_size=[200,300], show=True)

# Facet grid by boost level and temperature with transformation