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

ParameterDict has an identity crisis #57

Closed
Jhsmit opened this issue May 17, 2016 · 2 comments
Closed

ParameterDict has an identity crisis #57

Jhsmit opened this issue May 17, 2016 · 2 comments

Comments

@Jhsmit
Copy link
Collaborator

Jhsmit commented May 17, 2016

Is it a bird? Is it a list? Is it a dict? Is it superman?
It seems to be a list/dict hybrid, which might be intentional.

for key in result.params:
    result.params[key]

In any case, this does not work. What is the recommended method for getting unknown parameter values and their names out of this monster?

@Jhsmit
Copy link
Collaborator Author

Jhsmit commented May 17, 2016

PS. of course I did read the documentation and docstrings.

for par in result.params:
    name = par.name
    value = par.value

This gives me incorrect values for value, perhaps it gives the initial guess?

@tBuLi
Copy link
Owner

tBuLi commented May 17, 2016

Yeah it made sense at the time. I opened a discussion about it a while ago: #45.

The reason you can't iterate over it directly is because iterating over the ParameterDict means you will iterate over the Parameter objects which are indeed your initial guesses.

To iterate over the fitted value's I would do:

for param in fit_result.params:
    value = fit_result.value(param)

Any suggestions on the future of this are welcome in #45.

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

No branches or pull requests

2 participants