Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
998 B · 29 lines
Python
at develop
123456789101112131415161718192021222324252627282930import csvimport osimport sysfrom pathlib import Path
assert len(sys.argv) >= 2benchmarks_location = sys.argv[1]
writer = csv.writer(sys.stdout, dialect="unix")writer.writerow(("problem", "model", "data_file"))for root, _, files in os.walk(benchmarks_location): for name in files: if name.endswith(".mzn"): problem = root.split(os.sep)[-1] datafiles = 0 for nroot, _, nfiles in os.walk(root): for nname in nfiles: if nname.endswith(".dzn") or nname.endswith(".json"): datafiles = datafiles + 1 writer.writerow( ( problem, Path(root + "/" + name), Path(nroot + "/" + nname), ) )
if datafiles == 0: writer.writerow((problem, Path(root + "/" + name), ""))