For multidimensional x data formatted as a DxN array as described in the documentation, any D greater than 2 will cause iminuit to fail with the following error:
File "/usr/lib/python3.11/site-packages/iminuit/cost.py", line 1721, in _call
y, yerror = self._masked.T[self._ndim :]
^^^^^^^^^
ValueError: too many values to unpack (expected 2)
However, with correctly formatted data, x.ndim can only give 1 or 2, and D is instead given by np.atleast_2d(x).shape[0] or simply x.shape[0] if the atleast_2d call that is already in the method is moved earlier.
For multidimensional x data formatted as a DxN array as described in the documentation, any D greater than 2 will cause iminuit to fail with the following error:
See https://stackoverflow.com/questions/76127508/iminuit-high-dimension-multivariate-fit-problem
I believe this is because the following line assumes that x.ndim gives D: https://github.com/scikit-hep/iminuit/blob/298afadc645999fbad32ca00be6c0ebfec7c7bb9/src/iminuit/cost.py#L2194
However, with correctly formatted data,
x.ndim
can only give 1 or 2, and D is instead given bynp.atleast_2d(x).shape[0]
or simplyx.shape[0]
if theatleast_2d
call that is already in the method is moved earlier.