Skip to content

Commit

Permalink
refactor: _standard_fit method made redundant. (#154)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
fjosw committed Mar 1, 2023
1 parent de35332 commit dc7033e
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 225 deletions.
4 changes: 2 additions & 2 deletions pyerrors/correlators.py
Expand Up @@ -734,8 +734,8 @@ def fit(self, function, fitrange=None, silent=False, **kwargs):
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

Expand Down

0 comments on commit dc7033e

Please sign in to comment.