本文整理汇总了Python中WhfLog.warning方法的典型用法代码示例。如果您正苦于以下问题:Python WhfLog.warning方法的具体用法?Python WhfLog.warning怎么用?Python WhfLog.warning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WhfLog
的用法示例。
在下文中一共展示了WhfLog.warning方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setCurrentModelAvailability
# 需要导入模块: import WhfLog [as 别名]
# 或者: from WhfLog import warning [as 别名]
def setCurrentModelAvailability(self, parms, config):
""" Change availability status when appropriate by looking at disk
Parameters
----------
parms : Parms
parameters
config : str
Config file name
Returns
-------
none
"""
if (self._layered):
# no need to do more, already layered
return
if (self._empty):
WhfLog.error("Empty when not expected")
return
# make note if going from nothing to something
nothing = True
for f in self._step:
if (f._layered):
nothing = False
#if (nothing):
#WhfLog.debug("Nothing, so trying to get stuff")
# first time only, try the -1 and -2 steps, force with what we have
if (self._first):
self._step[2].forceLayer(parms, config, self._issue)
self._step[1].forceLayer(parms, config, self._issue)
self._first = False
self._step[0].layerIfReady(parms, config, self._issue)
self._layered = self._step[0]._layered
if (not self._layered):
tnow = datetime.datetime.utcnow()
diff = tnow - self._clockTime
idiff = (diff.microseconds +
(diff.seconds + diff.days*24*3600)*10**6)/10**6
if (idiff > parms._veryLateSeconds):
WhfLog.warning("WARNING: Inputs for layering timeout Issue:%s",
self._issue.strftime("%Y%m%d%H"))
s = self._step[0].debugPrintString()
WhfLog.warning("WARNING: 0, state=%s", s)
self._step[0].forceLayer(parms, config, self._issue)
self._layered = True
示例2: setCurrentModelAvailability
# 需要导入模块: import WhfLog [as 别名]
# 或者: from WhfLog import warning [as 别名]
def setCurrentModelAvailability(self, parms, model):
""" Change availability status when appropriate by looking at disk
Parameters
----------
parms : Parms
parameters
model : Model
overall status for this model run, used for clock time
Returns
-------
none
"""
if (self._layered):
# no need to do more, already layered
return
# make note if going from nothing to something
nothing = (not self._hrrr) and (not self._rap)
#if (nothing):
#WhfLog.debug("Nothing, so trying to get stuff")
if (not self._hrrr):
# update HRRR status
self._hrrr = self._forecastExists(parms._hrrrDir)
if (not self._rap):
# update RAP status
self._rap = self._forecastExists(parms._rapDir)
if (nothing and (self._hrrr or self._rap)):
# went from nothing to something, so start the clock
WhfLog.debug("Starting clock now, hrrr=%d, rap=%d", df.boolToInt(self._hrrr),
df.boolToInt(self._rap))
self._clockTime = datetime.datetime.utcnow()
else:
if (nothing and ((not self._hrrr) and (not self._rap))):
# nothing to nothing, compare current time to time from
# model input, and squeaky wheel if too long
tnow = datetime.datetime.utcnow()
diff = tnow - model._clockTime
idiff = diff.total_seconds()
if (idiff > parms._veryLateSeconds):
WhfLog.warning("Inputs for short range layering are very late Issue:%s Valid:%s",
self._issue.strftime("%Y%m%d%H"),
self._valid.strftime("%Y%m%d%H"))
示例3: forceLayer
# 需要导入模块: import WhfLog [as 别名]
# 或者: from WhfLog import warning [as 别名]
def forceLayer(self, parms, config, itime):
""" Perform layering if state is partially ready enough
Parameters
----------
parms : Parms
Parameters
itime : datetime
Returns
-------
bool
True if layering was done, or had previously been done
"""
if (self._layered):
return True
self.setAvailability(parms, itime)
if (self._rap0 and self._rap3):
if (self._hrrr0 and self._hrrr3):
self._layered = True
if (self._mrms == True):
WhfLog.setData('RAP/HRRR/MRMS')
layer(parms, itime, self._step, "RAP_HRRR_MRMS", config)
else:
WhfLog.setData('RAP/HRRR')
layer(parms, itime, self._step, "RAP_HRRR", config)
WhfLog.setData('RAP/HRRR/MRMS')
else:
self._layered = True
WhfLog.setData('RAP')
layer(parms, itime, self._step, "RAP", config)
WhfLog.setData('RAP/HRRR/MRMS')
else:
self._layered = True
WhfLog.warning("WARNING, no layering of %s, step=-%d",
itime.strftime("%Y%m%d%h"), self._step)
return True