From 15d94f3abd9e11e842bf2d8fc18ce173fb7ee6f2 Mon Sep 17 00:00:00 2001 From: dcherian Date: Wed, 29 May 2019 08:59:00 -0600 Subject: [PATCH] Use not equivalent instead of not equals check. --- xarray/coding/variables.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xarray/coding/variables.py b/xarray/coding/variables.py index 280c7cb0cf4..e21372f8d2c 100644 --- a/xarray/coding/variables.py +++ b/xarray/coding/variables.py @@ -8,6 +8,7 @@ from ..core import dtypes, duck_array_ops, indexing from ..core.pycompat import dask_array_type +from ..core.utils import equivalent from ..core.variable import Variable @@ -148,7 +149,7 @@ def encode(self, variable, name=None): fv = encoding.get('_FillValue') mv = encoding.get('missing_value') - if (fv is not None) and (mv is not None) and (fv != mv): + if fv is not None and mv is not None and not equivalent(fv, mv): raise ValueError("Variable {!r} has multiple fill values {}. " "Cannot encode data. " .format(name, [fv, mv]))