mirror of
https://github.com/Unidata/python-awips.git
synced 2025-02-23 14:57:56 -05:00
don't use len(object) as a bool, and avoid iterating over a range()
This commit is contained in:
parent
e43f6bb98b
commit
49709197bc
2 changed files with 13 additions and 13 deletions
|
@ -47,17 +47,17 @@ def get_hdf5_data(idra):
|
|||
azdat = []
|
||||
depVals = []
|
||||
threshVals = []
|
||||
if len(idra) > 0:
|
||||
for ii in range(len(idra)):
|
||||
if idra[ii].getName() == "Data":
|
||||
rdat = idra[ii]
|
||||
elif idra[ii].getName() == "Angles":
|
||||
azdat = idra[ii]
|
||||
if idra:
|
||||
for item in idra:
|
||||
if item.getName() == "Data":
|
||||
rdat = item
|
||||
elif item.getName() == "Angles":
|
||||
azdat = item
|
||||
# dattyp = "radial"
|
||||
elif idra[ii].getName() == "DependentValues":
|
||||
depVals = idra[ii].getShortData()
|
||||
elif idra[ii].getName() == "Thresholds":
|
||||
threshVals = idra[ii].getShortData()
|
||||
elif item.getName() == "DependentValues":
|
||||
depVals = item.getShortData()
|
||||
elif item.getName() == "Thresholds":
|
||||
threshVals = item.getShortData()
|
||||
|
||||
return rdat, azdat, depVals, threshVals
|
||||
|
||||
|
|
|
@ -225,7 +225,7 @@ class ThriftSerializationContext(object):
|
|||
if size:
|
||||
if listType not in primitiveSupport:
|
||||
m = self.typeDeserializationMethod[listType]
|
||||
result = [m() for n in range(size)]
|
||||
result = [m() for __ in range(size)]
|
||||
else:
|
||||
result = self.listDeserializationMethod[listType](size)
|
||||
self.protocol.readListEnd()
|
||||
|
@ -234,7 +234,7 @@ class ThriftSerializationContext(object):
|
|||
def _deserializeMap(self):
|
||||
keyType, valueType, size = self.protocol.readMapBegin()
|
||||
result = {}
|
||||
for n in range(size):
|
||||
for __ in range(size):
|
||||
# can't go off the type, due to java generics limitations dynamic serialize is
|
||||
# serializing keys and values as void
|
||||
key = self.typeDeserializationMethod[TType.STRUCT]()
|
||||
|
@ -246,7 +246,7 @@ class ThriftSerializationContext(object):
|
|||
def _deserializeSet(self):
|
||||
setType, setSize = self.protocol.readSetBegin()
|
||||
result = set([])
|
||||
for n in range(setSize):
|
||||
for __ in range(setSize):
|
||||
result.add(self.typeDeserializationMethod[TType.STRUCT]())
|
||||
self.protocol.readSetEnd()
|
||||
return result
|
||||
|
|
Loading…
Add table
Reference in a new issue