Skip to content

Overhaul reference comparison: new error metrics, DataFrames CSV, richer HTML table#28

Draft
AnHeuermann wants to merge 4 commits intomainfrom
improve-html
Draft

Overhaul reference comparison: new error metrics, DataFrames CSV, richer HTML table#28
AnHeuermann wants to merge 4 commits intomainfrom
improve-html

Conversation

@AnHeuermann
Copy link
Member

Changes

Replace the per-point _check_point / error_fn dispatch with two vectorised helpers (_absolute_error, _scaled_relative_error) and a globally-scaled relative tolerance check. abs_tol is now optional (nothing = disabled, shown as ∞ in the HTML); when set it acts as an independent hard threshold rather than a per-point floor.

Switch diff-CSV output from manual text-mode writing to DataFrames.jl + CSV.jl; the new format includes _abserr and _relerr columns for every failing signal.

Improve the _diff.html variable-coverage table:

  • Add "Max Abs Error" (scientific notation) and "Max Rel Error" (percent) columns for both passing and failing signals.
  • Read per-signal max errors for failing signals directly from the diff CSV.
  • Hide the abs-tolerance from the meta line when abs_tol is nothing.

Thread settings::CompareSettings explicitly through test_model and main; remove the module-level _CMP_SETTINGS global and the configure_comparison! / compare_settings API.

AnHeuermann and others added 2 commits March 17, 2026 16:47
…her HTML table

Replace the per-point `_check_point` / `error_fn` dispatch with two
vectorised helpers (`_absolute_error`, `_scaled_relative_error`) and a
globally-scaled relative tolerance check.  `abs_tol` is now optional
(`nothing` = disabled, shown as ∞ in the HTML); when set it acts as an
independent hard threshold rather than a per-point floor.

Switch diff-CSV output from manual text-mode writing to DataFrames.jl +
CSV.jl; the new format includes `_abserr` and `_relerr` columns for every
failing signal.

Improve the `_diff.html` variable-coverage table:
- Add "Max Abs Error" (scientific notation) and "Max Rel Error" (percent)
  columns for both passing and failing signals.
- Read per-signal max errors for failing signals directly from the diff CSV.
- Hide the abs-tolerance from the meta line when `abs_tol` is `nothing`.

Thread `settings::CompareSettings` explicitly through `test_model` and
`main`; remove the module-level `_CMP_SETTINGS` global and the
`configure_comparison!` / `compare_settings` API.

Co-Authored-By: claude-sonnet-4-6 <noreply@anthropic.com>
@AnHeuermann AnHeuermann self-assigned this Mar 17, 2026
@AnHeuermann AnHeuermann marked this pull request as draft March 17, 2026 16:21
@AnHeuermann AnHeuermann marked this pull request as ready for review March 18, 2026 13:39
…tions

- Add `cmp_time` to `ModelResult` to track reference comparison wall time;
  report it in the per-model status line
- Read comparison signals in `pipeline.jl` before phase 3 and pass them to
  both `run_simulate` and `compare_with_reference`, avoiding redundant file
  reads and enabling observed-variable filtering in the CSV writer
- Filter observed variables written to the simulation CSV to only those
  needed for comparison, keeping large models (e.g. LightningSegmented-
  TransmissionLine) within the CSV size limit
- Write CSV at fixed intervals (from `ode_prob.kwargs[:saveat]` or tspan/500)
  instead of at every solver step; use dense interpolation for accuracy
- Fix `Nothing → Float64` for models where BaseModelica sets `saveat=nothing`
  by using `something(get(..., nothing), default)`
- Accept caller-supplied signal list in `compare_with_reference`; fall back
  to `comparisonSignals.txt` / all ref-CSV columns when none supplied
- Delete versioned results directory before rsync in CI to remove stale files
- Use qualified `Dates.now()` / `DifferentialEquations.*` after switching to
  module-level imports

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@AnHeuermann AnHeuermann marked this pull request as draft March 18, 2026 16:35
@AnHeuermann AnHeuermann marked this pull request as draft March 18, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant