meta00 / vital_sqi

A package for physiological signal quality control
MIT License
32 stars 11 forks source link

Handling errors manually - avoid as much as possible #53

Open bahp opened 3 years ago

bahp commented 3 years ago

Hi guys,

I have noticed that you usually try to handle manually common errors or warnings like:

I would recommend to let the standard error/warning handlers developed in python or other packages to do the thing for us. In general, when they report an error/warrning, they also include file (.py), the line of code triggering the error and a detailed enough description of the problem. I have noticed that the error messages written in the vital_sqi package are sometimes not informative enough and we could save us some work too! (see example below)

issue-file-does-not-exist

For this second example, it is very difficult to know where the "name 'isscalar' is not defined" is being raised and why. In the vital_sqi/sqi/standard_sqi.py function msq_sqi you need to include from vital_sqi.common import PeakDetector. Please do it inside the function, because it is only needed for that one I think. Then when using the msq_sqi the error happens (see below)

issue_1