Skip to content

Commit 957030c

Browse files
committed
fix: explicit type check replaced by isinstance in fits.least_squares.
1 parent 2017de0 commit 957030c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pyerrors/fits.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,12 @@ def func_b(a, x):
168168
'''
169169
output = Fit_result()
170170

171-
if (type(x) == dict and type(y) == dict and type(func) == dict):
171+
if (isinstance(x, dict) and isinstance(y, dict) and isinstance(func, dict)):
172172
xd = {key: anp.asarray(x[key]) for key in x}
173173
yd = y
174174
funcd = func
175175
output.fit_function = func
176-
elif (type(x) == dict or type(y) == dict or type(func) == dict):
176+
elif (isinstance(x, dict) or isinstance(y, dict) or isinstance(func, dict)):
177177
raise TypeError("All arguments have to be dictionaries in order to perform a combined fit.")
178178
else:
179179
x = np.asarray(x)

0 commit comments

Comments
 (0)