lmfit/lmfit-py — pull request #170 by andyfaff (2014-12-23 03:16:16+00:00)
Title: MAINT: lmfit.printfuncs.fit_report, using alphanumeric sort

lmfit.printfuncs.fit_report is a nice way of print the results of a fit. However, it sorts the dictionary before printing (line83):

parnames = sorted(params)

At the moment I am using parameter names ['p0', 'p1', ...., 'p10', 'p11', ...]
Consequently fit_report prints them in the order

p0
p1
p10
p11
p2

I would much rather we have an alphanumeric sort, or for the dictionary to remain ordered in the way they first got inserted in the dictionary

p0
p1
p2
p3
...
p10
p11

Is there a reason for this sorting? Shouldn't we keep the natural ordering of the lmfit.parameters.Parameters object, or at least use alphanumeric ordering?

This PR uses alphanumeric sorting.