From a129daf3f48c03568bdef12179ec7985f809b4e8 Mon Sep 17 00:00:00 2001 From: Denis Nadeau Date: Wed, 6 Feb 2019 18:15:43 -0800 Subject: [PATCH] fix flake8 --- Lib/cdscan.py | 20 ++++++++++---------- Lib/tvariable.py | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Lib/cdscan.py b/Lib/cdscan.py index dbcd5025..6c7782a0 100644 --- a/Lib/cdscan.py +++ b/Lib/cdscan.py @@ -307,7 +307,7 @@ def combineKeys(mydict, typedict, timeIsLinear=0, if name0 is None: name0 = name values, units, dummy = typedict[(path, name)] - if firstunits is "": + if firstunits == "": firstunits = units if prevend is not None and prevend >= i0: if prevend >= i1: @@ -620,15 +620,15 @@ def initialize_filemap(filemap, timedict, levdict, timeid, extendDset, splitOnTi referenceTime, timeIsLinear, referenceDelta, splitOnLevel, dirlen, overrideCalendar): # This function was formerly part of the body of "main". - # Initialize filemap : varid => (tc0, tc1, lc0, lc1, path, timeid, levid) - # where tc0 is the first time index relative to the reference time, tc1 the last, - # lc0 is the first level, lc1 the last, path is the filename, timeid is the id - # of the time dimension of the variable, levid is the id of the level dimension - # - # timedict : (path, timeid) => (timearray, timeunits, calendar) - # - # levdict : (path, levelid) => (levelarray, levelunits, None) - # + # Initialize filemap : varid => (tc0, tc1, lc0, lc1, path, timeid, levid) + # where tc0 is the first time index relative to the reference time, tc1 the last, + # lc0 is the first level, lc1 the last, path is the filename, timeid is the id + # of the time dimension of the variable, levid is the id of the level dimension + # + # timedict : (path, timeid) => (timearray, timeunits, calendar) + # + # levdict : (path, levelid) => (levelarray, levelunits, None) + # initfilemap = cdms2.dataset.parseFileMap(extendDset.cdms_filemap) dsetdirec = extendDset.directory for namelist, slicelist in initfilemap: diff --git a/Lib/tvariable.py b/Lib/tvariable.py index 460b4a6e..5e7639c9 100644 --- a/Lib/tvariable.py +++ b/Lib/tvariable.py @@ -306,7 +306,7 @@ def __new__(cls, data, typecode=None, copy=0, savespace=0, if dtype is None and data is not None: dtype = numpy.array(data).dtype - if any(x is 'N/A' for x in str(fill_value)): + if any(x == 'N/A' for x in str(fill_value)): fill_value = None if fill_value is not None: