Skip to content
forked from pydata/xarray

Commit

Permalink
Use not equivalent instead of not equals check.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed May 29, 2019
1 parent 8b1f364 commit 15d94f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xarray/coding/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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]))
Expand Down

0 comments on commit 15d94f3

Please sign in to comment.