Prototype geometry-driven rich graph renderer
This commit is contained in:
commit
b1a7bae1da
13 changed files with 3742 additions and 0 deletions
69
scripts/Measure-BenchmarkRun.ps1
Normal file
69
scripts/Measure-BenchmarkRun.ps1
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$RunDir
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$resolvedRunDir = (Resolve-Path $RunDir).Path
|
||||
$manifestPath = Join-Path $resolvedRunDir "run-manifest.json"
|
||||
if (-not (Test-Path $manifestPath)) {
|
||||
throw "No run-manifest.json found in $resolvedRunDir"
|
||||
}
|
||||
|
||||
$manifest = Get-Content -LiteralPath $manifestPath -Raw | ConvertFrom-Json
|
||||
$rows = New-Object System.Collections.Generic.List[object]
|
||||
|
||||
foreach ($candidate in $manifest.candidates) {
|
||||
$candidateDir = $candidate.directory
|
||||
$scoresPath = Join-Path $candidateDir "scores.json"
|
||||
if (-not (Test-Path $scoresPath)) {
|
||||
$rows.Add([pscustomobject]@{
|
||||
Candidate = $candidate.id
|
||||
Status = "missing scores.json"
|
||||
ProbeScore = $null
|
||||
ProbeMax = $null
|
||||
ProbePercent = $null
|
||||
ReadabilityAverage = $null
|
||||
})
|
||||
continue
|
||||
}
|
||||
|
||||
$scores = Get-Content -LiteralPath $scoresPath -Raw | ConvertFrom-Json
|
||||
$scoredProbes = @($scores.probeScores | Where-Object { $_.maxScore -gt 0 -and $null -ne $_.score })
|
||||
$probeScore = 0.0
|
||||
$probeMax = 0.0
|
||||
foreach ($probe in $scoredProbes) {
|
||||
$probeScore += [double]$probe.score
|
||||
$probeMax += [double]$probe.maxScore
|
||||
}
|
||||
|
||||
$readabilityScores = @(
|
||||
$scores.readability.labelLegibility,
|
||||
$scores.readability.edgeTraceability,
|
||||
$scores.readability.clusterReadability,
|
||||
$scores.readability.flowReadability,
|
||||
$scores.readability.clutterControl
|
||||
) | Where-Object { $null -ne $_ }
|
||||
|
||||
$readabilityAverage = $null
|
||||
if ($readabilityScores.Count -gt 0) {
|
||||
$readabilityAverage = [math]::Round((($readabilityScores | Measure-Object -Average).Average), 2)
|
||||
}
|
||||
|
||||
$probePercent = $null
|
||||
if ($probeMax -gt 0) {
|
||||
$probePercent = [math]::Round(($probeScore / $probeMax) * 100, 1)
|
||||
}
|
||||
|
||||
$rows.Add([pscustomobject]@{
|
||||
Candidate = $candidate.id
|
||||
Status = "scored"
|
||||
ProbeScore = [math]::Round($probeScore, 2)
|
||||
ProbeMax = [math]::Round($probeMax, 2)
|
||||
ProbePercent = $probePercent
|
||||
ReadabilityAverage = $readabilityAverage
|
||||
})
|
||||
}
|
||||
|
||||
$rows | Sort-Object ProbePercent -Descending | Format-Table -AutoSize
|
||||
Loading…
Reference in a new issue