MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / method_paths

Function method_paths

experiments/human_eval/build_main_human_eval_packet.py:124–147  ·  view source on GitHub ↗
(benchmark_dir: Path, requested: Sequence[str])

Source from the content-addressed store, hash-verified

122
123
124def method_paths(benchmark_dir: Path, requested: Sequence[str]) -> List[Tuple[str, str, Path]]:
125 if requested:
126 result = []
127 for spec in requested:
128 parts = spec.split("=", 2)
129 if len(parts) not in {2, 3}:
130 raise SystemExit("--method must use key=path or key=path=display name")
131 key, raw_path = parts[0], parts[1]
132 label = parts[2] if len(parts) == 3 else METHOD_LABELS.get(key, key)
133 path = Path(raw_path)
134 if path.is_dir():
135 path = path / "episode_papers.jsonl"
136 result.append((key, label, path))
137 return result
138
139 result: List[Tuple[str, str, Path]] = []
140 root_full = benchmark_dir / "episode_papers.jsonl"
141 if root_full.exists():
142 result.append(("full_paperflow", METHOD_LABELS["full_paperflow"], root_full))
143 main_dir = benchmark_dir / "main_experiment"
144 for path in sorted(main_dir.glob("*/episode_papers.jsonl")):
145 key = path.parent.name
146 result.append((key, METHOD_LABELS.get(key, key), path))
147 return result
148
149
150def dcg(gains: Iterable[float]) -> float:

Callers 1

mainFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected