Promote Tier2 row and trailer crossover matrix

This commit is contained in:
Jan Petykiewicz 2026-04-21 18:33:13 -07:00
commit 08819c19a4
6 changed files with 139 additions and 11 deletions

View file

@ -67,6 +67,8 @@ pub(crate) struct RuntimeCandidateTableNamedRunScanReport {
pub(crate) port00_warehouse00_row_pair_map_paths: BTreeMap<String, Vec<String>>,
pub(crate) numbered_port_warehouse_trailer_family_map_counts: BTreeMap<String, usize>,
pub(crate) numbered_port_warehouse_trailer_family_map_paths: BTreeMap<String, Vec<String>>,
pub(crate) row_pair_and_numbered_trailer_family_map_counts: BTreeMap<String, usize>,
pub(crate) row_pair_and_numbered_trailer_family_map_paths: BTreeMap<String, Vec<String>>,
pub(crate) skipped_file_count: usize,
pub(crate) samples: Vec<RuntimeCandidateTableNamedRunScanSample>,
}
@ -79,6 +81,8 @@ struct RuntimeCandidateTableNamedRunAggregates {
port00_warehouse00_row_pair_map_paths: BTreeMap<String, Vec<String>>,
numbered_port_warehouse_trailer_family_map_counts: BTreeMap<String, usize>,
numbered_port_warehouse_trailer_family_map_paths: BTreeMap<String, Vec<String>>,
row_pair_and_numbered_trailer_family_map_counts: BTreeMap<String, usize>,
row_pair_and_numbered_trailer_family_map_paths: BTreeMap<String, Vec<String>>,
}
pub(crate) fn scan_candidate_table_headers(
@ -227,6 +231,10 @@ pub(crate) fn scan_candidate_table_named_runs(
.numbered_port_warehouse_trailer_family_map_counts,
numbered_port_warehouse_trailer_family_map_paths: aggregates
.numbered_port_warehouse_trailer_family_map_paths,
row_pair_and_numbered_trailer_family_map_counts: aggregates
.row_pair_and_numbered_trailer_family_map_counts,
row_pair_and_numbered_trailer_family_map_paths: aggregates
.row_pair_and_numbered_trailer_family_map_paths,
skipped_file_count,
samples,
};
@ -435,22 +443,24 @@ fn build_named_run_aggregates(
aggregates.files_with_warehouse01_11_run_at_56_66_count += 1;
}
if let (Some(port00_run), Some(warehouse00_run)) = (
let row_pair_key = if let (Some(port00_run), Some(warehouse00_run)) = (
find_named_run_by_names(&sample.port_runs, "Port00", "Port00", 1),
find_named_run_by_names(&sample.warehouse_runs, "Warehouse00", "Warehouse00", 1),
) {
let row_pair_key =
format!("{}/{}", port00_run.start_index, warehouse00_run.start_index);
let row_pair_key = format!("{}/{}", port00_run.start_index, warehouse00_run.start_index);
*aggregates
.port00_warehouse00_row_pair_map_counts
.entry(row_pair_key.clone())
.or_insert(0) += 1;
aggregates
.port00_warehouse00_row_pair_map_paths
.entry(row_pair_key)
.entry(row_pair_key.clone())
.or_default()
.push(sample.path.clone());
}
Some(row_pair_key)
} else {
None
};
if let (Some(port_run), Some(warehouse_run)) = (
find_named_run(&sample.port_runs, "Port01", "Port11", 45, 55, 11),
@ -476,9 +486,22 @@ fn build_named_run_aggregates(
.or_insert(0) += 1;
aggregates
.numbered_port_warehouse_trailer_family_map_paths
.entry(trailer_family_key)
.entry(trailer_family_key.clone())
.or_default()
.push(sample.path.clone());
if let Some(row_pair_key) = &row_pair_key {
let combined_key = format!("{row_pair_key} :: {trailer_family_key}");
*aggregates
.row_pair_and_numbered_trailer_family_map_counts
.entry(combined_key.clone())
.or_insert(0) += 1;
aggregates
.row_pair_and_numbered_trailer_family_map_paths
.entry(combined_key)
.or_default()
.push(sample.path.clone());
}
}
}
@ -494,6 +517,12 @@ fn build_named_run_aggregates(
{
paths.sort();
}
for paths in aggregates
.row_pair_and_numbered_trailer_family_map_paths
.values_mut()
{
paths.sort();
}
aggregates
}
@ -614,6 +643,26 @@ mod tests {
.unwrap_or_default(),
vec!["State of Germany.gmp".to_string()]
);
assert_eq!(
aggregates
.row_pair_and_numbered_trailer_family_map_counts
.get("35/43 :: 0x00000001"),
Some(&1)
);
assert_eq!(
aggregates
.row_pair_and_numbered_trailer_family_map_counts
.get("10/18 :: 0x00000000"),
Some(&1)
);
assert_eq!(
aggregates
.row_pair_and_numbered_trailer_family_map_paths
.get("35/43 :: 0x00000001")
.cloned()
.unwrap_or_default(),
vec!["Louisiana.gmp".to_string()]
);
}
fn sample_run(