def diff_values(a, b, tolerance=0.0):
 if (isinstance(a, float) and isinstance(b, float)):
  if (np.isnan(a) and np.isnan(b)):
   return False
  return (not np.allclose(a, b, tolerance, 0.0))
 else:
  return (a != b)

def diff_values ( a , b , tolerance = 0.0 ) : if ( isinstance ( a , float ) and isinstance ( b , float ) ) : if ( np . isnan ( a ) and np . isnan ( b ) ) : return False return ( not np . allclose ( a , b , tolerance , 0.0 ) ) else : return ( a != b )
diff two scalar values .