This commit is contained in:
parent
2577d105f5
commit
08514ad69e
|
|
@ -551,7 +551,7 @@ def courses_to_sched():
|
||||||
|
|
||||||
|
|
||||||
# Populate schedule table and correlate to courses table
|
# Populate schedule table and correlate to courses table
|
||||||
def refresh_semester_schedule_db(term="fa25"):
|
def refresh_semester_schedule_db(term="sp26"):
|
||||||
|
|
||||||
# TODO: fix units when they are variable... change to float in between range. round to 0.5 unit.
|
# TODO: fix units when they are variable... change to float in between range. round to 0.5 unit.
|
||||||
|
|
||||||
|
|
@ -612,22 +612,25 @@ def refresh_semester_schedule_db(term="fa25"):
|
||||||
full_sis_code = sis_code+'-'+c['crn']
|
full_sis_code = sis_code+'-'+c['crn']
|
||||||
|
|
||||||
if full_sis_code in sis_to_sched:
|
if full_sis_code in sis_to_sched:
|
||||||
print(c['cred'])
|
shell_id = sis_to_sched[full_sis_code][0][0]
|
||||||
q = [sis_to_sched[full_sis_code][0][0], c['crn'], c['code'], c['cred'], c['teacher'], c['start'], c['end'], c['type'], c['loc'], c['site'], pod, int(c['cap']), int(c['act']), sis_code]
|
|
||||||
vals_cache.append( q ) # [ str(x) for x in q ] )
|
|
||||||
#print(f"{i}: {q}")
|
|
||||||
i += 1
|
|
||||||
if i % 100 == 0:
|
|
||||||
if EXECUTE:
|
|
||||||
cur.executemany(query, vals_cache)
|
|
||||||
conn.commit()
|
|
||||||
vals_cache = []
|
|
||||||
t = time.process_time()
|
|
||||||
delta = t - last_time
|
|
||||||
last_time = t
|
|
||||||
print(f"Loop {i} - committed to db in %0.3fs. " % delta, flush=True)
|
|
||||||
else:
|
else:
|
||||||
print(f"{full_sis_code} not in canvas courses.")
|
print(f"{full_sis_code} not in canvas courses.")
|
||||||
|
shell_id = 1
|
||||||
|
#print(c['cred'])
|
||||||
|
q = [shell_id, c['crn'], c['code'], c['cred'], c['teacher'], c['start'], c['end'], c['type'], c['loc'], c['site'], pod, int(c['cap']), int(c['act']), sis_code]
|
||||||
|
print(q)
|
||||||
|
vals_cache.append( q ) # [ str(x) for x in q ] )
|
||||||
|
#print(f"{i}: {q}")
|
||||||
|
i += 1
|
||||||
|
if i % 100 == 0:
|
||||||
|
if EXECUTE:
|
||||||
|
cur.executemany(query, vals_cache)
|
||||||
|
conn.commit()
|
||||||
|
vals_cache = []
|
||||||
|
t = time.process_time()
|
||||||
|
delta = t - last_time
|
||||||
|
last_time = t
|
||||||
|
print(f"Loop {i} - committed to db in %0.3fs. " % delta, flush=True)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue