diff --git a/pytools/convergence.py b/pytools/convergence.py index ad7b74c7..7cf96925 100644 --- a/pytools/convergence.py +++ b/pytools/convergence.py @@ -67,7 +67,7 @@ def estimate_order_of_convergence(self, # NOTE: in case any of the errors are exactly 0.0, which # can give NaNs in `estimate_order_of_convergence` - emax = np.amax(errors) + emax: float = np.amax(errors) errors += (1 if emax == 0 else emax) * np.finfo(errors.dtype).eps size = len(abscissae) @@ -82,7 +82,8 @@ def estimate_order_of_convergence(self, return result def order_estimate(self) -> float: - return self.estimate_order_of_convergence()[0, 1] + from typing import cast + return cast(float, self.estimate_order_of_convergence()[0, 1]) def max_error(self) -> float: return max(err for absc, err in self.history)