Skip to content

Commit 86d4f21

Browse files
last three per population
1 parent 8cd7d08 commit 86d4f21

File tree

1 file changed

+32
-10
lines changed

1 file changed

+32
-10
lines changed

index.html

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,19 +124,41 @@
124124

125125
// Wait for table to initialize and set default selections
126126
tableExplorer.initialized.then(() => {
127-
// Select last curated group and last 3 CI groups (all seeds in each group)
127+
// For each algorithm-environment pair, select:
128+
// - Most recent curated run (if exists)
129+
// - 3 most recent CI runs (if exist)
128130
const allGroups = tableExplorer.groupedRuns;
129-
const curatedGroups = allGroups.filter(g => g.source === 'curated');
130-
const ciGroups = allGroups.filter(g => g.source === 'ci');
131131

132-
// Flatten to get individual runs from selected groups
133-
const defaultGroups = [
134-
...(curatedGroups.length > 0 ? [curatedGroups[0]] : []),
135-
...ciGroups.slice(0, 3)
136-
];
132+
// Group by algorithm-environment pair
133+
const algoEnvPairs = {};
134+
for (const group of allGroups) {
135+
const key = `${group.algorithm}_${group.environment}`;
136+
if (!algoEnvPairs[key]) {
137+
algoEnvPairs[key] = {
138+
curated: [],
139+
ci: []
140+
};
141+
}
142+
if (group.source === 'curated') {
143+
algoEnvPairs[key].curated.push(group);
144+
} else if (group.source === 'ci') {
145+
algoEnvPairs[key].ci.push(group);
146+
}
147+
}
148+
149+
// For each pair, select the most recent runs
150+
const selectedGroups = [];
151+
for (const [key, groups] of Object.entries(algoEnvPairs)) {
152+
// Add most recent curated run
153+
if (groups.curated.length > 0) {
154+
selectedGroups.push(groups.curated[0]);
155+
}
156+
// Add 3 most recent CI runs
157+
selectedGroups.push(...groups.ci.slice(0, 3));
158+
}
137159

138-
// Extract all individual runs from these groups
139-
const defaultSelections = defaultGroups.flatMap(g => g.runs);
160+
// Extract all individual runs from selected groups
161+
const defaultSelections = selectedGroups.flatMap(g => g.runs);
140162

141163
if (defaultSelections.length > 0) {
142164
tableExplorer.setSelectedRuns(defaultSelections);

0 commit comments

Comments
 (0)