refactor: _standard_fit method made redundant. (#154)

* refactor: _standard_fit method made redundant.

* fix: xs and yz in Corr.fit promoted to arrays.

* fix: x promoted to array in _combined_fit if input is just a list.

* feat: residual_plot and qqplot now work with combined fits with
dictionary inputs.

* tests: test for combined fit resplot and qqplot added.

* docs: docstring of fits.residual_plot extended.
This commit is contained in:
Fabian Joswig 2023-03-01 10:00:35 +00:00 committed by GitHub
parent de35332a80
commit dc7033e51f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 75 additions and 225 deletions

View file

@ -734,8 +734,8 @@ class Corr:
if len(fitrange) != 2:
raise Exception("fitrange has to have exactly two elements [fit_start, fit_stop]")
xs = [x for x in range(fitrange[0], fitrange[1] + 1) if not self.content[x] is None]
ys = [self.content[x][0] for x in range(fitrange[0], fitrange[1] + 1) if not self.content[x] is None]
xs = np.array([x for x in range(fitrange[0], fitrange[1] + 1) if not self.content[x] is None])
ys = np.array([self.content[x][0] for x in range(fitrange[0], fitrange[1] + 1) if not self.content[x] is None])
result = least_squares(xs, ys, function, silent=silent, **kwargs)
return result