Skip to content
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

Merged
merged 18 commits into from
Nov 12, 2014
Merged

Fit dict #188

merged 18 commits into from
Nov 12, 2014

Conversation

ericdill
Copy link
Member

@ericdill ericdill commented Nov 3, 2014

cc @licode

- 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}
Copy link
Member Author

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()
Copy link
Member

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,
Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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"

Copy link
Member Author

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))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nuke print statement.

@ericdill
Copy link
Member Author

Move the wrappers into VTTools

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 0993e83 on ericdill:fit_dict into * on Nikea:master*.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 0993e83 on ericdill:fit_dict into * on Nikea:master*.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling f65f8cc on ericdill:fit_dict into * on Nikea:master*.

@tacaswell
Copy link
Member

@licode Please merge this today, it should be the highest priority.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling fe75d0f on ericdill:fit_dict into * on Nikea:master*.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling fe75d0f on ericdill:fit_dict into * on Nikea:master*.

licode added a commit that referenced this pull request Nov 12, 2014
@licode licode merged commit 6464a3f into scikit-beam:master Nov 12, 2014
@ericdill ericdill deleted the fit_dict branch November 13, 2014 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants