mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 14:50:25 +01:00
fix: explicit type check replaced by isinstance in fits.least_squares.
This commit is contained in:
parent
2017de0ec7
commit
957030cba0
1 changed files with 2 additions and 2 deletions
|
@ -168,12 +168,12 @@ def least_squares(x, y, func, priors=None, silent=False, **kwargs):
|
||||||
'''
|
'''
|
||||||
output = Fit_result()
|
output = Fit_result()
|
||||||
|
|
||||||
if (type(x) == dict and type(y) == dict and type(func) == dict):
|
if (isinstance(x, dict) and isinstance(y, dict) and isinstance(func, dict)):
|
||||||
xd = {key: anp.asarray(x[key]) for key in x}
|
xd = {key: anp.asarray(x[key]) for key in x}
|
||||||
yd = y
|
yd = y
|
||||||
funcd = func
|
funcd = func
|
||||||
output.fit_function = func
|
output.fit_function = func
|
||||||
elif (type(x) == dict or type(y) == dict or type(func) == dict):
|
elif (isinstance(x, dict) or isinstance(y, dict) or isinstance(func, dict)):
|
||||||
raise TypeError("All arguments have to be dictionaries in order to perform a combined fit.")
|
raise TypeError("All arguments have to be dictionaries in order to perform a combined fit.")
|
||||||
else:
|
else:
|
||||||
x = np.asarray(x)
|
x = np.asarray(x)
|
||||||
|
|
Loading…
Add table
Reference in a new issue