Skip to content

Preserve MsPASS time and state through ObsPy decorators - #987

Merged
wangyinz merged 2 commits into
masterfrom
codex/issue-864-obspy-state
Aug 22, 2026
Merged

wangyinz merged 2 commits into
masterfrom
codex/issue-864-obspy-state

Conversation

@wangyinz

@wangyinz wangyinz commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

Fixes #864

Summary

  • carry UTC/relative mode, shifts, live state, and coherent sample-grid state through ObsPy decorators
  • isolate conversion and prevalidate ensemble result length/order before any copy-back
  • preserve the established dead-input short circuit: dead atomic data and all-dead/dead ensembles return None without invoking the wrapped ObsPy callable
  • retain conversion/copy-back for mixed ensembles while restoring every member's MsPASS state
  • return the original ensemble identity on successful ensemble operations

Renewed scientific/API review

The first version deleted the four decorators' existing is_input_dead guards, forced dead copies live, and ran arbitrary ObsPy operations on data that MsPASS had explicitly marked unusable. That was unrelated to the copy-back defect and could change samples/metadata before merely restoring the dead flag. Commit e89f4332 restores the original zero-call dead/all-dead boundary while keeping the state, relative-time, and atomic ensemble copy-back fixes.

Verification

  • focused state/short-circuit contract: 41 passed
  • contract plus full decorators, signals, and converter regressions: 75 passed
  • all four decorators are tested with positional and keyword dead inputs; wrapped call count is exactly zero and full state is unchanged
  • Black 26.5.1, Python 3.12/3.13 py_compile, and git diff --check: passed

This PR intentionally remains draft pending human API/scientific review.

@codecov

codecov Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.97653% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.56%. Comparing base (3ea520b) to head (c598324).

Files with missing lines Patch % Lines
python/mspasspy/util/decorators.py 84.97% 32 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #987      +/-   ##
==========================================
+ Coverage   71.48%   71.56%   +0.07%     
==========================================
  Files         182      182              
  Lines       35666    35795     +129     
  Branches     2532     2532              
==========================================
+ Hits        25496    25615     +119     
- Misses       9264     9274      +10     
  Partials      906      906              

☔ 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 06:05
@wangyinz
wangyinz marked this pull request as ready for review August 14, 2026 15:40
@wangyinz
wangyinz force-pushed the codex/issue-864-obspy-state branch from e89f433 to c598324 Compare August 22, 2026 07:23
@wangyinz
wangyinz merged commit a5eb9ca into master Aug 22, 2026
18 checks passed
@wangyinz
wangyinz deleted the codex/issue-864-obspy-state branch August 22, 2026 07:45
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.

Preserve MsPASS time and state through ObsPy decorators

1 participant