Remove unnecessary numpy import in ApproxSequenceLike

This commit is contained in:
Kian Eliasi 2022-03-20 17:20:36 +03:30
parent 4b6b91fda3
commit 7dd5c4049e
1 changed files with 1 additions and 2 deletions

View File

@ -319,7 +319,6 @@ class ApproxSequenceLike(ApproxBase):
def _repr_compare(self, other_side: Sequence[float]) -> List[str]: def _repr_compare(self, other_side: Sequence[float]) -> List[str]:
import math import math
import numpy as np
if len(self.expected) != len(other_side): if len(self.expected) != len(other_side):
return [ return [
@ -340,7 +339,7 @@ class ApproxSequenceLike(ApproxBase):
abs_diff = abs(approx_value.expected - other_value) abs_diff = abs(approx_value.expected - other_value)
max_abs_diff = max(max_abs_diff, abs_diff) max_abs_diff = max(max_abs_diff, abs_diff)
if other_value == 0.0: if other_value == 0.0:
max_rel_diff = np.inf max_rel_diff = math.inf
else: else:
max_rel_diff = max(max_rel_diff, abs_diff / abs(other_value)) max_rel_diff = max(max_rel_diff, abs_diff / abs(other_value))
different_ids.append(i) different_ids.append(i)