hephy-dd / diode-measurement

IV/CV measurements for silicon sensors.
GNU General Public License v3.0
0 stars 2 forks source link

Invalid plot values yield unhandled exceptions #9

Closed arnobaer closed 3 years ago

arnobaer commented 3 years ago

Invalid plot values (None, NaN, +inf, -inf) from either measurement or data file can cause application crashes as plots can only accept finite float values.

Use math.nan as defaults for dictionary keys (avoiding None) and math.isfinite(x) to verify if the value can be added to a plot.

In addition it would beneficial to refactor class PlotsController into independent classes IVPlotsController and CVPlotsController for better modularization.