Skip to content

Reject misaligned grids in waveform arithmetic - #899

Merged
wangyinz merged 4 commits into
masterfrom
codex/issue-848-waveform-arithmetic
Aug 21, 2026
Merged

wangyinz merged 4 commits into
masterfrom
codex/issue-848-waveform-arithmetic

Conversation

@wangyinz

@wangyinz wangyinz commented Aug 12, 2026 •

Copy link
Copy Markdown
Member

Closes #848

Summary

  • Reject incompatible time references, sample intervals, and non-integer grid offsets before waveform arithmetic mutates either operand.
  • Apply arithmetic only on the physical overlap; never resample inside TimeSeries or Seismogram operators.
  • In MCXcor's explicit alignment path, move each shifted start time to the nearest beam-grid sample without changing samples, dt, or npts.

Maintainer decision

Each TimeSeries remains a dense uniform series. Different sampling intervals must be resampled explicitly. MCXcor uses whole-trace nearest-grid placement as its default alignment policy; general waveform arithmetic remains strict. No interpolation is performed implicitly.

Validation

  • Focused Python arithmetic and complete MCXcor regressions: 21 passed
  • Full native CTest: 17 passed
  • Black, Python byte compilation, and git diff --check: passed

@codecov

codecov Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.39474% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.71%. Comparing base (70f40e8) to head (9c267f3).

Files with missing lines Patch % Lines
cxx/test/arithmetic/test_waveform_arithmetic.cc 97.52% 2 Missing and 1 partial ⚠️
cxx/src/lib/seismic/waveform_arithmetic.h 0.00% 2 Missing ⚠️
cxx/src/lib/seismic/CoreSeismogram.cc 93.75% 0 Missing and 1 partial ⚠️
cxx/src/lib/seismic/CoreTimeSeries.cc 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #899      +/-   ##
==========================================
+ Coverage   70.63%   70.71%   +0.07%     
==========================================
  Files         177      179       +2     
  Lines       35193    35262      +69     
  Branches     2503     2490      -13     
==========================================
+ Hits        24860    24936      +76     
  Misses       9430     9430              
+ Partials      903      896       -7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wangyinz
wangyinz marked this pull request as draft August 14, 2026 05:56

Copy link
Copy Markdown
Member Author

Draft decision required (renewed review)

An MCXcor owner must choose how strict sampled-grid arithmetic handles the existing 0.312835-sample output-window mismatch: documented resampling, nearest-index accumulation with a justified tolerance, or rejection. Do not restore unconditional time-grid snapping; this PR stays draft until that algorithm decision is made.

@wangyinz
wangyinz force-pushed the codex/issue-848-waveform-arithmetic branch from 4a737fa to 9c267f3 Compare August 21, 2026 23:18
@wangyinz
wangyinz marked this pull request as ready for review August 21, 2026 23:18
@wangyinz
wangyinz merged commit e791459 into master Aug 21, 2026
18 checks passed
@wangyinz
wangyinz deleted the codex/issue-848-waveform-arithmetic branch August 22, 2026 08:23
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.

Reject misaligned grids in waveform arithmetic

1 participant