def gen_graph(ctx): dbname = ctx.obj["dbname"] outfile = ctx.obj["outfile"] table = ctx.obj["table"] db = DB(dbname, ctx.obj["config"]) db.open() gg = GenGraph(db, outfile, table) gg.generate() db.close()
def gen_graph(ctx): dbname = ctx.obj['dbname'] outfile = ctx.obj['outfile'] table = ctx.obj['table'] db = DB(dbname, ctx.obj['config']) db.open() gg = GenGraph(db, outfile, table) gg.generate() db.close()
def generate_graphs(self, db, scale, table): fd = FilterDists(db) graph_file = self.graph_path(100) if os.path.isfile(graph_file): print('full graph file found: %s' % graph_file) else: print('generating: %s' % graph_file) gg = GenGraph(db, outfile=graph_file, table=table) gg.generate() for per in self.percent_range(): if per < 100: filtered_file = self.graph_path(per) print('generating: %s' % filtered_file) max_dist = self.dist(per, scale) fd.filter(graph_file, filtered_file, max_dist) print('done.')