Skip to content

Test improvements: RF and gradient waveform accuracy#764

Merged
cncastillo merged 4 commits into
masterfrom
codex/waveform-tests
May 4, 2026
Merged

Test improvements: RF and gradient waveform accuracy#764
cncastillo merged 4 commits into
masterfrom
codex/waveform-tests

Conversation

@cncastillo
Copy link
Copy Markdown
Member

@cncastillo cncastillo commented May 2, 2026

Problem

#380 asks for simulation coverage across the RF and gradient waveform constructors. The missing coverage is not just constructor coverage: the same physical waveform should simulate to the same signal across block, uniformly sampled, and time-shaped event definitions.

Solution

Adds a KomaMRICore accuracy test for the 3 x 3 RF/Grad waveform grid. Each case builds the same RF pulse and readout gradient with @addblock, samples ADC during the gradient block, and compares the signal against an OrdinaryDiffEqTsit5 Bloch reference.

The DiffEq reference path is shared through diffeq_signal, which also replaces duplicated reference code in the RF accuracy and motion tests.

Tests

  • TEST_GROUP=motion julia --project=KomaMRICore -e 'import Pkg; Pkg.test()'
  • julia --project=KomaMRICore -e 'import Pkg; Pkg.test()'

Development

Closes #380

@codecov
Copy link
Copy Markdown

codecov Bot commented May 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.55%. Comparing base (0ab6bb9) to head (9d9cd7d).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #764      +/-   ##
==========================================
- Coverage   89.62%   88.55%   -1.08%     
==========================================
  Files          76       76              
  Lines        5397     5389       -8     
==========================================
- Hits         4837     4772      -65     
- Misses        560      617      +57     
Flag Coverage Δ
base 86.48% <ø> (ø)
core 79.43% <ø> (-8.58%) ⬇️
files 95.26% <ø> (ø)
komamri 88.32% <ø> (ø)
plots 90.88% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 9 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cncastillo cncastillo force-pushed the codex/waveform-tests branch from fa7dd0c to 3fa5a43 Compare May 3, 2026 19:15
@cncastillo cncastillo force-pushed the codex/waveform-tests branch from 3fa5a43 to 295d3a2 Compare May 3, 2026 19:31
Comment thread KomaMRICore/test/runtests.jl Outdated
Comment thread KomaMRICore/test/runtests.jl Outdated
@cncastillo cncastillo changed the title Test simulation waveform event types Test RF and gradient waveform accuracy May 4, 2026
@cncastillo cncastillo changed the title Test RF and gradient waveform accuracy Test improvements: RF and gradient waveform accuracy May 4, 2026
@cncastillo cncastillo merged commit 2a0faef into master May 4, 2026
10 of 12 checks passed
@cncastillo cncastillo deleted the codex/waveform-tests branch May 4, 2026 01:06
github-actions Bot added a commit that referenced this pull request May 4, 2026
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.

Add tests simulating all waveform types for RF and Grad

1 participant