From 957030cba042b9b0f6973c3fb22523423d92e621 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Sun, 17 Sep 2023 18:11:26 +0200 Subject: [PATCH] fix: explicit type check replaced by isinstance in fits.least_squares. --- pyerrors/fits.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyerrors/fits.py b/pyerrors/fits.py index 5ec857e0..6518b224 100644 --- a/pyerrors/fits.py +++ b/pyerrors/fits.py @@ -168,12 +168,12 @@ def least_squares(x, y, func, priors=None, silent=False, **kwargs): ''' 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} yd = y funcd = 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.") else: x = np.asarray(x)