File tree 3 files changed +19
-1
lines changed
3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,10 @@ Bug fixes
65
65
(:issue: `873 `).
66
66
By `Stephan Hoyer <https://github.com/shoyer >`_.
67
67
68
+ - Fix issues with variables where both attributes ``_FillValue `` and
69
+ ``missing_value `` are set to ``NaN `` (:issue: `997 `).
70
+ By `Marco Zühlke <https://github.com/mzuehlke >`_.
71
+
68
72
.. _whats-new.0.8.2 :
69
73
70
74
v0.8.2 (18 August 2016)
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ def equivalent(first, second):
99
99
if isinstance (first , np .ndarray ) or isinstance (second , np .ndarray ):
100
100
return ops .array_equiv (first , second )
101
101
else :
102
- return first is second or first == second
102
+ return first is second or first == second or ( pd . isnull ( first ) and pd . isnull ( second ))
103
103
104
104
105
105
def peek_at (iterable ):
Original file line number Diff line number Diff line change @@ -259,6 +259,20 @@ def test_decode_cf_with_conflicting_fill_missing_value(self):
259
259
self .assertRaisesRegexp (ValueError , "_FillValue and missing_value" ,
260
260
lambda : conventions .decode_cf_variable (var ))
261
261
262
+ var = Variable (['t' ], np .arange (10 ),
263
+ {'units' : 'foobar' ,
264
+ 'missing_value' : np .nan ,
265
+ '_FillValue' : np .nan })
266
+ var = conventions .decode_cf_variable (var )
267
+ self .assertIsNotNone (var )
268
+
269
+ var = Variable (['t' ], np .arange (10 ),
270
+ {'units' : 'foobar' ,
271
+ 'missing_value' : np .float32 (np .nan ),
272
+ '_FillValue' : np .float32 (np .nan )})
273
+ var = conventions .decode_cf_variable (var )
274
+ self .assertIsNotNone (var )
275
+
262
276
@requires_netCDF4
263
277
def test_decode_cf_datetime_non_iso_strings (self ):
264
278
# datetime strings that are _almost_ ISO compliant but not quite,
You can’t perform that action at this time.
0 commit comments