Skip to content

Suppress the annoying np.datetime64 errors#670

Merged
walshmm merged 12 commits intonextfrom
ewm14998-npdatetime-warning
Mar 23, 2026
Merged

Suppress the annoying np.datetime64 errors#670
walshmm merged 12 commits intonextfrom
ewm14998-npdatetime-warning

Conversation

@rboston628
Copy link
Contributor

@rboston628 rboston628 commented Mar 19, 2026

Description of work

Recently, numpy fully deprecated the use of timezone offsets in np,datetime64 constructor from strings. This was throwing useless errors that confused users and made it seem that every SNAPRed reduction was failing.

These were handled by suppressing the errors inside of the central Time.py module.

Explanation of work

This context manager successfully removes the error:

with warnings.catch_warnings():
  warnings.filterwarnings("ignore", category=Warning)
  time = np.datetime64(ts).astype(int) / 1e9  # convert to seconds

To test

Dev testing

Open, and try running a complete calibration run.

CIS testing

Please run an entire reduction run for a suitable file.

Link to EWM item

EWM#14998

Verification

  • the author has read the EWM story and acceptance critera
  • the reviewer has read the EWM story and acceptance criteria
  • the reviewer certifies the acceptance criteria below reflect the criteria in EWM

Acceptance Criteria

This list is for ease of reference, and does not replace reading the EWM story as part of the review. Verify this list matches the EWM story before reviewing.

  • acceptance criterion 1
  • acceptance criterion 2

@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.27%. Comparing base (414862c) to head (ac21b76).
⚠️ Report is 1 commits behind head on next.

Additional details and impacted files
@@           Coverage Diff           @@
##             next     #670   +/-   ##
=======================================
  Coverage   96.27%   96.27%           
=======================================
  Files          77       77           
  Lines        7055     7059    +4     
=======================================
+ Hits         6792     6796    +4     
  Misses        263      263           
Flag Coverage Δ
integration 49.39% <62.50%> (+0.02%) ⬆️
unittests 95.99% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@mguthriem
Copy link
Collaborator

I tested this today using the original replicator and this seems to have solved the problem.

@walshmm walshmm force-pushed the ewm14998-npdatetime-warning branch from afab9c8 to ac21b76 Compare March 23, 2026 18:34
@walshmm walshmm merged commit 6c127af into next Mar 23, 2026
10 checks passed
@walshmm walshmm deleted the ewm14998-npdatetime-warning branch March 23, 2026 19:37
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.

3 participants