<commit_before># Name of the game, figure out 15 min deltas, dump to netCDF

from pyIEM import iemAccess, iemAccessDatabase
iemdb = iemAccessDatabase.iemAccessDatabase()
import mx.DateTime

# First, we get a dict going of our current obs
rs = iemdb.query("""SELECT *, x(geom) as lon, y(geom) as lat 
	from current WHERE 
	(valid + '15 minutes'::interval) > CURRENT_TIMESTAMP and
    alti is not Null""").dictresult()
c = {}
for i in range(len(rs)):
	id = rs[i]["station"]
	c[id] = {}
	c[id] = rs[i]

# Now, we get obs from a 20 minute window, one hour ago
now = mx.DateTime.now()
w0 = now + mx.DateTime.RelativeDateTime(minutes=-20)
w1 = now + mx.DateTime.RelativeDateTime(minutes=-10)


sql = "SELECT * from current_log WHERE \
	valid BETWEEN '%s' and '%s'" % (w0.strftime("%Y-%m-%d %H:%M"), \
	w1.strftime("%Y-%m-%d %H:%M") ) 
rs = iemdb.query(sql).dictresult()
lh = {}
for i in range(len(rs)):
	id = rs[i]["station"]
	lh[id] = {}
	lh[id] = rs[i]
# Now lets run through the obs
for id in c.keys():
	if (not lh.has_key(id)): continue
	d = c[id]["alti"] - lh[id]["alti"]
	if (d == 0):
		d = c[id]["pres"] - lh[id]["pres"]<commit_msg>exposing new bug here after new access code ;(<commit_after># Name of the game, figure out 15 min deltas, dump to netCDF

from pyIEM import iemAccess, iemAccessDatabase
iemdb = iemAccessDatabase.iemAccessDatabase()
import mx.DateTime

# First, we get a dict going of our current obs
rs = iemdb.query("""SELECT *, x(geom) as lon, y(geom) as lat 
	from current WHERE 
	(valid + '15 minutes'::interval) > CURRENT_TIMESTAMP and
    alti is not Null""").dictresult()
c = {}
for i in range(len(rs)):
	id = rs[i]["station"]
	c[id] = {}
	c[id] = rs[i]

# Now, we get obs from a 20 minute window, one hour ago
now = mx.DateTime.now()
w0 = now + mx.DateTime.RelativeDateTime(minutes=-20)
w1 = now + mx.DateTime.RelativeDateTime(minutes=-10)


sql = "SELECT * from current_log WHERE \
	valid BETWEEN '%s' and '%s'" % (w0.strftime("%Y-%m-%d %H:%M"), \
	w1.strftime("%Y-%m-%d %H:%M") ) 
rs = iemdb.query(sql).dictresult()
lh = {}
for i in range(len(rs)):
	id = rs[i]["station"]
	lh[id] = {}
	lh[id] = rs[i]
# Now lets run through the obs
for id in c.keys():
	if (not lh.has_key(id)): continue
	d = c[id]["alti"] - lh[id]["alti"]
	if d == 0 and c[id]['pres'] is not None and lh[id]['pres'] is not None:
		d = c[id]["pres"] - lh[id]["pres"]
{'fraction_non_alphanumeric': 0.1823579304495335, 'fraction_numerical': 0.01272264631043257, 'mean_word_length': 4.139433551198257, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3713616', 'n_tokens_mistral': 965, 'n_tokens_neox': 935, 'n_words': 279}