for a in ax:
                    a.set_xlabel(a.get_ylabel())
                    a.set_ylabel('')
            plt.savefig('fig_' + file_log + '.png',
                        bbox_inches='tight',
                        pad_inches=0.5)
            plt.close()
    finally:
        if create_log:
            file_handler.flush()
            sct.remove_handler(file_handler)
        # send email
        if send_email:
            sct.log.info('\nSending email...')
            # open log file and read content
            with io.open(fname_log, "r") as fp:
                message = fp.read()
            # send email
            sct.send_email(addr_to=addr_to,
                           addr_from=addr_from,
                           subject=file_log,
                           message=message,
                           filename=fname_log,
                           login=login,
                           passwd=passwd_from,
                           smtp_host=smtp_host,
                           smtp_port=smtp_port,
                           html=True)
            # handle_log.send_email(email=email, passwd_from=passwd, subject=file_log, attachment=True)
            sct.log.info('Email sent!\n')
示例#2
0
                    sns.swarmplot(x='status', y=key, data=data_passed, ax=a, color='0.3', size=4)
                    i += 1
            if ax_array.size == 1:
                ax.set_xlabel(ax.get_ylabel())
                ax.set_ylabel('')
            else:
                for a in ax:
                    a.set_xlabel(a.get_ylabel())
                    a.set_ylabel('')
            plt.savefig('fig_' + file_log + '.png', bbox_inches='tight', pad_inches=0.5)
            plt.close()

    except Exception as err:
        if print_if_error:
            print err

    # stop file redirection
    if create_log:
        sys.stdout.close()
        sys.stdout = orig_stdout
        # display log file to Terminal
        handle_log = file(fname_log, 'r')
        message = handle_log.read()
        print message

    # send email
    if email:
        print 'Sending email...'
        sct.send_email(email, passwd_from=passwd, subject=file_log, message=message, filename=file_log + '.log')
        print 'done!'
示例#3
0
                ax.set_xlabel(ax.get_ylabel())
                ax.set_ylabel('')
            else:
                for a in ax:
                    a.set_xlabel(a.get_ylabel())
                    a.set_ylabel('')
            plt.savefig('fig_' + file_log + '.png',
                        bbox_inches='tight',
                        pad_inches=0.5)
            plt.close()
    finally:
        if create_log:
            file_handler.flush()
            sct.remove_handler(file_handler)
        # send email
        if send_email:
            sct.log.info('\nSending email...')
            # open log file and read content
            with open(fname_log, "r") as fp:
                message = fp.read()
            # send email
            sct.send_email(addr_to=addr_to,
                           addr_from=addr_from,
                           passwd_from=passwd_from,
                           subject=file_log,
                           message=message,
                           filename=fname_log,
                           html=True)
            # handle_log.send_email(email=email, passwd_from=passwd, subject=file_log, attachment=True)
            sct.log.info('Email sent!\n')
示例#4
0
        dict_mean = results_mean.to_dict()
        dict_mean.pop('status')
        dict_mean.pop('subject')
        print 'Mean: ' + str(dict_mean)
        dict_std = results_std.to_dict()
        dict_std.pop('status')
        dict_std.pop('subject')
        print 'STD: ' + str(dict_std)

        # print detailed results
        print '\nDETAILED RESULTS:'
        print results_display.to_string()
        print 'Status: 0: Passed | 1: Crashed | 99: Failed | 200: Input file(s) missing | 201: Ground-truth file(s) missing'

    except Exception as err:
        print err

    # stop file redirection
    if create_log:
        sys.stdout.close()
        sys.stdout = orig_stdout
        # display log file to Terminal
        handle_log = file(fname_log, 'r')
        message = handle_log.read()
        print message

    # send email
    if email:
        print 'Sending email...'
        sct.send_email(email, passwd_from=passwd, subject=file_log, message=message, filename=file_log+'.log')
        print 'done!'
                    sns.violinplot(x='status', y=key, data=data_passed, ax=a, inner="quartile", cut=0,
                                   scale="count", color='lightgray')
                    sns.swarmplot(x='status', y=key, data=data_passed, ax=a, color='0.3', size=4)
                    i += 1
            if ax_array.size == 1:
                ax.set_xlabel(ax.get_ylabel())
                ax.set_ylabel('')
            else:
                for a in ax:
                    a.set_xlabel(a.get_ylabel())
                    a.set_ylabel('')
            plt.savefig('fig_' + file_log + '.png', bbox_inches='tight', pad_inches=0.5)
            plt.close()
    finally:
        if create_log:
            file_handler.flush()
            sct.remove_handler(file_handler)
        # send email
        if send_email:
            logger.info('\nSending email...')
            # open log file and read content
            with io.open(fname_log, "r") as fp:
                message = fp.read()
            # send email
            sct.send_email(addr_to=addr_to, addr_from=addr_from,
             subject=file_log, message=message, filename=fname_log,
             login=login, passwd=passwd_from, smtp_host=smtp_host, smtp_port=smtp_port,
             html=True)
            # handle_log.send_email(email=email, passwd_from=passwd, subject=file_log, attachment=True)
            logger.info('Email sent!\n')