fix: Exception types for fit function detection specified.

This commit is contained in:
Fabian Joswig 2022-06-24 13:10:06 +01:00
parent 3e29cf9ca8
commit fe9696841f

View file

@ -180,7 +180,7 @@ def total_least_squares(x, y, func, silent=False, **kwargs):
for i in range(42):
try:
func(np.arange(i), x.T[0])
except Exception:
except (IndexError, TypeError) as e:
continue
else:
break
@ -322,7 +322,7 @@ def _prior_fit(x, y, func, priors, silent=False, **kwargs):
for i in range(100):
try:
func(np.arange(i), 0)
except Exception:
except (IndexError, TypeError) as e:
continue
else:
break
@ -449,7 +449,7 @@ def _standard_fit(x, y, func, silent=False, **kwargs):
for i in range(42):
try:
func(np.arange(i), x.T[0])
except Exception:
except (IndexError, TypeError) as e:
continue
else:
break