From 041409c836208cf4a99054c8b3ede02b82fb6ac5 Mon Sep 17 00:00:00 2001 From: mgaseta <105936322+mgaseta@users.noreply.github.com> Date: Wed, 28 Aug 2024 11:38:25 -0300 Subject: [PATCH] fix: fixing proportion check for SMP mix calculations (#1547) Co-authored-by: Ricardo Campos --- .../ca/bc/gov/backendstartapi/service/ParentTreeService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/ca/bc/gov/backendstartapi/service/ParentTreeService.java b/backend/src/main/java/ca/bc/gov/backendstartapi/service/ParentTreeService.java index ccfb989c0..e0d4b74ca 100644 --- a/backend/src/main/java/ca/bc/gov/backendstartapi/service/ParentTreeService.java +++ b/backend/src/main/java/ca/bc/gov/backendstartapi/service/ParentTreeService.java @@ -57,7 +57,7 @@ public PtCalculationResDto calculatePtVals(PtValsCalReqDto ptVals) { ptVals.smpMixIdAndProps().size()); final BigDecimal zero = BigDecimal.ZERO; - + // First pass BigDecimal varTotalConeCount = zero; BigDecimal varTotalPollenCount = zero; @@ -190,7 +190,7 @@ private GeospatialRespondDto calcMeanGeospatial( // Definition: weighted value = proportion * value BigDecimal proportion = dto.proportion(); - if (proportion.compareTo(ONE) >= 0) { + if (proportion.compareTo(ONE) > 0) { throw new ResponseStatusException( HttpStatus.BAD_REQUEST, String.format(