btrack's MotionModel has a matrix Q that is calculated from G. But this matrix is missing from Matrices.names.
In the plugin interaces, only the scalarsigma of each matrix is exposed to the user. This is done by passing the scalar magicgui.widgets.create_widget. However, because Q is missing from Matrics.names, the entire matrix is passed to create_widget.
In magicgui<6 this would fail silently and return an empty widget, but with magicgui>=0.6 this causes the following error to be raised when loading the btrack plugin:
File ~/mambaforge/envs/napari-btrack/lib/python3.9/site-packages/magicgui/type_map/_type_map.py:262, in _pick_widget_type(value=<class 'numpy.ndarray'> (6, 6) float64, annotation=<class 'numpy.ndarray'>, options={'nullable': False}, is_result=False, raise_on_unknown=True)
259 return _cls, {**options, **opts}
261 if raise_on_unknown:
--> 262 raise ValueError(
annotation = <class 'numpy.ndarray'>
_type = <class 'numpy.ndarray'>
263 f"No widget found for type {_type} and annotation {annotation!r}"
264 )
266 return widgets.EmptyWidget, {"visible": False}
ValueError: No widget found for type <class 'numpy.ndarray'> and annotation <class 'numpy.ndarray'>
Do we need to add a widget for Q by adding it to Matrices.names? Or can we ignore it when looping over the MotionModel parameters and creating widgets?
btrack's
MotionModel
has a matrixQ
that is calculated fromG
. But this matrix is missing fromMatrices.names
.In the plugin interaces, only the scalar
sigma
of each matrix is exposed to the user. This is done by passing the scalarmagicgui.widgets.create_widget
. However, becauseQ
is missing fromMatrics.names
, the entire matrix is passed tocreate_widget
.In
magicgui<6
this would fail silently and return an empty widget, but withmagicgui>=0.6
this causes the following error to be raised when loading the btrack plugin:Do we need to add a widget for
Q
by adding it toMatrices.names
? Or can we ignore it when looping over theMotionModel
parameters and creating widgets?