Skip to content

Commit

Permalink
Merge pull request #333 from nada-ben-ali/NaBe/Fix_linearsegment_when…
Browse files Browse the repository at this point in the history
…_only_one_numerator_is_present

linearsegment.from_compu_scale: factor value should be equal to 0 if only one numerator is specified
  • Loading branch information
andlaus authored Aug 28, 2024
2 parents e2c364f + 0950daa commit 6e0c6f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion odxtools/compumethods/linearsegment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6e0c6f2

Please sign in to comment.