Skip to content

Commit 9664363

Browse files
committed
pass arguemnts to run_all_evals.py
1 parent 4f42712 commit 9664363

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

run_all_evals.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ def build_eval_command(owl_path: str, args, output_csv: str) -> list:
7878
cmd.extend(["--ratio_sample_object_prop", str(args.ratio_sample_object_prop)])
7979
if args.verbose:
8080
cmd.append("--verbose")
81+
if args.timeout is not None:
82+
cmd.extend(["--timeout", str(args.timeout)])
8183
return cmd
8284

8385

@@ -208,6 +210,26 @@ def run_eval_for_reasoner(ontologies, reasoner, output_dir, args):
208210
print(f"[{reasoner}] [{i+1}/{len(ontologies)}] {label} ({owl_path})")
209211
print(f"{'='*80}")
210212

213+
# Skip if results already exist
214+
if args.skip_existing and os.path.isfile(csv_path):
215+
print(f" [SKIP] Results already exist: {csv_path}")
216+
# Still collect results for the summary
217+
skipped_csv = csv_path.replace(".csv", "_skipped.csv")
218+
num_skipped = 0
219+
if os.path.isfile(skipped_csv):
220+
import pandas as pd
221+
num_skipped = len(pd.read_csv(skipped_csv))
222+
results.append({
223+
"label": label,
224+
"owl_path": owl_path,
225+
"status": "success",
226+
"runtime_s": 0.0,
227+
"csv_path": csv_path,
228+
"log_path": log_path if os.path.isfile(log_path) else None,
229+
"num_skipped": num_skipped,
230+
})
231+
continue
232+
211233
cmd = build_eval_command(owl_path, args_copy, csv_path)
212234
print(f"Command: {' '.join(cmd)}")
213235

@@ -273,6 +295,10 @@ def main():
273295
parser.add_argument("--ratio_sample_nc", type=float, default=None)
274296
parser.add_argument("--ratio_sample_object_prop", type=float, default=None)
275297
parser.add_argument("--verbose", action="store_true")
298+
parser.add_argument("--timeout", type=float, default=10,
299+
help="Timeout in seconds per CE for the GT reasoner (default: 10)")
300+
parser.add_argument("--skip_existing", action="store_true",
301+
help="Skip ontologies that already have eval_results.csv in the output directory")
276302
args = parser.parse_args()
277303

278304
# Discover ontologies

0 commit comments

Comments
 (0)