示例#1
0
flect = np.median(potential_outl) + np.std(potential_outl)
import seaborn as sns
plt = sns.distplot(potential_outl)
plt.axvline(list(flect)[0], 0, 99999, linestyle='--')
potential_outl = potential_outl[potential_outl > flect]
plt.scatter(potential_outl)

outl_inds_bool = avg_codisp_df.loc[:, 'score'] > thresh
outl_inds_int = outl_inds_bool[outl_inds_bool].index
outl_vals = flagdf.loc[flagdf.index[outl_inds_int], c]
flagdf.loc[flagdf.index[outl_inds_int], c] = outl_vals + 2

df.loc[df.index[outl_inds_int], varname] = np.nan

#put upload id column back on

#notify user that it's done
email_template = 'static/email_templates/pipeline_complete.txt'
# email_template = '/home/mike/git/streampulse/server_copy/sp/static/email_templates/pipeline_complete.txt'
with open(email_template, 'r') as e:
    email_body = e.read()

tmpurl = 'https://data.streampulse.org/pipeline-complete/' + tmpcode
email_body = email_body % (region, site, tmpurl, tmpurl)

email_msg(email_body,
          'StreamPULSE upload complete',
          notificationEmail,
          header=False,
          render_html=True)
示例#2
0
import sys
import os
app_dir = '/home/aaron/sp'
#app_dir = '/home/mike/git/streampulse/server_copy/sp'
sys.path.insert(0, app_dir)
os.chdir(app_dir)
from helpers import email_msg
from sys import argv

#script_name, notificationEmail, tmpcode, region, site, report_filenames, tmpfile, files_to_remove = argv
notificationEmail = argv[1]
tmpcode = argv[2]
region = argv[3]
site = argv[4]
report_filenames = [x for x in argv[5:] if '/' not in x]

email_template = 'static/email_templates/error_notification.txt'
with open(email_template, 'r') as e:
    email_body = e.read()
email_body = email_body.format(filename=report_filenames)

tmpurl = 'https://data.streampulse.org/pipeline-complete-' + tmpcode
#tmpurl = 'http://127.0.0.1:5000/pipeline-complete-' + tmpcode

email_msg(email_body, 'StreamPULSE Error', notificationEmail,
    header=False, render_html=True)