From bbc74af447a89a81e78abde8d7e0b810f4d1d29a Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 6 Sep 2024 11:01:58 -0700 Subject: [PATCH 1/2] quick fix for FormattedNumber --- .../squiggle-lang/__tests__/utility/FormattedNumber_test.ts | 2 ++ .../squiggle-lang/__tests__/utility/compactTreeString_test.ts | 2 +- packages/squiggle-lang/src/utility/FormattedNumber.ts | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/squiggle-lang/__tests__/utility/FormattedNumber_test.ts b/packages/squiggle-lang/__tests__/utility/FormattedNumber_test.ts index 40ed385ded..b1579a0937 100644 --- a/packages/squiggle-lang/__tests__/utility/FormattedNumber_test.ts +++ b/packages/squiggle-lang/__tests__/utility/FormattedNumber_test.ts @@ -6,9 +6,11 @@ import { describe("FormattedNumber", () => { const makeTestCases: [number, ReturnType][] = [ + [0.01, { type: "basic", value: "0.01", isNegative: false }], [123.45, { type: "basic", value: "120", isNegative: false }], [-123.45, { type: "basic", value: "120", isNegative: true }], [1234, { type: "basic", value: "1200", isNegative: false }], + [1000, { type: "basic", value: "1000", isNegative: false }], [ 1234567, { type: "unit", mantissa: "1.2", symbol: "M", isNegative: false }, diff --git a/packages/squiggle-lang/__tests__/utility/compactTreeString_test.ts b/packages/squiggle-lang/__tests__/utility/compactTreeString_test.ts index b4c6df349b..2c6215c73d 100644 --- a/packages/squiggle-lang/__tests__/utility/compactTreeString_test.ts +++ b/packages/squiggle-lang/__tests__/utility/compactTreeString_test.ts @@ -87,7 +87,7 @@ describe("compactTreeString", () => { }, y: { vType: "SampleSetDist", - samples: [10400, 6830, 5280, 7700, ...1000 total], + samples: [1.04e4, 6830, 5280, 7700, ...1000 total], summary: { mean: ..., p5: ..., diff --git a/packages/squiggle-lang/src/utility/FormattedNumber.ts b/packages/squiggle-lang/src/utility/FormattedNumber.ts index e7b6e460bd..2af36206ad 100644 --- a/packages/squiggle-lang/src/utility/FormattedNumber.ts +++ b/packages/squiggle-lang/src/utility/FormattedNumber.ts @@ -64,7 +64,7 @@ export const makeFormattedNumber = ( const magnitude = calculateOrderOfMagnitude(absNumber); - if (magnitude > -2 && magnitude < 5) { + if (magnitude > -3 && magnitude < 4) { return { type: "basic", value: formatNumberWithScale(absNumber, 0, precision), From 347d5e9bb52e6d44ecfb5cb074717e0af7fef563 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 6 Sep 2024 11:14:58 -0700 Subject: [PATCH 2/2] Changed maxDuration, to fix llmRunner build --- packages/llmRunner/src/app/api/create/route.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/llmRunner/src/app/api/create/route.ts b/packages/llmRunner/src/app/api/create/route.ts index 55c400fac8..b82e940f4e 100644 --- a/packages/llmRunner/src/app/api/create/route.ts +++ b/packages/llmRunner/src/app/api/create/route.ts @@ -5,7 +5,7 @@ import { SquiggleResponse, } from "../../utils/squiggleTypes"; -export const maxDuration = 500; +export const maxDuration = 300; export async function POST(req: Request) { const abortController = new AbortController();