Skip to content

Make CSS arrival bulk updates interval-safe - #913

Merged
wangyinz merged 2 commits into
masterfrom
codex/issue-880-dbarrival
Aug 23, 2026
Merged

wangyinz merged 2 commits into
masterfrom
codex/issue-880-dbarrival

Conversation

@wangyinz

@wangyinz wangyinz commented Aug 12, 2026 •

Copy link
Copy Markdown
Member

Fixes #880.

Summary

  • validate required station/network values before database access
  • use the same inclusive station/time predicate for reads and updates
  • make normal and no-timeout cursor paths process the same documents
  • return exact integer update counts, including zero for empty results
  • validate site networks and overlapping intervals before arrival writes
  • close every site and arrival cursor on success and exception paths

Verification

  • focused interval/cursor lifecycle contract: 30 passed
  • baseline red: 20 failed, 6 passed
  • meaningful adjacent preprocessing regressions: 27 passed, 1 deselected
  • compound $gte/$lte behavior also checked with temporary mongomock (not represented as a real Mongo service)
  • Black, py_compile, and git diff --check passed

This PR is Ready: the renewed review found no unresolved query, scientific, API, or resource-lifecycle decision.

@codecov

codecov Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.29730% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 72.49%. Comparing base (e505fcf) to head (41e9918).

Files with missing lines Patch % Lines
python/mspasspy/preprocessing/css30/dbarrival.py 97.29% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #913      +/-   ##
==========================================
+ Coverage   72.24%   72.49%   +0.24%     
==========================================
  Files         182      182              
  Lines       36103    36121      +18     
  Branches     2532     2532              
==========================================
+ Hits        26083    26186     +103     
+ Misses       9114     9029      -85     
  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 05:57
@wangyinz
wangyinz marked this pull request as ready for review August 14, 2026 15:41
@wangyinz
wangyinz marked this pull request as draft August 23, 2026 10:15
@wangyinz

Copy link
Copy Markdown
Member Author

Review finding before merge: every cursor created by set_netcode_time_interval and set_arrival_by_time_interval must be closed in try/finally, including no_cursor_timeout=True site/arrival cursors and exception paths. Extend the cursor test double with close() and assert closure on success and raised validation, overlap, and update errors. No query semantics or scientific behavior change is requested.

@wangyinz
wangyinz force-pushed the codex/issue-880-dbarrival branch from 59976b3 to 41e9918 Compare August 23, 2026 14:24
@wangyinz
wangyinz marked this pull request as ready for review August 23, 2026 14:25
@wangyinz
wangyinz merged commit af2786c into master Aug 23, 2026
18 checks passed
@wangyinz
wangyinz deleted the codex/issue-880-dbarrival branch August 23, 2026 14:46
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.

Make CSS arrival bulk updates interval-safe

1 participant