-
Notifications
You must be signed in to change notification settings - Fork 7
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
Changes from all commits
e46ac63
ed29b92
e678645
198d5a8
7761883
0f3f789
b127396
7863722
1fbfa0a
c3d9984
cd002f3
36e6733
File filter
Filter by extension
Conversations
Jump to
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) | ||
|
Contributor
Author
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") | ||
|
Contributor
Author
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] | ||
|
Contributor
Author
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. In |
||
|
|
||
| d_ratio = stdratio(yfft) | ||
|
|
||
|
|
||
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.