From e3a2a488b1f03a3bd6b5bf5dc4bb2a50df8d192e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Boisselier?= Date: Wed, 8 May 2024 22:17:22 +0200 Subject: [PATCH] fixed the MHI LUT behavior when MHI=0 --- src/graph_creators/graph_belts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/graph_creators/graph_belts.py b/src/graph_creators/graph_belts.py index 9ba1cfe..d64a2b9 100644 --- a/src/graph_creators/graph_belts.py +++ b/src/graph_creators/graph_belts.py @@ -140,11 +140,12 @@ def mhi_lut(mhi): (15, 30, 'Likely a mechanical issue'), (0, 15, 'Mechanical issue detected'), ] + mhi = np.clip(mhi, 1, 100) for lower, upper, message in ranges: if lower < mhi <= upper: return message - return 'Error computing MHI value' + return 'Unknown mechanical health' # Should never happen ######################################################################