def fill_snapshot(snap): a=str(my.read_a(snap)) print('a read: ', a) z=str(my.read_z(snap)) print('z read: ', z) nhalo=str(get_nhalo(snap)) print('nhalo:', nhalo) cmd = "INSERT INTO snapshot(snap,a,z,nhalo,sim,atime) " cmd += " VALUES ('" cmd += str(snap)+"','"+a+"','"+z+"','"+nhalo+"','"+get_active_sim() cmd += "', now())" cmd += " ON DUPLICATE KEY UPDATE atime=now();" my.sql(cmd) my.sql("ALTER TABLE snapshot ORDER BY snap DESC;")
def fill_snapshot(snap): a = str(my.read_a(snap)) print 'a read: ', a z = str(my.read_z(snap)) print 'z read: ', z nhalo = str(get_nhalo(snap)) print 'nhalo:', nhalo cmd = "INSERT INTO snapshot(snap,a,z,nhalo,atime) " cmd += " VALUES ('" cmd += str(snap) + "','" + a + "','" + z + "','" + nhalo cmd += "', now())" cmd += " ON DUPLICATE KEY UPDATE atime=now();" my.sql(cmd) my.sql("alter table snapshot order by snap desc;")
def fill_snapshot(snap): a=str(my.read_a(snap)) print 'a read: ',a z=str(my.read_z(snap)) print 'z read: ',z nhalo=str(get_nhalo(snap)) print 'nhalo:',nhalo cmd = "INSERT INTO snapshot(snap,a,z,nhalo,atime) " cmd += " VALUES ('" cmd += str(snap)+"','"+a+"','"+z+"','"+nhalo cmd += "', now())" cmd += " ON DUPLICATE KEY UPDATE atime=now();" my.sql(cmd) my.sql("alter table snapshot order by snap desc;")