From 8296a5ede082e4b16c23d9a1618097b2713fc9c2 Mon Sep 17 00:00:00 2001 From: labkey-willm Date: Thu, 19 Oct 2023 17:24:59 -0700 Subject: [PATCH] backport NAb fix --- api/src/org/labkey/api/util/JsonUtil.java | 2 +- core/src/org/labkey/core/statistics/ParameterCurveFit.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/org/labkey/api/util/JsonUtil.java b/api/src/org/labkey/api/util/JsonUtil.java index 81baf1a51c0..2e3dae86e2f 100644 --- a/api/src/org/labkey/api/util/JsonUtil.java +++ b/api/src/org/labkey/api/util/JsonUtil.java @@ -238,7 +238,7 @@ public static void safePut(JSONObject json, String key, Number value) json.put(key, translateNumber(value)); } - private static Object translateNumber(Number value) + public static Object translateNumber(Number value) { if (value instanceof Double d) { diff --git a/core/src/org/labkey/core/statistics/ParameterCurveFit.java b/core/src/org/labkey/core/statistics/ParameterCurveFit.java index a49bc976391..94b61235b9a 100644 --- a/core/src/org/labkey/core/statistics/ParameterCurveFit.java +++ b/core/src/org/labkey/core/statistics/ParameterCurveFit.java @@ -214,7 +214,7 @@ protected SigmoidalParameters calculateFitParameters(double minValue, double max { double absoluteCutoff = min + (0.5 * (max - min)); double relativeEC50 = getInterpolatedCutoffXValue(absoluteCutoff); - if (relativeEC50 != Double.POSITIVE_INFINITY && relativeEC50 != Double.NEGATIVE_INFINITY) + if (!Double.isInfinite(relativeEC50) && !Double.isNaN(relativeEC50)) { parameters.max = max; parameters.inflection = relativeEC50;