Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 8
fix: fix load single peak in py3 support#178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
e46ac63ed29b92e678645198d5a877618830f3f789b12739678637221fbfa0ac3d9984cd002f336e6733File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| **Added:** | ||
| * <news item> | ||
| **Changed:** | ||
| * <news item> | ||
| **Deprecated:** | ||
| * <news item> | ||
| **Removed:** | ||
| * <news item> | ||
| **Fixed:** | ||
| * Fixed extracting single peak with `py2` legacy cleanup | ||
| **Security:** | ||
| * <news item> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -85,7 +85,7 @@ def evaluate(self, fit, count_fixed=False, kshift=0): | ||
| if self.chisq is None: | ||
| self.chisq = self.chi_squared(fit.value(), fit.y_cluster, fit.error_cluster) | ||
| self.stat = self.chisq + self.parpenalty(k, n) | ||
| self.stat = self.chisq + self.parpenalty(k) | ||
ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is needed, otherwise, it would have a unneeded positional argument, Moreover, since we are doing | ||
| return self.stat | ||
| @@ -169,7 +169,7 @@ def growth_justified(self, fit, k_prime): | ||
| logger.warning("AIC.growth_justified(): too few data to evaluate quality reliably.") | ||
| n = self.minpoints(k_actual) | ||
| penalty = self.parpenalty(k_test, n) - self.parpenalty(k_actual, n) | ||
| penalty = self.parpenalty(k_test) - self.parpenalty(k_actual) | ||
| return penalty < self.chisq | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -247,7 +247,7 @@ def defaultvars(self, *args): | ||
| # Enable "dg" as alias for "effective_dy" | ||
| if "dg" in args and "effective_dy" not in args: | ||
| nargs.add("effective_dy") | ||
| nargs.append("effective_dy") | ||
ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now, we have | ||
| # Set other defaults | ||
| PeakExtraction.defaultvars(self, *nargs) | ||
| @@ -888,9 +888,9 @@ def writepwastr(self, comments): | ||
| # Generate parameter labels from the baseline function's parameterdict | ||
| blf = self.extracted.baseline.owner() | ||
| if blf.npars > 0: | ||
| parlbl = blf.parameterdict.keys() | ||
| paridx = np.array(blf.parameterdict.values()).argsort() | ||
| lines.append("# " + " ".join([str(parlbl[i]) for i in paridx])) | ||
| parlbl = list(blf.parameterdict.keys()) | ||
| paridx = np.array(list(blf.parameterdict.values())).argsort() | ||
| lines.append("# " + " ".join(str(parlbl[i]) for i in paridx)) | ||
| blpars = " ".join([str(p) for p in self.extracted.baseline.pars]) | ||
| else: | ||
| blpars = "(no parameters)" | ||
| @@ -1000,7 +1000,7 @@ def find_qmax(r, y, showgraphs=False): | ||
| new_y = resample(r, y, new_r) | ||
| new_dr = (new_r[-1] - r[0]) / (len(new_r) - 1) | ||
| yfft = np.imag(np.fft.fft(new_y))[: len(new_y) / 2] | ||
| yfft = np.imag(np.fft.fft(new_y))[: len(new_y) // 2] | ||
| ||
| d_ratio = stdratio(yfft) | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to revert the incorrect fix done on summer 2024.