light-scattering-io / caqtus

Package that provides tools to control an experiment
MIT License
0 stars 0 forks source link

Crash when analog calibration has ambiguous input points #29

Open light-scattering-io opened 2 months ago

light-scattering-io commented 2 months ago

Describe the bug When an analog piecewise linear interpolation has two input points with the same value, an unrecoverable exception is raised when trying to interpolate values.

Expected behavior Instead of raising an exception and crashing the application, it would be better to display an error message to the user telling them that they can't have two equal input points in the calibration.

Could either display the error when trying to compile, or maybe better, prevent such curves to even be representable and display the error when the user input their calibration.

Screenshots The error occurs when there is a calibration curve like this, with an infinite slope at some point:

image