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

Only fail certain use_cftime backend tests if a specific warning occurs #3930

Merged
merged 1 commit into from
Apr 3, 2020

Conversation

spencerkclark
Copy link
Member

@spencerkclark spencerkclark commented Apr 3, 2020

The warning we want to avoid in these tests is:

SerializationWarning: Unable to decode time axis into full numpy.datetime64 objects, continuing using cftime.datetime objects instead, reason: dates out of range
 dtype = _decode_cf_datetime_dtype(data, units, calendar, self.use_cftime)

Other warnings could occur, but shouldn't cause the tests to fail. This modifies these tests to only fail if a warning with this message occurs.

The warning that is occurring seems to be stemming from within the netcdf4-python library:

DeprecationWarning: tostring() is deprecated. Use tobytes() instead.
  attributes = {k: var.getncattr(k) for k in var.ncattrs()}

@dcherian
Copy link
Contributor

dcherian commented Apr 3, 2020

Thanks @spencerkclark

@dcherian dcherian merged commit 6bccbff into pydata:master Apr 3, 2020
@spencerkclark spencerkclark deleted the use-cftime-warning branch April 3, 2020 23:22
dcherian added a commit to dcherian/xarray that referenced this pull request Apr 5, 2020
* master:
  Use divergent colormap if lowest and highest level span 0 (pydata#3913)
  Bugfix for plotting transposed 2d coords (pydata#3934)
  Allow plotting bool data (pydata#3766)
  facetgrid: fix case when vmin == vmax (pydata#3916)
  add a CI that tests xarray with all optional dependencies but dask (pydata#3919)
  Add missing_dims argument allowing isel() to ignore missing dimensions (pydata#3923)
  Only fail if a specific warning occurs (pydata#3930)
  Fix minor code quality issues (pydata#3626)
  Fix for stack+groupby+apply w/ non-increasing coord (pydata#3906)
  reactivate the macos CI (pydata#3920)
  add pint to the output of show_versions() (pydata#3918)
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.

failing cftime upstream-dev tests
2 participants