def getScalarMetricWithTimeOfDayAnomalyParams(metricData, minVal=None, maxVal=None, minResolution=None, tmImplementation='cpp'):
 if (minResolution is None):
  minResolution = 0.001
 if ((minVal is None) or (maxVal is None)):
  (compMinVal, compMaxVal) = _rangeGen(metricData)
  if (minVal is None):
   minVal = compMinVal
  if (maxVal is None):
   maxVal = compMaxVal
 if (minVal == maxVal):
  maxVal = (minVal + 1)
 if (tmImplementation is 'cpp'):
  paramFileRelativePath = os.path.join('anomaly_params_random_encoder', 'best_single_metric_anomaly_params_cpp.json')
 elif (tmImplementation is 'tm_cpp'):
  paramFileRelativePath = os.path.join('anomaly_params_random_encoder', 'best_single_metric_anomaly_params_tm_cpp.json')
 else:
  raise ValueError('Invalid string for tmImplementation. Try cpp or tm_cpp')
 with resource_stream(__name__, paramFileRelativePath) as infile:
  paramSet = json.load(infile)
 _fixupRandomEncoderParams(paramSet, minVal, maxVal, minResolution)
 return paramSet

def getScalarMetricWithTimeOfDayAnomalyParams ( metricData , minVal = None , maxVal = None , minResolution = None , tmImplementation = 'cpp' ) : if ( minResolution is None ) : minResolution = 0.001 if ( ( minVal is None ) or ( maxVal is None ) ) : ( compMinVal , compMaxVal ) = _rangeGen ( metricData ) if ( minVal is None ) : minVal = compMinVal if ( maxVal is None ) : maxVal = compMaxVal if ( minVal == maxVal ) : maxVal = ( minVal + 1 ) if ( tmImplementation is 'cpp' ) : paramFileRelativePath = os . path . join ( 'anomaly_params_random_encoder' , 'best_single_metric_anomaly_params_cpp.json' ) elif ( tmImplementation is 'tm_cpp' ) : paramFileRelativePath = os . path . join ( 'anomaly_params_random_encoder' , 'best_single_metric_anomaly_params_tm_cpp.json' ) else : raise ValueError ( 'Invalid string for tmImplementation. Try cpp or tm_cpp' ) with resource_stream ( __name__ , paramFileRelativePath ) as infile : paramSet = json . load ( infile ) _fixupRandomEncoderParams ( paramSet , minVal , maxVal , minResolution ) return paramSet
return a dict that can be used to create an anomaly model via opfs modelfactory .