Skip to content

Commit

Permalink
fix: fixing proportion check for SMP mix calculations (#1547)
Browse files Browse the repository at this point in the history
Co-authored-by: Ricardo Campos <[email protected]>
  • Loading branch information
mgaseta and Ricardo Campos authored Aug 28, 2024
1 parent cb6bed0 commit 041409c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 041409c

Please sign in to comment.