def preprocess(in_files, raw_input): def preprocess_each(in_file, raw_input): out_file = os.path.basename(in_file).split('.')[0] os_sys("collectl -p {0} -P -oU -scdmn --sep 9 > {1}/{2}".format(in_file, raw_input, out_file)) print("Save preprocessed file %s to %s" % (out_file, os.path.relpath(raw_input))) return os.path.join(raw_input, out_file) os_sys("mkdir -p %s" % raw_input) return [preprocess_each(in_file, raw_input) for in_file in in_files]
def preprocess(in_files, raw_input): preprocessed = [] cmd = "" for in_file in in_files: out_file = os.path.basename(in_file).split('.')[0] cmd = "{3} echo 'Save preprocessed file {2} to {4}' && collectl -p {0} -P -oU -scdmn --sep 9 > {1}/{2} &".format( in_file, raw_input, out_file, cmd, os.path.relpath(raw_input)) preprocessed.append(os.path.join(raw_input, out_file)) os_sys("mkdir -p {0}".format(raw_input)) cmd = "{0} wait".format(cmd) os_sys(cmd) return preprocessed
def main(args): conf = Conf(args) if args.raw_input: conf.in_files = preprocess(conf.in_files, os.path.dirname(os.path.abspath(args.input[0])) + "/dat") if args.to_plot is False: return # Create output dir in case it does not exist os_sys('mkdir -p %s' % conf.output) Painter(conf).plot_all()
def main(args): # Create output dir in case it does not exist os_sys('mkdir -p %s' % args.output) Painter(args).plot_all()