Skip to content

Honor measurement-window and mixed-member rules in ensemble scaling - #929

Merged
wangyinz merged 2 commits into
masterfrom
codex/issue-845-scale
Aug 22, 2026
Merged

wangyinz merged 2 commits into
masterfrom
codex/issue-845-scale

Conversation

@wangyinz

@wangyinz wangyinz commented Aug 12, 2026 •

Copy link
Copy Markdown
Member

Closes #845

Summary

  • Measure atomic scaling amplitudes only on the physical intersection of the requested window and datum.
  • Preserve the inclusive MsPASS sampling convention: equal endpoints and boundary-touching intersections measure one real sample.
  • Reject only truly disjoint intersections with MsPASSError(Invalid) before mutation.
  • Compute ensemble mean or median only from live, positive, finite amplitudes.
  • Apply the resulting common gain and calibration update to every live member.
  • Make the no-eligible-member case an exact no-op.

Maintainer decision

The scale statistic retains the definition used since this function was introduced. This change repairs window intersection and mixed-member handling without redefining amplitude, percentile rank, or ensemble statistics.

Validation

  • Rebuilt native Release scale contract: passed
  • Rebuilt Python binding scale contract plus adjacent window regressions: 29 passed
  • Python byte compilation, formatting, and git diff --check: passed

@codecov

codecov Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.48241% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.15%. Comparing base (568586b) to head (2868a4e).

Files with missing lines Patch % Lines
cxx/test/scale/test_scale_contract.cc 96.13% 4 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #929      +/-   ##
==========================================
+ Coverage   70.96%   71.15%   +0.18%     
==========================================
  Files         179      180       +1     
  Lines       35298    35471     +173     
  Branches     2490     2506      +16     
==========================================
+ Hits        25049    25239     +190     
+ Misses       9353     9335      -18     
- Partials      896      897       +1     

☔ 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:59
@wangyinz
wangyinz marked this pull request as ready for review August 14, 2026 15:39
@wangyinz
wangyinz force-pushed the codex/issue-845-scale branch from 04f03ed to 2868a4e Compare August 22, 2026 00:28
@wangyinz
wangyinz merged commit 6c6a3d7 into master Aug 22, 2026
18 checks passed
@wangyinz
wangyinz deleted the codex/issue-845-scale 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.

Honor measurement-window and mixed-member rules in ensemble scaling

1 participant