<commit_before>from pyiem.plot import MapPlot
from matplotlib.collections import PatchCollection
from matplotlib.patches import Wedge
import matplotlib.patheffects as PathEffects

from pyiem import network
nt = network.Table("IA_ASOS")
import psycopg2
PGCONN = psycopg2.connect(database='coop', host='iemdb', user='nobody')
cursor = PGCONN.cursor()

data = [
        ['IOW', 4.12, 10.89, 'Iowa City'],
        ['OTM', 6.34, 12.36, 'Ottumwa'],
        ['SUX', 13.25, 8.78, 'Sioux City'],
        ['MCW', 6.75, 13.45, 'Mason City'],
        ['DBQ', 9.81, 14.28, 'Dubuque'],
        ['ALO', 6.37, 12.47, 'Waterloo'],
        ['DSM', 3.61, 15.79, 'Des Moines'],
        ['BRL', 8.52, 11.34, 'Burlington'],
        ['CID', 5.25, 12.02, 'Cedar Rapids'],
        ['EST', 9.09, 13.49, 'Esterville'],
        ['MIW', 5.27, 14.61, 'Marshalltown']
]
patches = []
m = MapPlot(sector='iowa',
            title='Amount of additional June precipitation needed to break local record',
            subtitle='1-23 June 2014 totals shown')

for row in data:
    #cursor.execute("""SELECT year, sum(precip) from alldata_ia where month =6
    #and year < 2014 and station = %s 
    #GROUP by year ORDER by sum DESC LIMIT 1""", (nt.sts[row[0]]['climate_site'],) )
    #row2 = cursor.fetchone()

    #ratio = row[1] / row2[1] * 360.
    #print row[0], row[1], row2[1], ratio
    ratio = min(row[1] / row[2] * 360., 360.)
    

    xy = m.map(nt.sts[row[0]]['lon'], nt.sts[row[0]]['lat'])
    patches.append(
        Wedge(xy, 20000, 0, ratio, width=10000, fc='b', fill=True, zorder=2)
                   )<commit_msg>correct CID number, sigh<commit_after>from pyiem.plot import MapPlot
from matplotlib.collections import PatchCollection
from matplotlib.patches import Wedge
import matplotlib.patheffects as PathEffects

from pyiem import network
nt = network.Table("IA_ASOS")
import psycopg2
PGCONN = psycopg2.connect(database='coop', host='iemdb', user='nobody')
cursor = PGCONN.cursor()

data = [
        ['IOW', 4.12, 10.89, 'Iowa City'],
        ['OTM', 6.34, 12.36, 'Ottumwa'],
        ['SUX', 13.25, 8.78, 'Sioux City'],
        ['MCW', 6.75, 13.45, 'Mason City'],
        ['DBQ', 9.81, 14.28, 'Dubuque'],
        ['ALO', 6.37, 12.47, 'Waterloo'],
        ['DSM', 3.61, 15.79, 'Des Moines'],
        ['BRL', 8.52, 11.34, 'Burlington'],
        ['CID', 8.93, 12.02, 'Cedar Rapids'],
        ['EST', 9.09, 13.49, 'Esterville'],
        ['MIW', 5.27, 14.61, 'Marshalltown']
]
patches = []
m = MapPlot(sector='iowa',
            title='Amount of additional June precipitation needed to break local record',
            subtitle='1-23 June 2014 totals shown')

for row in data:
    #cursor.execute("""SELECT year, sum(precip) from alldata_ia where month =6
    #and year < 2014 and station = %s 
    #GROUP by year ORDER by sum DESC LIMIT 1""", (nt.sts[row[0]]['climate_site'],) )
    #row2 = cursor.fetchone()

    #ratio = row[1] / row2[1] * 360.
    #print row[0], row[1], row2[1], ratio
    ratio = min(row[1] / row[2] * 360., 360.)
    

    xy = m.map(nt.sts[row[0]]['lon'], nt.sts[row[0]]['lat'])
    patches.append(
        Wedge(xy, 20000, 0, ratio, width=10000, fc='b', fill=True, zorder=2)
                   )
{'fraction_non_alphanumeric': 0.1841200375117224, 'fraction_numerical': 0.0787746170678337, 'mean_word_length': 2.9603960396039604, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '3479620', 'n_tokens_mistral': 1382, 'n_tokens_neox': 1182, 'n_words': 311}