(parser: argparse.ArgumentParser)
| 27 | |
| 28 | |
| 29 | def configure_analysis_subcommands(parser: argparse.ArgumentParser) -> None: |
| 30 | subparsers = parser.add_subparsers(dest="analysis_command", required=True) |
| 31 | |
| 32 | summary_parser = subparsers.add_parser("summary", help="Summarize result JSONL files.") |
| 33 | _add_input_arguments(summary_parser) |
| 34 | _add_filter_arguments(summary_parser) |
| 35 | summary_parser.add_argument("--output", default=None, help="Optional JSON output path.") |
| 36 | |
| 37 | csv_parser = subparsers.add_parser("export-csv", help="Export flattened summary rows to CSV.") |
| 38 | _add_input_arguments(csv_parser) |
| 39 | _add_filter_arguments(csv_parser) |
| 40 | csv_parser.add_argument("--output", required=True, help="CSV output path.") |
| 41 | |
| 42 | matrix_parser = subparsers.add_parser("matrix", help="Build a grouped metric matrix.") |
| 43 | _add_input_arguments(matrix_parser) |
| 44 | _add_filter_arguments(matrix_parser) |
| 45 | matrix_parser.add_argument("--rows", default="benchmark", choices=available_group_fields()) |
| 46 | matrix_parser.add_argument("--cols", default="model", choices=available_group_fields()) |
| 47 | matrix_parser.add_argument( |
| 48 | "--metric", |
| 49 | default="success_rate", |
| 50 | choices=["success_rate", "count", "success_count", "failed_count", "total_runtime", "average_runtime"], |
| 51 | ) |
| 52 | matrix_parser.add_argument("--output", default=None, help="Optional CSV or JSON output path.") |
| 53 | |
| 54 | history_parser = subparsers.add_parser("history", help="Print histories from matching records.") |
| 55 | _add_input_arguments(history_parser) |
| 56 | _add_filter_arguments(history_parser) |
| 57 | history_parser.add_argument("--parsed", action="store_true", help="Parse workflow history entries.") |
| 58 | |
| 59 | fail_command_parser = subparsers.add_parser( |
| 60 | "fail-commands", |
| 61 | help="Collect commands from failed records grouped by the selected field.", |
| 62 | ) |
| 63 | _add_input_arguments(fail_command_parser) |
| 64 | _add_filter_arguments(fail_command_parser) |
| 65 | fail_command_parser.add_argument("--group-by", default="model_arch", choices=available_group_fields()) |
| 66 | |
| 67 | fail_reason_parser = subparsers.add_parser( |
| 68 | "fail-reasons", |
| 69 | help="Summarize failure reasons grouped by the selected field.", |
| 70 | ) |
| 71 | _add_input_arguments(fail_reason_parser) |
| 72 | _add_filter_arguments(fail_reason_parser) |
| 73 | fail_reason_parser.add_argument("--group-by", default="model_arch", choices=available_group_fields()) |
| 74 | |
| 75 | plot_parser = subparsers.add_parser("plot", help="Render a grouped bar chart from result data.") |
| 76 | _add_input_arguments(plot_parser) |
| 77 | _add_filter_arguments(plot_parser) |
| 78 | plot_parser.add_argument("--x", default="model", choices=available_group_fields()) |
| 79 | plot_parser.add_argument("--series", default="arch", choices=available_group_fields()) |
| 80 | plot_parser.add_argument( |
| 81 | "--metric", |
| 82 | default="success_rate", |
| 83 | choices=["success_rate", "count", "success_count", "failed_count", "total_runtime", "average_runtime"], |
| 84 | ) |
| 85 | plot_parser.add_argument("--output", required=True, help="Plot output path, such as chart.png.") |
| 86 | plot_parser.add_argument("--title", default=None, help="Optional chart title.") |
no test coverage detected