TE Curve Verification Pipeline Curve-First Reranking

Build the CVP 1.1 curve-first reranking report from TE Curve Verification Pipeline metrics.

class scripts.reports.analysis.build_track2_curve_first_reranking_report.CandidateMetricSummary(rank, candidate_id, candidate_family, candidate_kind, candidate_source_label, candidate_surface, ranking_scope, direction_label, condition_count, mean_curve_mae_deg, mean_curve_rmse_deg, mean_percentage_error_pct, p95_mean_percentage_error_pct, worst_mean_percentage_error_pct, worst_curve_mae_deg, worst_curve_rmse_deg, std_mean_percentage_error_pct, valid_direction_list)[source]

Bases: object

Curve-first aggregate metrics for one candidate scope.

Parameters:
  • rank (int)

  • candidate_id (str)

  • candidate_family (str)

  • candidate_kind (str)

  • candidate_source_label (str)

  • candidate_surface (str)

  • ranking_scope (str)

  • direction_label (str)

  • condition_count (int)

  • mean_curve_mae_deg (float)

  • mean_curve_rmse_deg (float)

  • mean_percentage_error_pct (float)

  • p95_mean_percentage_error_pct (float)

  • worst_mean_percentage_error_pct (float)

  • worst_curve_mae_deg (float)

  • worst_curve_rmse_deg (float)

  • std_mean_percentage_error_pct (float)

  • valid_direction_list (tuple[str, ...])

rank: int
candidate_id: str
candidate_family: str
candidate_kind: str
candidate_source_label: str
candidate_surface: str
ranking_scope: str
direction_label: str
condition_count: int
mean_curve_mae_deg: float
mean_curve_rmse_deg: float
mean_percentage_error_pct: float
p95_mean_percentage_error_pct: float
worst_mean_percentage_error_pct: float
worst_curve_mae_deg: float
worst_curve_rmse_deg: float
std_mean_percentage_error_pct: float
valid_direction_list: tuple[str, ...]
ranking_key()[source]

Return the deterministic curve-first ordering key.

Return type:

tuple[float, float, float, float, str]

to_csv_row()[source]

Return a serializable CSV row.

Return type:

dict[str, Any]

scripts.reports.analysis.build_track2_curve_first_reranking_report.build_argument_parser()[source]

Build the command-line argument parser.

Return type:

ArgumentParser

scripts.reports.analysis.build_track2_curve_first_reranking_report.parse_command_line_arguments()[source]

Parse command-line arguments.

Return type:

Namespace

scripts.reports.analysis.build_track2_curve_first_reranking_report.resolve_runtime_project_relative_path(input_path)[source]

Resolve a project-relative or absolute runtime path.

Parameters:

input_path (Path)

Return type:

Path

scripts.reports.analysis.build_track2_curve_first_reranking_report.resolve_timestamped_output_paths(output_root, report_topic_root, report_date)[source]

Resolve timestamped output and report directories.

Parameters:
  • output_root (Path)

  • report_topic_root (Path)

  • report_date (str | None)

Return type:

tuple[str, Path, Path]

scripts.reports.analysis.build_track2_curve_first_reranking_report.find_latest_complete_track2_run(track2_root)[source]

Find the latest TE Curve Verification Pipeline run containing metrics and summary files.

Parameters:

track2_root (Path)

Return type:

Path

scripts.reports.analysis.build_track2_curve_first_reranking_report.load_yaml_file(yaml_path)[source]

Load a YAML mapping from disk.

Parameters:

yaml_path (Path)

Return type:

dict[str, Any]

scripts.reports.analysis.build_track2_curve_first_reranking_report.load_metrics_rows(metrics_path)[source]

Load TE Curve Verification Pipeline per-condition metric rows.

Parameters:

metrics_path (Path)

Return type:

list[dict[str, Any]]

scripts.reports.analysis.build_track2_curve_first_reranking_report.parse_float(value)[source]

Parse a numeric metric value.

Parameters:

value (Any)

Return type:

float

scripts.reports.analysis.build_track2_curve_first_reranking_report.format_float(value)[source]

Format a metric value for stable CSV and Markdown output.

Parameters:

value (float)

Return type:

str

scripts.reports.analysis.build_track2_curve_first_reranking_report.percentile(value_list, percentile_value)[source]

