-
Notifications
You must be signed in to change notification settings - Fork 273
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
Spline model #804
Spline model #804
Conversation
Codecov Report
@@ Coverage Diff @@
## master #804 +/- ##
==========================================
- Coverage 93.80% 93.62% -0.18%
==========================================
Files 10 10
Lines 3404 3546 +142
==========================================
+ Hits 3193 3320 +127
- Misses 211 226 +15
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Is there any reason not to add it to the I wondered if there was a way to shoehorn |
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.
thanks @newville this looks like a useful model to add! I notice there are some trivialities with the documentation and code-style; I know you are not a fan of these... so I am happy to fix those for you. I'll add a commit shortly and then take another look at the actual content!
return log(loren) * gradient(gauss) / gradient(x) | ||
loren = lorentzian(x, amplitude=amp, center=cen, sigma=sig) | ||
gauss = gaussian(x, amplitude=amp, center=cen, sigma=sig) | ||
return log(loren) * gradient(gauss) / gradient(x) |
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.
are you sure this will render correctly indented Python code on the documentation website (here and in other places where you made similar whitespace changes) so that, for example, people can copy-and-paste code from the docs to their Python shell?
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.
not sure what is happening there... My editor seems to be putting tabs into rst files for indents. They do seem to render to HTML correctly
@rayosborn Thanks -- added Spline to |
@reneeotten It appears to me that "codespell" cannot be used in a "warn only" mode. For I get that spell-checking code is useful. It really cannot prevent merges and trying to fight against falsely identified problems is just of waste of our time. |
@newville I've fixed the pre-commit issues already; if you're not actively working on it now; I'll push the changes shortly - okay? |
@reneeotten yep, go for it! |
this commit should fix the last |
@reneeotten OK, thanks! |
@reneeotten OK to (squash and) merge? |
Yes, looks good to me! |
@reneeotten OK, merging this too. |
Description
This adds a SplineModel(), which is slightly unusual in that it is variadic, with a variable number of parameters at
x
values determined byxknots
.Type of Changes
Tested on
Python: 3.9.13 | packaged by conda-forge | (main, May 27 2022, 17:00:52)
[Clang 13.0.1 ]
lmfit: 1.0.3.post42+g6bea572.d20220830, scipy: 1.9.0, numpy: 1.23.2, asteval: 0.9.27, uncertainties: 3.1.7
Verification
Have you