From 0950daa95c6624cf8b766e2392c421f8b656077e Mon Sep 17 00:00:00 2001 From: nada Date: Wed, 28 Aug 2024 13:42:22 +0100 Subject: [PATCH] linearsegment.from_compu_scale: factor should be equal to 0 if only one numerator is specified --- odxtools/compumethods/linearsegment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odxtools/compumethods/linearsegment.py b/odxtools/compumethods/linearsegment.py index b3fabd3b..e61df751 100644 --- a/odxtools/compumethods/linearsegment.py +++ b/odxtools/compumethods/linearsegment.py @@ -38,7 +38,7 @@ def from_compu_scale(scale: CompuScale, *, internal_type: DataType, coeffs = odxrequire(scale.compu_rational_coeffs) offset = coeffs.numerators[0] - factor = coeffs.numerators[1] + factor = 0 if len(coeffs.numerators) == 1 else coeffs.numerators[1] denominator = 1.0 if len(coeffs.denominators) > 0: