Repository navigation
FIX: Convert array-like inputs in eyetracking Calibration - #14413
Conversation
|
ooof. @ishaaaan17 the test you edited was written by me a long time ago! I took this opportunity to make it a little cleaner:
|
|
haha, no worries at all! the refactored test looks much cleaner and easier to read with the also i checked the CircleCI once that line in |
caught by CI in .mailmap, but names.inc needed to be updated mne-tools#14413 (comment)
|
thanks a lot for the review, the test refactor and the merge @scott-huberty! i really enjoyed working on this with you. |
summary
the docstring of
Calibrationsayspositions,offsetsandgazearearray-like, but if you passed python lists or tuples they stayed as lists. because of this,cal.plot()crashed onassert isinstance(self["positions"], np.ndarray).changes
Calibration.__init__, convertpositions,offsetsandgazeto numpy arrays withnp.asarray(..., dtype=float)when they are notNone.Calibration.plot(), replaced the bare assertion with aValueErrorthat checkspositionsandgazeare 2d arrays.plot()runs, intest_create_calibration.