Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set decode_timedelta=True to silence xarray warning #1506

Merged
merged 2 commits into from
Feb 6, 2025

Conversation

thorbjoernl
Copy link
Collaborator

Change Summary

Missed an xarray warning in #1502 which didn't surface in the tests surprisingly enough.

FutureWarning: In a future version of xarray decode_timedelta will default to False rather than None. To silence this warning, set decode_timedelta to True, False, or a 'CFTimedeltaCoder' instance.
  with xr.open_mfdataset(list(UEMEP_PATH.glob("*.nc")), engine="netcdf4") as dt:

This sets decode_timedelta to true for all opendataset calls, which maintains the old behaviour.

Related issue number

#1066

Checklist

  • Start with a draft-PR
  • The PR title is a good summary of the changes
  • PR is set to AeroTools and a tentative milestone
  • Documentation reflects the changes where applicable
  • Tests for the changes exist where applicable
  • Tests pass locally
  • Tests pass on CI
  • At least 1 reviewer is selected
  • Make PR ready to review

@thorbjoernl thorbjoernl marked this pull request as ready for review February 6, 2025 10:17
Copy link

codecov bot commented Feb 6, 2025

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.

Project coverage is 78.49%. Comparing base (d90ad0f) to head (07e65cb).
Report is 70 commits behind head on main-dev.

Files with missing lines Patch % Lines
pyaerocom/colocation/colocation_utils.py 0.00% 1 Missing ⚠️
pyaerocom/io/cams2_83/reader.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           main-dev    #1506   +/-   ##
=========================================
  Coverage     78.49%   78.49%           
=========================================
  Files           140      140           
  Lines         21299    21299           
=========================================
  Hits          16719    16719           
  Misses         4580     4580           
Flag Coverage Δ
unittests 78.49% <71.42%> (ø)

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.

@lewisblake lewisblake merged commit 70840db into main-dev Feb 6, 2025
6 of 8 checks passed
@thorbjoernl thorbjoernl deleted the fix-xarray-warning-2 branch February 6, 2025 12:01
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.

2 participants