<commit_before>"""
 Create a Shapefile with yearly erosion summarized by huc12

THIS IS EXPORTING DELIVERY AT THE MOMENT

"""
import subprocess


def do(year):
    """ Process this year """
    subprocess.call(""" pgsql2shp -f idep%s.shp -h localhost -p 5555 -u mesonet -g geom idep  "select i.geom, r.huc_12, sum(avg_delivery) as loss  from results_by_huc12 r JOIN ia_huc12 i on (i.huc_12 = r.huc_12)  where valid between '%s-01-01' and '%s-01-01' and avg_delivery >= 0 and avg_delivery < 1000 and scenario = 0 GROUP by r.huc_12, i.geom" """ % (year, year, year+1), shell=True)


for yr in range(2007,2015):
    do(yr)<commit_msg>dump runoff totals as well<commit_after>"""
 Create a Shapefile with yearly erosion summarized by huc12

THIS IS EXPORTING DELIVERY AT THE MOMENT

"""
import subprocess


def do(year):
    """ Process this year """
    subprocess.call(('pgsql2shp -f idep%s.shp -h localhost -p 5555 '
                     '-u mesonet -g geom idep  "select i.geom, r.huc_12, '
                     'sum(avg_delivery) as delivery, '
                     'sum(avg_runoff) as runoff from results_by_huc12 r '
                     'JOIN ia_huc12 i on (i.huc_12 = r.huc_12) where '
                     'valid between \'%s-01-01\' and \'%s-01-01\' '
                     'and avg_delivery >= 0 and avg_delivery < 1000 '
                     'and scenario = 0 GROUP by r.huc_12, i.geom" '
                     '') % (year, year, year+1), shell=True)


for yr in range(2007,2015):
    do(yr)
{'fraction_non_alphanumeric': 0.11823647294589178, 'fraction_numerical': 0.056112224448897796, 'mean_word_length': 2.4123006833712983, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4879166', 'n_tokens_mistral': 622, 'n_tokens_neox': 528, 'n_words': 165}