Compute a deterministic linear percentile without adding dependencies.

Parameters:
  • value_list (list[float])

  • percentile_value (float)

Return type:

float

scripts.reports.analysis.build_track2_curve_first_reranking_report.build_candidate_metadata_map(track2_summary)[source]

Build a candidate metadata lookup from the TE Curve Verification Pipeline summary.

Parameters:

track2_summary (dict[str, Any])

Return type:

dict[str, dict[str, Any]]

scripts.reports.analysis.build_track2_curve_first_reranking_report.build_candidate_summary(rank, candidate_id, row_list, metadata_map, ranking_scope, direction_label)[source]

Build one aggregate candidate summary.

Parameters:
  • rank (int)

  • candidate_id (str)

  • row_list (list[dict[str, Any]])

  • metadata_map (dict[str, dict[str, Any]])

  • ranking_scope (str)

  • direction_label (str)

Return type:

CandidateMetricSummary

scripts.reports.analysis.build_track2_curve_first_reranking_report.rerank_summaries(summary_list)[source]

Sort summaries and replace ranks after sorting.

Parameters:

summary_list (list[CandidateMetricSummary])

Return type:

list[CandidateMetricSummary]

scripts.reports.analysis.build_track2_curve_first_reranking_report.build_rankings(metrics_row_list, metadata_map)[source]

Build overall and direction-specific curve-first rankings.

Parameters:
  • metrics_row_list (list[dict[str, Any]])

  • metadata_map (dict[str, dict[str, Any]])

Return type:

tuple[list[CandidateMetricSummary], list[CandidateMetricSummary]]

scripts.reports.analysis.build_track2_curve_first_reranking_report.write_ranking_csv(csv_path, summary_list)[source]

Write a ranking CSV file.

Parameters:
Return type:

None

scripts.reports.analysis.build_track2_curve_first_reranking_report.build_surface_leader_map(overall_summary_list)[source]

Return the best candidate per candidate surface.

Parameters:

overall_summary_list (list[CandidateMetricSummary])

Return type:

dict[str, CandidateMetricSummary]

scripts.reports.analysis.build_track2_curve_first_reranking_report.load_scalar_program_best(program_best_path)[source]

Load the scalar registry best entry when available.

Parameters:

program_best_path (Path)

Return type:

dict[str, Any]

scripts.reports.analysis.build_track2_curve_first_reranking_report.markdown_table(header_list, row_list)[source]

Build a compact Markdown table.

Parameters:
  • header_list (list[str])

  • row_list (list[list[str]])

Return type:

list[str]

scripts.reports.analysis.build_track2_curve_first_reranking_report.build_summary_table_rows(summary_list, limit)[source]

Build Markdown table rows for candidate summaries.

Parameters:
Return type:

list[list[str]]

scripts.reports.analysis.build_track2_curve_first_reranking_report.build_direction_section(direction_summary_list, direction_label)[source]

Build one direction-specific report section.

Parameters:
Return type:

list[str]

scripts.reports.analysis.build_track2_curve_first_reranking_report.build_report_lines(run_instance_id, track2_run_directory, output_directory, overall_summary_list, direction_summary_list, track2_summary, scalar_best_entry)[source]

Build the Markdown report body.

Parameters:
  • run_instance_id (str)

  • track2_run_directory (Path)

  • output_directory (Path)

  • overall_summary_list (list[CandidateMetricSummary])

  • direction_summary_list (list[CandidateMetricSummary])

  • track2_summary (dict[str, Any])

  • scalar_best_entry (dict[str, Any])

Return type:

list[str]

scripts.reports.analysis.build_track2_curve_first_reranking_report.write_summary_yaml(summary_path, run_instance_id, track2_run_directory, output_directory, report_path, overall_summary_list, direction_summary_list)[source]

Write the machine-readable reranking summary.

Parameters:
  • summary_path (Path)

  • run_instance_id (str)

  • track2_run_directory (Path)

  • output_directory (Path)

  • report_path (Path)

  • overall_summary_list (list[CandidateMetricSummary])

  • direction_summary_list (list[CandidateMetricSummary])

Return type:

None

scripts.reports.analysis.build_track2_curve_first_reranking_report.main()[source]

Run the report generation workflow.

Return type:

None