From fec374acd9a049e6a052d3727b5da46eb29cd01d Mon Sep 17 00:00:00 2001 From: v hewes Date: Wed, 2 Aug 2023 09:58:56 -0400 Subject: [PATCH] remove outdated scripts --- example/plot.py | 18 -------------- example/process.py | 61 ---------------------------------------------- h5merge.py | 45 ---------------------------------- 3 files changed, 124 deletions(-) delete mode 100644 example/plot.py delete mode 100755 example/process.py delete mode 100644 h5merge.py diff --git a/example/plot.py b/example/plot.py deleted file mode 100644 index bd01eff..0000000 --- a/example/plot.py +++ /dev/null @@ -1,18 +0,0 @@ - -if __name__ == "__main__": - import sys, os.path as osp - sys.path.append(osp.dirname(osp.dirname(osp.realpath(__file__)))) - import numl, glob, torch, matplotlib.pyplot as plt - - graphs = glob.glob(sys.argv[1]+"/*") - - for graph in graphs: - print(f"plotting graph {osp.basename(graph)}") - data = torch.load(graph) - name = osp.splitext(osp.basename(graph))[0] - numl.plot.graph.plot_edge_score(data, data["y_edge"]) - plt.savefig(name+"_edge.png") - plt.close() - numl.plot.graph.plot_node_score(data, data["y"]) - plt.savefig(name+"_node.png") - plt.close() diff --git a/example/process.py b/example/process.py deleted file mode 100755 index dcce589..0000000 --- a/example/process.py +++ /dev/null @@ -1,61 +0,0 @@ -import sys -import pynuml -import glob -import getopt - -def main(argv): - profiling = False - use_seq_cnt = True - inputfile = "" - outputfile = "" - output_h5 = False - overwrite = False - evt_partition = 2 - usage_str = "Usage: process.py [-p|-s|-f|-5|-d num] -i -o " - try: - opts, args = getopt.getopt(argv,"hpsf5d:i:o:",["ifile=","ofile="]) - except getopt.GetoptError: - print(usage_str) - sys.exit(2) - for opt, arg in opts: - if opt == "-h": - print(usage_str) - sys.exit() - elif opt in ("-i", "--ifile"): # input file name - inputfile = arg - elif opt in ("-o", "--ofile"): # output file prefix name if '-5' is used - outputfile = arg # output folder name for pytorch files - elif opt == "-5": # output file in HDF5 files, one per MPI process - output_h5 = True - elif opt == "-p": # enable timing profiling and outputs - profiling = True - elif opt == "-s": # use partitioning dataset evt.seq instead of evt.seq_cnt - use_seq_cnt = False - elif opt == "-f": # overwrite the output file, if exists - overwrite = True - elif opt == "-d": # event partition method. - evt_partition = arg - # if arg == 0: use event ID based - # elif arg == 1: use event amount based - # elif arg == 2: use event amount in paticle table - - if inputfile == "" or outputfile == "": - print(usage_str) - sys.exit(2) - - if output_h5: - # output HDF5 files, one graph per group, one file per MPI process - out = pynuml.io.H5Out(outputfile, overwrite) - else: - # output pytorch files, one graph per file - out = pynuml.io.PTOut(outputfile) - - pynuml.process.hitgraph.process_file(out, inputfile, - l=pynuml.labels.standard, - use_seq_cnt=use_seq_cnt, - evt_part=evt_partition, - profile=profiling) - -if __name__ == "__main__": - main(sys.argv[1:]) - diff --git a/h5merge.py b/h5merge.py deleted file mode 100644 index 1c60731..0000000 --- a/h5merge.py +++ /dev/null @@ -1,45 +0,0 @@ -import sys, os -import getopt -import h5py - -def merge(inputfile, outputfile): - print("input file name =",inputfile) - print("output file name =",outputfile) - - with open(inputfile) as f: - in_files = f.read().splitlines() - - for fname in in_files: - print("copy file:", fname) - f = h5py.File(fname,'r') - d_struct = {} - d_struct[fname] = f.keys() - for j in d_struct[fname]: - # print("copy j:", j) - os.system('h5copy -i %s -o %s -s %s -d %s' % (fname, outputfile, j, j)) - f.close() - -if __name__ == "__main__": - inputfile = "" - outputfile = "" - - try: - opts, args = getopt.getopt(sys.argv[1:],"hi:o:",["ifile=","ofile="]) - except getopt.GetoptError: - print("Usage: "+sys.argv[0]+" -i -o ") - sys.exit(2) - for opt, arg in opts: - if opt == "-h": - print("Usage: "+sys.argv[0]+" -i -o ") - sys.exit() - elif opt in ("-i", "--ifile"): - inputfile = arg - elif opt in ("-o", "--ofile"): - outputfile = arg - - if inputfile == "" or outputfile == "": - print("Usage: "+sys.argv[0]+" -i -o ") - sys.exit(2) - - merge(inputfile, outputfile) -