-
Notifications
You must be signed in to change notification settings - Fork 60
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
Fit dict #188
Fit dict #188
Conversation
- Working on imports from lmfit
- Added a list to physics_peak and physics_model that contain the lists of valid options
lorentzian_squared_peak, compton_peak, elastic_peak, gauss_step, | ||
gauss_tail] | ||
|
||
line_shapes_dict = {str(lineshape): lineshape for lineshape in lineshapes} |
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.
turn this into a sorted list
lorentzian_squared_peak, compton_peak, elastic_peak, gauss_step, | ||
gauss_tail] | ||
|
||
lineshapes_list.sort() |
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.
change this to lineshapes_list.sort(key = lambda x: x.__name__)
from lmfit.models import (ConstantModel, LinearModel, QuadraticModel, | ||
ParabolicModel, PolynomialModel, VoigtModel, | ||
PseudoVoigtModel, Pearson7Model, StudentsTModel, | ||
BreitWignerModel, GaussianModel, LorentzianModel, |
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.
@tacaswell @licode We need to figure out how to get the docstring format that we need for these models (especially Gaussian and Lorentzian) but still keep lmfit's ability to guess the parameters of the model. In the previous version of physicss_function.py
we had the correct docstring so that it could be autowrapped into vistrails but were missing the ability to guess the model parameters. In this version of physics_function.py
we have the ability to guess the model parameters but these cannot be autowrapped into vistrails.
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.
One 'solution' is to change the docstrings in-place, another is to push said changes upstream.
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.
How would you change the docstrings in-place?
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.
foo.__doc__ = "new doc string"
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.
Is foo
an instance of a class or the class itself?
- This is so that we don't lose the parameter guessing that is built in to lmfit but we do get the docstrings we need
|
||
(w, x0, y0), r2 = fit_quad_to_peak(x[roi], | ||
np.log(y[roi])) | ||
|
||
print('w, x0, y0: {}, {}, {}'.format(w, x0, y0)) |
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.
nuke print statement.
Move the wrappers into VTTools |
- Updated fitting code to more closely mirror lmfit's codebase
Changes Unknown when pulling 0993e83 on ericdill:fit_dict into * on Nikea:master*. |
Changes Unknown when pulling 0993e83 on ericdill:fit_dict into * on Nikea:master*. |
Changes Unknown when pulling f65f8cc on ericdill:fit_dict into * on Nikea:master*. |
@licode Please merge this today, it should be the highest priority. |
Changes Unknown when pulling fe75d0f on ericdill:fit_dict into * on Nikea:master*. |
Changes Unknown when pulling fe75d0f on ericdill:fit_dict into * on Nikea:master*. |
cc @licode