MazinLab / MKIDPipeline

The MKID Data Pipeline
http://web.physics.ucsb.edu/~bmazin/
6 stars 3 forks source link

lmfit in wavecal.py receiving an extra argument #124

Open nzivkov opened 3 hours ago

nzivkov commented 3 hours ago

The eval method in lmfit does not accept the modeling parameter, and the type error implies some part of the code is improperly passing extra arguments to np.asarray. Eval may internally call np.asarray() on params or on a portion of the params object which results in this error.

Resulting from the following error:
Traceback (most recent call last): File "/opt/miniconda3/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/home/nzivkov/src/mkidpipeline/mkidpipeline/steps/wavecal.py", line 1065, in run raise error File "/home/nzivkov/src/mkidpipeline/mkidpipeline/steps/wavecal.py", line 1042, in run getattr(self.calibrator, self.method)(**kwargs) File "/home/nzivkov/src/mkidpipeline/mkidpipeline/steps/wavecal.py", line 514, in fit_histograms raise error File "/home/nzivkov/src/mkidpipeline/mkidpipeline/steps/wavecal.py", line 460, in fit_histograms model.fit(guess) File "/home/nzivkov/src/mkidpipeline/mkidpipeline/utils/wavecal_models.py", line 272, in fit amplitudes = self._reduced_model.eval(params=fit_result.params, x=x, y=y, variance=variance, File "/home/nzivkov/src/mkidpipeline/.venv/lib/python3.10/site-packages/lmfit/model.py", line 1000, in eval return coerce_arraylike(self.func(**self.make_funcargs(params, kwargs))) File "/home/nzivkov/src/mkidpipeline/.venv/lib/python3.10/site-packages/lmfit/model.py", line 201, in coerce_arraylike return np.asarray(x, dtype=np.float64) TypeError: Parameters.__array__() takes 1 positional argument but 2 were given

ld-cd commented 3 hours ago

@michaelarena is this something we hit and fixed in your branch

ld-cd commented 2 hours ago

It looks vaguely familiar

michaelarena commented 2 hours ago

Yes, I think we fixed it on the testing branch. Nikki is trying that branch now

nzivkov commented 54 minutes ago

This wasn't fixed in the testing branch, it is still an error