parameters: (self, item, args)
docstring: Calculate the fatal/warning temperature values for item,
             updating self.id_map for each integer identifier matching
             item['label'].
docstring_summary: Calculate the fatal/warning temperature values for item,
             updating self.id_map for each integer identifier matching
             item['label'].
docstring_tokens: Calculate the fatal / warning temperature values for item updating self . id_map for each integer identifier matching item [ label ] .
function: def filter(self, item, args):
          """Calculate the fatal/warning temperature values for item,
             updating self.id_map for each integer identifier matching
             item['label']."""
          for ident in self.sensor_ids(item['label']):
              adjustment = self.id_map[ident]['adjustment']
              fatal = float(item['fatal']) + adjustment
  
              if fatal < args.min_temp:
                  fatal = args.min_temp
  
              if 'override' in item:
                  override = float(item['override'])
                  warning = (override * fatal) / 100.0
              else:
                  override = 0.0
                  warning = ((fatal * args.virt_warn_temp) /
                             args.virt_fatal_temp)
  
              self.id_map[ident]['units'] = item['units']
              self.id_map[ident]['warning'] = warning
              self.id_map[ident]['fatal'] = fatal
              filtered_warning = int(round(2 * warning))
              filtered_fatal = int(round(2 * fatal))
              self.id_map[ident]['filtered_warning'] = filtered_warning
              self.id_map[ident]['filtered_fatal'] = filtered_fatal
  
              msg = (f'{item["label"]} warning: {warning:.2f} {item["units"]} '
                     f'fatal: {fatal:.2f} {item["units"]} -> {filtered_warning} '
                     f'{filtered_fatal}')
              if adjustment != 0.0:
                  msg += f' (adjustment {adjustment}{item["units"]})'
              if override != 0.0:
                  msg += f' (override {override}%)'
  
              LOG.info(msg)
function_tokens: def filter ( self , item , args ) : for ident in self . sensor_ids ( item [ 'label' ] ) : adjustment = self . id_map [ ident ] [ 'adjustment' ] fatal = float ( item [ 'fatal' ] ) + adjustment if fatal < args . min_temp : fatal = args . min_temp if 'override' in item : override = float ( item [ 'override' ] ) warning = ( override * fatal ) / 100.0 else : override = 0.0 warning = ( ( fatal * args . virt_warn_temp ) / args . virt_fatal_temp ) self . id_map [ ident ] [ 'units' ] = item [ 'units' ] self . id_map [ ident ] [ 'warning' ] = warning self . id_map [ ident ] [ 'fatal' ] = fatal filtered_warning = int ( round ( 2 * warning ) ) filtered_fatal = int ( round ( 2 * fatal ) ) self . id_map [ ident ] [ 'filtered_warning' ] = filtered_warning self . id_map [ ident ] [ 'filtered_fatal' ] = filtered_fatal msg = ( f'{item["label"]} warning: {warning:.2f} {item["units"]} ' f'fatal: {fatal:.2f} {item["units"]} -> {filtered_warning} ' f'{filtered_fatal}' ) if adjustment != 0.0 : msg += f' (adjustment {adjustment}{item["units"]})' if override != 0.0 : msg += f' (override {override}%)' LOG . info ( msg )