Skip to content

Preserve MsPASS time and state through ObsPy decorators - #987

Open
wangyinz wants to merge 2 commits into
masterfrom
codex/issue-864-obspy-state
Open

Preserve MsPASS time and state through ObsPy decorators#987
wangyinz wants to merge 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 68.43%. Comparing base (61b06b9) to head (e89f433).

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   68.35%   68.43%   +0.08%     
==========================================
  Files         173      173              
  Lines       34397    34526     +129     
  Branches     2474     2474              
==========================================
+ Hits        23511    23629     +118     
- Misses      10002    10013      +11     
  Partials      884      884              

☔ 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
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