Parse command line arguments.
()
| 271 | |
| 272 | |
| 273 | def parse_args() -> argparse.Namespace: |
| 274 | """Parse command line arguments.""" |
| 275 | parser = argparse.ArgumentParser( |
| 276 | description="Analyze and merge experiment results from saved experiments.", |
| 277 | formatter_class=argparse.RawDescriptionHelpFormatter, |
| 278 | epilog=""" |
| 279 | Examples: |
| 280 | uv run scripts_python/analyze.py -o my_analysis |
| 281 | uv run scripts_python/analyze.py -o my_analysis --migration custom.yaml |
| 282 | uv run scripts_python/analyze.py -o my_analysis -e experiments |
| 283 | """, |
| 284 | ) |
| 285 | parser.add_argument( |
| 286 | "-o", |
| 287 | "--output-directory", |
| 288 | required=True, |
| 289 | help="Name of output directory (will be created in dev/analysis/)", |
| 290 | ) |
| 291 | parser.add_argument( |
| 292 | "--migration", |
| 293 | default=None, |
| 294 | help="Migration YAML file name (in shared/migrations/analysis/). Defaults to default.yaml", |
| 295 | ) |
| 296 | parser.add_argument( |
| 297 | "-e", |
| 298 | "--experiment-directory", |
| 299 | default="experiments_saved", |
| 300 | help="Directory containing experiment results. Defaults to experiments_saved", |
| 301 | ) |
| 302 | return parser.parse_args() |
| 303 | |
| 304 | |
| 305 | def main(): |