Description
Proposed Changes
- Replace the ValueError in
LineModelND.estimate() with return False
- Modify the corresponding tests to assert a
False return, instead of checking for a ValueError
- Add a
return False to CircleModel.estimate() after the warning under the if-statement that checks for collinearity.
- Remove the second statement in the above mentioned warning, which states, "In scikit-image 1.0, this warning will become a ValueError."
Justification: Make classes more consistent with analogs
LineModelND raises a ValueError when the input data are under-determined. Similarly, CircleModel is scheduled to raise a ValueError when the input data are collinear.
LineModelND and CircleModel are part of a wider set of classes that include an estimate method for fitting points to a model and may be applied in algorithms such as ransac. Examples include the transforms in _geometric.py and EllipseModel() in fit.py. None of analogous other classes raise a ValueError when the inputs are underdetermined but instead return False.
LineModelND and CircleModel will be more consistent with their analogs if they do not raise ValueErrors when the input data are underdetermined.
Way to reproduce
Not applicable.
Version information
Not sure if applicable, but...
# Paste the output of the following python commands
3.10.5 | packaged by conda-forge | (main, Jun 14 2022, 07:07:06) [Clang 13.0.1 ]
macOS-12.4-arm64-arm-64bit
scikit-image version: 0.19.3
numpy version: 1.23.1
Description
Proposed Changes
LineModelND.estimate()withreturn FalseFalsereturn, instead of checking for a ValueErrorreturn FalsetoCircleModel.estimate()after the warning under the if-statement that checks for collinearity.Justification: Make classes more consistent with analogs
LineModelNDraises a ValueError when the input data are under-determined. Similarly,CircleModelis scheduled to raise a ValueError when the input data are collinear.LineModelNDandCircleModelare part of a wider set of classes that include anestimatemethod for fitting points to a model and may be applied in algorithms such asransac. Examples include the transforms in_geometric.pyandEllipseModel()infit.py. None of analogous other classes raise a ValueError when the inputs are underdetermined but instead return False.LineModelNDandCircleModelwill be more consistent with their analogs if they do not raise ValueErrors when the input data are underdetermined.Way to reproduce
Not applicable.
Version information
Not sure if applicable, but...