def communities(ctx): infile = ctx.obj["infile"] outdir = ctx.obj["outdir"] outfile = ctx.obj["outfile"] two = ctx.obj["two"] runs = int(ctx.obj["runs"]) best = ctx.obj["best"] comms = Communities(infile) comms.compute_n_times(outdir, outfile, two, runs, best)
def communities(ctx): infile = ctx.obj['infile'] outdir = ctx.obj['outdir'] outfile = ctx.obj['outfile'] two = ctx.obj['two'] runs = int(ctx.obj['runs']) best = ctx.obj['best'] comms = Communities(infile) comms.compute_n_times(outdir, outfile, two, runs, best)
def generate_communities(self, two, runs, best): fname = '%s/metrics.csv' % self.outdir f = open(fname, 'w') f.write('per_distance,modularity,ncomms\n') for per_dist in self.percent_range(): graph_file = self.graph_path(per_dist) comm = Communities(graph_file) comm_file = self.comm_path(per_dist, False) comm_dir = self.comm_path(per_dist, True) modul, ncomms = comm.compute_n_times( comm_dir, comm_file, two, runs, best) f.write('%s,%s,%s\n' % (per_dist, modul, ncomms)) f.close()