dkriegner / xrayutilities

xrayutilities - a package with useful scripts for X-ray diffraction physicists
http://xrayutilities.sourceforge.io
GNU General Public License v2.0
81 stars 29 forks source link

lmfit 1.3.0 breaks simpack.FitModel #182

Closed dkriegner closed 4 months ago

dkriegner commented 4 months ago

FitModel does not work anymore since its badly implemented. (It does not call super.__init__() for example).

rugfri commented 4 months ago

Hi, I think I still have the issue with lmfit 1.3.0

with mk = xu.simpack.KinematicalModel(ls_s, energy=en, resolution_width=resol) fitmkin = xu.simpack.FitModel(mk) result = fitmkin.fit(ydata, params, qarray, lmfit_kws=dict(hkl=qpoint), hkl=qpoint)

I get the error raise ValueError(f"'Missing independent variable '{var}'")

which comes from xrayutilities src

--> 268 res = super().fit(data[mask], params, x=x[mask], weights=mweights, 269 fit_kws=fit_kws, iter_cb=cb_func, **lmfit_kws)

I have xrayutilities version 1.7.6 and lmfit 1.3

dkriegner commented 4 months ago

If you test with version 1.7.6 then it can't be fixed. If you want to check if the next (to be released) version will fix the issue you have to install the development version. see here to see how you can do this easiest: https://sourceforge.net/p/xrayutilities/mailman/message/37188943/

If you can test this before I release the next version this is of course appreciated!