From dec03d0590fee80502699a420220ba6f7c5aec0d Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 21:40:38 -0400 Subject: [PATCH 01/32] declarative netlify --- .github/ISSUE_TEMPLATE/ops-testing.md | 1 - packages/components/netlify.toml | 10 ++++++++++ packages/website/netlify.toml | 10 ++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 packages/components/netlify.toml create mode 100644 packages/website/netlify.toml diff --git a/.github/ISSUE_TEMPLATE/ops-testing.md b/.github/ISSUE_TEMPLATE/ops-testing.md index 1edb148b..96ca08f3 100644 --- a/.github/ISSUE_TEMPLATE/ops-testing.md +++ b/.github/ISSUE_TEMPLATE/ops-testing.md @@ -6,7 +6,6 @@ labels: "ops & testing" # Description: - # The OS and version, yarn version, etc. in which this came up diff --git a/packages/components/netlify.toml b/packages/components/netlify.toml new file mode 100644 index 00000000..998bf9c4 --- /dev/null +++ b/packages/components/netlify.toml @@ -0,0 +1,10 @@ +[build] + publish = packages/components/storybook-static + build = cd packages/squiggle-lang && yarn build && cd ../components && yarn build + ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF packages/components packages/squiggle-lang" + +[build.environment] + NETLIFY_USE_YARN = true + +[context.deploy-preview] + ignore = node -e "process.env.BRANCH.includes("dependabot") ? 0 : 1" \ No newline at end of file diff --git a/packages/website/netlify.toml b/packages/website/netlify.toml new file mode 100644 index 00000000..79e99135 --- /dev/null +++ b/packages/website/netlify.toml @@ -0,0 +1,10 @@ +[build] + publish = packages/website/build + build = cd packages/squiggle-lang && yarn build && cd ../website && yarn build + # ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF packages/website packages/components packages/squiggle-lang" + +[build.environment] + NETLIFY_USE_YARN = true + +[context.deploy-preview] + ignore = node -e "process.env.BRANCH.includes("dependabot") ? 0 : 1" \ No newline at end of file From 20f3004aa14ddb37cb1f9c3db044fe91bf338e4c Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 21:43:16 -0400 Subject: [PATCH 02/32] netlify: declarative --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ca57d333..4c921cda 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -24,6 +24,7 @@ *.json @quinn-dougherty @Hazelfire @OAGr *.y*ml @quinn-dougherty @OAGr *.config.js @Hazelfire @OAGr +netlify.toml @quinn-dougherty @OAGr # Documentation *.md @quinn-dougherty @OAGr @Hazelfire From 84b358397eb01f8672c6652c20c9a1b70c1a289e Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 21:52:03 -0400 Subject: [PATCH 03/32] `.toml` requires quotes around bash values --- packages/components/netlify.toml | 6 +++--- packages/website/netlify.toml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/components/netlify.toml b/packages/components/netlify.toml index 998bf9c4..072c8565 100644 --- a/packages/components/netlify.toml +++ b/packages/components/netlify.toml @@ -1,10 +1,10 @@ [build] - publish = packages/components/storybook-static - build = cd packages/squiggle-lang && yarn build && cd ../components && yarn build + publish = "packages/components/storybook-static/" + build = "cd packages/squiggle-lang && yarn build && cd ../components && yarn build" ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF packages/components packages/squiggle-lang" [build.environment] NETLIFY_USE_YARN = true [context.deploy-preview] - ignore = node -e "process.env.BRANCH.includes("dependabot") ? 0 : 1" \ No newline at end of file + ignore = "node -e 'process.env.BRANCH.includes("dependabot") ? 0 : 1'" \ No newline at end of file diff --git a/packages/website/netlify.toml b/packages/website/netlify.toml index 79e99135..d28c8f07 100644 --- a/packages/website/netlify.toml +++ b/packages/website/netlify.toml @@ -1,10 +1,10 @@ [build] - publish = packages/website/build - build = cd packages/squiggle-lang && yarn build && cd ../website && yarn build + publish = "packages/website/build/" + build = "cd packages/squiggle-lang && yarn build && cd ../website && yarn build" # ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF packages/website packages/components packages/squiggle-lang" [build.environment] NETLIFY_USE_YARN = true [context.deploy-preview] - ignore = node -e "process.env.BRANCH.includes("dependabot") ? 0 : 1" \ No newline at end of file + ignore = "node -e 'process.env.BRANCH.includes("dependabot") ? 0 : 1'" \ No newline at end of file From 1677d6337505994869c196229c5edd2788a1353e Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Thu, 14 Apr 2022 21:53:45 -0400 Subject: [PATCH 04/32] fix: std of lognormal symbolic division --- .../src/rescript/Distributions/SymbolicDist/SymbolicDist.res | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/squiggle-lang/src/rescript/Distributions/SymbolicDist/SymbolicDist.res b/packages/squiggle-lang/src/rescript/Distributions/SymbolicDist/SymbolicDist.res index afd35800..0ef8b3d0 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/SymbolicDist/SymbolicDist.res +++ b/packages/squiggle-lang/src/rescript/Distributions/SymbolicDist/SymbolicDist.res @@ -167,7 +167,7 @@ module Lognormal = { let mu = l1.mu -. l2.mu // We believe the ratiands will have covariance zero. // See here https://stats.stackexchange.com/questions/21735/what-are-the-mean-and-variance-of-the-ratio-of-two-lognormal-variables for details - let sigma = l1.sigma +. l2.sigma + let sigma = Js.Math.sqrt(l1.sigma ** 2. +. l2.sigma ** 2.) // m #Lognormal({mu: mu, sigma: sigma}) } let operate = (operation: Operation.Algebraic.t, n1: t, n2: t) => From 96d6e5c04d8f76423286a068ca97f4bc7d5dcdff Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 21:59:13 -0400 Subject: [PATCH 05/32] forgot to escape characters --- packages/components/netlify.toml | 2 +- packages/website/netlify.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/components/netlify.toml b/packages/components/netlify.toml index 072c8565..fdb817a6 100644 --- a/packages/components/netlify.toml +++ b/packages/components/netlify.toml @@ -7,4 +7,4 @@ NETLIFY_USE_YARN = true [context.deploy-preview] - ignore = "node -e 'process.env.BRANCH.includes("dependabot") ? 0 : 1'" \ No newline at end of file + ignore = "node -e 'process.env.BRANCH.includes(\"dependabot\") ? 0 : 1'" \ No newline at end of file diff --git a/packages/website/netlify.toml b/packages/website/netlify.toml index d28c8f07..c5bee71d 100644 --- a/packages/website/netlify.toml +++ b/packages/website/netlify.toml @@ -7,4 +7,4 @@ NETLIFY_USE_YARN = true [context.deploy-preview] - ignore = "node -e 'process.env.BRANCH.includes("dependabot") ? 0 : 1'" \ No newline at end of file + ignore = "node -e 'process.env.BRANCH.includes(\"dependabot\") ? 0 : 1'" \ No newline at end of file From d98c637c1557fe3951c2d5b5225a00e7dd6be395 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 22:17:23 -0400 Subject: [PATCH 06/32] try this --- .github/CODEOWNERS | 2 +- netlify.toml | 5 +++++ packages/components/netlify.toml | 6 ------ packages/website/netlify.toml | 8 +------- 4 files changed, 7 insertions(+), 14 deletions(-) create mode 100644 netlify.toml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4c921cda..27cfbc62 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -24,7 +24,7 @@ *.json @quinn-dougherty @Hazelfire @OAGr *.y*ml @quinn-dougherty @OAGr *.config.js @Hazelfire @OAGr -netlify.toml @quinn-dougherty @OAGr +netlify.toml @quinn-dougherty @OAGr @Hazelfire # Documentation *.md @quinn-dougherty @OAGr @Hazelfire diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 00000000..e60a3555 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,5 @@ +[build.environment] + NETLIFY_USE_YARN = true + +[context.deploy-preview] + ignore = "node -e 'process.env.BRANCH.includes(\"dependabot\") ? 0 : 1'" \ No newline at end of file diff --git a/packages/components/netlify.toml b/packages/components/netlify.toml index fdb817a6..78b8b6c0 100644 --- a/packages/components/netlify.toml +++ b/packages/components/netlify.toml @@ -2,9 +2,3 @@ publish = "packages/components/storybook-static/" build = "cd packages/squiggle-lang && yarn build && cd ../components && yarn build" ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF packages/components packages/squiggle-lang" - -[build.environment] - NETLIFY_USE_YARN = true - -[context.deploy-preview] - ignore = "node -e 'process.env.BRANCH.includes(\"dependabot\") ? 0 : 1'" \ No newline at end of file diff --git a/packages/website/netlify.toml b/packages/website/netlify.toml index c5bee71d..327ea2f8 100644 --- a/packages/website/netlify.toml +++ b/packages/website/netlify.toml @@ -1,10 +1,4 @@ [build] publish = "packages/website/build/" build = "cd packages/squiggle-lang && yarn build && cd ../website && yarn build" - # ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF packages/website packages/components packages/squiggle-lang" - -[build.environment] - NETLIFY_USE_YARN = true - -[context.deploy-preview] - ignore = "node -e 'process.env.BRANCH.includes(\"dependabot\") ? 0 : 1'" \ No newline at end of file + # ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF packages/website packages/components packages/squiggle-lang" \ No newline at end of file From dd01c0eff1c6b11ecfa798ca283ef5f01ea4232b Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 22:24:37 -0400 Subject: [PATCH 08/32] perhaps a bool is a string --- netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index e60a3555..df8408c1 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,5 +1,5 @@ [build.environment] - NETLIFY_USE_YARN = true + NETLIFY_USE_YARN = "true" [context.deploy-preview] ignore = "node -e 'process.env.BRANCH.includes(\"dependabot\") ? 0 : 1'" \ No newline at end of file From 4ba0212aaccc61fb8b984f4bf6ff67f33fd48960 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 22:36:49 -0400 Subject: [PATCH 09/32] try setting `base = "./"` --- netlify.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/netlify.toml b/netlify.toml index df8408c1..88326555 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,3 +1,6 @@ +[build] + base = "./" + [build.environment] NETLIFY_USE_YARN = "true" From 261eb8d9ae14baeacf0e61f7917d409005b9d571 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 22:39:53 -0400 Subject: [PATCH 10/32] will it skip now? --- netlify-skip-deploy.js | 1 + netlify.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 netlify-skip-deploy.js diff --git a/netlify-skip-deploy.js b/netlify-skip-deploy.js new file mode 100644 index 00000000..47d2e789 --- /dev/null +++ b/netlify-skip-deploy.js @@ -0,0 +1 @@ +process.env.BRANCH.includes("dependabot") ? 0 : 1 \ No newline at end of file diff --git a/netlify.toml b/netlify.toml index 88326555..00d8ab51 100644 --- a/netlify.toml +++ b/netlify.toml @@ -5,4 +5,4 @@ NETLIFY_USE_YARN = "true" [context.deploy-preview] - ignore = "node -e 'process.env.BRANCH.includes(\"dependabot\") ? 0 : 1'" \ No newline at end of file + ignore = "node -e netlify-skip-deploy.js # 'process.env.BRANCH.includes(\"dependabot\") ? 0 : 1'" \ No newline at end of file From cd23fbb0db502126eb1d787435d0afa651c97ef1 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 22:41:40 -0400 Subject: [PATCH 11/32] ...try this --- netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index 00d8ab51..d8f6c01e 100644 --- a/netlify.toml +++ b/netlify.toml @@ -5,4 +5,4 @@ NETLIFY_USE_YARN = "true" [context.deploy-preview] - ignore = "node -e netlify-skip-deploy.js # 'process.env.BRANCH.includes(\"dependabot\") ? 0 : 1'" \ No newline at end of file + ignore = "node netlify-skip-deploy.js # -e 'process.env.BRANCH.includes(\"dependabot\") ? 0 : 1'" \ No newline at end of file From b41f74a271b265c36d42c9c23174ce850315e462 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 22:46:22 -0400 Subject: [PATCH 12/32] triggers and builds :) --- netlify.toml | 2 +- packages/components/netlify.toml | 7 ++++--- packages/website/netlify.toml | 7 ++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/netlify.toml b/netlify.toml index d8f6c01e..598ce492 100644 --- a/netlify.toml +++ b/netlify.toml @@ -5,4 +5,4 @@ NETLIFY_USE_YARN = "true" [context.deploy-preview] - ignore = "node netlify-skip-deploy.js # -e 'process.env.BRANCH.includes(\"dependabot\") ? 0 : 1'" \ No newline at end of file + ignore = "node netlify-skip-deploy.js \ No newline at end of file diff --git a/packages/components/netlify.toml b/packages/components/netlify.toml index 78b8b6c0..6fb5e674 100644 --- a/packages/components/netlify.toml +++ b/packages/components/netlify.toml @@ -1,4 +1,5 @@ [build] - publish = "packages/components/storybook-static/" - build = "cd packages/squiggle-lang && yarn build && cd ../components && yarn build" - ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF packages/components packages/squiggle-lang" + base = "packages/components/" + publish = "storybook-static/" + build = "cd ../squiggle-lang && yarn build && cd ../components && yarn build" + ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../squiggle-lang" diff --git a/packages/website/netlify.toml b/packages/website/netlify.toml index 327ea2f8..2f2b5af5 100644 --- a/packages/website/netlify.toml +++ b/packages/website/netlify.toml @@ -1,4 +1,5 @@ [build] - publish = "packages/website/build/" - build = "cd packages/squiggle-lang && yarn build && cd ../website && yarn build" - # ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF packages/website packages/components packages/squiggle-lang" \ No newline at end of file + base = "packages/website/" + publish = "build/" + build = "cd ../squiggle-lang && yarn build && cd ../website && yarn build" + # ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../components ../squiggle-lang" \ No newline at end of file From 182d639664e9793883b80e769990c0748125b399 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 22:47:45 -0400 Subject: [PATCH 13/32] missing " character --- netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index 598ce492..6623f5be 100644 --- a/netlify.toml +++ b/netlify.toml @@ -5,4 +5,4 @@ NETLIFY_USE_YARN = "true" [context.deploy-preview] - ignore = "node netlify-skip-deploy.js \ No newline at end of file + ignore = "node netlify-skip-deploy.js" \ No newline at end of file From e16e015e4ca0b7df5af7b31f66acb7cd026ca079 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 22:51:17 -0400 Subject: [PATCH 14/32] moved stuff into scripts subdir --- netlify.toml | 2 +- flake-compat.nix => scripts/flake-compat.nix | 0 flake.lock => scripts/flake.lock | 0 flake.nix => scripts/flake.nix | 0 scripts/netlify-skip-deploy.js | 1 + 5 files changed, 2 insertions(+), 1 deletion(-) rename flake-compat.nix => scripts/flake-compat.nix (100%) rename flake.lock => scripts/flake.lock (100%) rename flake.nix => scripts/flake.nix (100%) create mode 100644 scripts/netlify-skip-deploy.js diff --git a/netlify.toml b/netlify.toml index 6623f5be..30511978 100644 --- a/netlify.toml +++ b/netlify.toml @@ -5,4 +5,4 @@ NETLIFY_USE_YARN = "true" [context.deploy-preview] - ignore = "node netlify-skip-deploy.js" \ No newline at end of file + ignore = "node scripts/netlify-skip-deploy.js" \ No newline at end of file diff --git a/flake-compat.nix b/scripts/flake-compat.nix similarity index 100% rename from flake-compat.nix rename to scripts/flake-compat.nix diff --git a/flake.lock b/scripts/flake.lock similarity index 100% rename from flake.lock rename to scripts/flake.lock diff --git a/flake.nix b/scripts/flake.nix similarity index 100% rename from flake.nix rename to scripts/flake.nix diff --git a/scripts/netlify-skip-deploy.js b/scripts/netlify-skip-deploy.js new file mode 100644 index 00000000..3c2897f9 --- /dev/null +++ b/scripts/netlify-skip-deploy.js @@ -0,0 +1 @@ +process.exitCode = process.env.BRANCH.includes("dependabot") ? 0 : 1 \ No newline at end of file From bd54a722e24c5d42c12aabb303677bbcb84d00ea Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 22:59:44 -0400 Subject: [PATCH 15/32] more ignore logic --- netlify-skip-deploy.js | 1 - netlify.toml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 netlify-skip-deploy.js diff --git a/netlify-skip-deploy.js b/netlify-skip-deploy.js deleted file mode 100644 index 47d2e789..00000000 --- a/netlify-skip-deploy.js +++ /dev/null @@ -1 +0,0 @@ -process.env.BRANCH.includes("dependabot") ? 0 : 1 \ No newline at end of file diff --git a/netlify.toml b/netlify.toml index 30511978..4a9baffd 100644 --- a/netlify.toml +++ b/netlify.toml @@ -5,4 +5,4 @@ NETLIFY_USE_YARN = "true" [context.deploy-preview] - ignore = "node scripts/netlify-skip-deploy.js" \ No newline at end of file + ignore = "node scripts/netlify-skip-deploy.js && git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF" packages \ No newline at end of file From 7f0bdb03885ce6ae1fea04b6ebea37628e2d9244 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 23:01:05 -0400 Subject: [PATCH 16/32] ugh, missing " again --- netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index 4a9baffd..28055fdb 100644 --- a/netlify.toml +++ b/netlify.toml @@ -5,4 +5,4 @@ NETLIFY_USE_YARN = "true" [context.deploy-preview] - ignore = "node scripts/netlify-skip-deploy.js && git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF" packages \ No newline at end of file + ignore = "node scripts/netlify-skip-deploy.js && git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF" packages" \ No newline at end of file From 37537f3435c009ecf625e85a958f7d1b0be83b52 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 23:02:28 -0400 Subject: [PATCH 17/32] ... --- netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index 28055fdb..0a9b514e 100644 --- a/netlify.toml +++ b/netlify.toml @@ -5,4 +5,4 @@ NETLIFY_USE_YARN = "true" [context.deploy-preview] - ignore = "node scripts/netlify-skip-deploy.js && git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF" packages" \ No newline at end of file + ignore = "node scripts/netlify-skip-deploy.js && git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF packages" \ No newline at end of file From ad88d82784bdb059e06822818155255f0644503e Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 23:07:22 -0400 Subject: [PATCH 18/32] just testing something --- netlify.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/netlify.toml b/netlify.toml index 0a9b514e..1417a879 100644 --- a/netlify.toml +++ b/netlify.toml @@ -5,4 +5,5 @@ NETLIFY_USE_YARN = "true" [context.deploy-preview] + ignore = "node -e 'process.exitCode = process.env.BRANCH.includes(\"dependabot\") ? 0 : 1' && gt diff --quiet $CACHED_COMMIT_REF $COMMIT_REF packages" ignore = "node scripts/netlify-skip-deploy.js && git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF packages" \ No newline at end of file From e5ea9ca279a97e8e2ae1a77ef8d890d29356a004 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 23:08:50 -0400 Subject: [PATCH 19/32] forgot comment --- netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index 1417a879..86a63756 100644 --- a/netlify.toml +++ b/netlify.toml @@ -6,4 +6,4 @@ [context.deploy-preview] ignore = "node -e 'process.exitCode = process.env.BRANCH.includes(\"dependabot\") ? 0 : 1' && gt diff --quiet $CACHED_COMMIT_REF $COMMIT_REF packages" - ignore = "node scripts/netlify-skip-deploy.js && git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF packages" \ No newline at end of file + # ignore = "node scripts/netlify-skip-deploy.js && git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF packages" \ No newline at end of file From 154cbb5eec25a1a6f6532fd19e08b479862112a9 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 23:12:05 -0400 Subject: [PATCH 20/32] removed flake --- README.md | 11 ---- netlify.toml | 3 +- scripts/flake-compat.nix | 9 ---- scripts/flake.lock | 44 ---------------- scripts/flake.nix | 94 ---------------------------------- scripts/netlify-skip-deploy.js | 1 - 6 files changed, 1 insertion(+), 161 deletions(-) delete mode 100644 scripts/flake-compat.nix delete mode 100644 scripts/flake.lock delete mode 100644 scripts/flake.nix delete mode 100644 scripts/netlify-skip-deploy.js diff --git a/README.md b/README.md index d1b85bb6..108720fc 100644 --- a/README.md +++ b/README.md @@ -42,17 +42,6 @@ yarn See `packages/*/README.md` to work with whatever project you're interested in. -## `codium` for `rescript` - -If you have `nix` installed with `flakes` enabled, you can build a `codium` in this repo for `rescript` development, if you don't want to pollute your machine's global editor with another mode/extension. - -```sh -nix develop -codium -``` - -The `nix develop` shell also provides `yarn`. - # Contributing See `CONTRIBUTING.md`. diff --git a/netlify.toml b/netlify.toml index 86a63756..afa64ba5 100644 --- a/netlify.toml +++ b/netlify.toml @@ -5,5 +5,4 @@ NETLIFY_USE_YARN = "true" [context.deploy-preview] - ignore = "node -e 'process.exitCode = process.env.BRANCH.includes(\"dependabot\") ? 0 : 1' && gt diff --quiet $CACHED_COMMIT_REF $COMMIT_REF packages" - # ignore = "node scripts/netlify-skip-deploy.js && git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF packages" \ No newline at end of file + ignore = "node -e 'process.exitCode = process.env.BRANCH.includes(\"dependabot\") ? 0 : 1' && gt diff --quiet $CACHED_COMMIT_REF $COMMIT_REF packages" \ No newline at end of file diff --git a/scripts/flake-compat.nix b/scripts/flake-compat.nix deleted file mode 100644 index dab420bb..00000000 --- a/scripts/flake-compat.nix +++ /dev/null @@ -1,9 +0,0 @@ -let - lock = builtins.fromJSON (builtins.readFile ./flake.lock); - inherit (lock.nodes.flake-compat.locked) owner repo rev narHash; - flake-compat = builtins.fetchTarball { - url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; - sha256 = narHash; - }; -in -import flake-compat { src = ./.; } diff --git a/scripts/flake.lock b/scripts/flake.lock deleted file mode 100644 index ee618311..00000000 --- a/scripts/flake.lock +++ /dev/null @@ -1,44 +0,0 @@ -{ - "nodes": { - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1641205782, - "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1647893727, - "narHash": "sha256-pOi7VdCb+s5Cwh5CS7YEZVRgH9uCmE87J5W7iXv29Ck=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "1ec61dd4167f04be8d05c45780818826132eea0d", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-compat": "flake-compat", - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/scripts/flake.nix b/scripts/flake.nix deleted file mode 100644 index d39ba79a..00000000 --- a/scripts/flake.nix +++ /dev/null @@ -1,94 +0,0 @@ -{ - description = "Building codium for rescript development"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - flake-compat = { - url = "github:edolstra/flake-compat"; - flake = false; - }; - }; - - outputs = - { self - , nixpkgs - , flake-compat - }: - let - # Generate a user-friendly version number. - version = builtins.substring 0 8 self.lastModifiedDate; - # System types to support. - supportedSystems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ]; - # Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'. - forAllSystems = nixpkgs.lib.genAttrs supportedSystems; - # Nixpkgs instantiated for supported system types. - nixpkgsFor = forAllSystems (system: - import nixpkgs { - inherit system; - overlays = [ self.overlay ]; - }); - in - { - overlay = final: prev: { }; - # the default devShell used when running `nix develop` - devShell = forAllSystems (system: self.devShells.${system}.defaultShell); - devShells = forAllSystems (system: - let - pkgs = nixpkgsFor."${system}"; - in - { - # In case we don't want to provide an editor, this defaultShell will provide only coq packages we need. - defaultShell = pkgs.mkShell { - buildInputs = with pkgs; [ - yarn - yarn2nix - nodePackages.npm - nodejs - patchelf - (pkgs.vscode-with-extensions.override { - vscode = pkgs.vscodium; - vscodeExtensions = pkgs.vscode-utils.extensionsFromVscodeMarketplace [ - { - name = "rescript-vscode"; - publisher = "chenglou92"; - version = "1.2.1"; - sha256 = "sha256-7/YakKtJ4WhgAR4rZltrq8g4TtM5QZ2spbrEUrNoXVg="; - } - { - name = "vim"; - publisher = "vscodevim"; - version = "1.22.2"; - sha256 = "sha256-dtIlgODzRdoMKnG9050ZcCX3w15A/R3FaMc+ZylvBbU="; - } - { - name = "vscode-typescript-next"; - publisher = "ms-vscode"; - version = "4.7.20220323"; - sha256 = "sha256-mjiBCyg5As/XAU9I5k6jEZWGJA3P6P5o1roe2bS7aUI="; - } - { - name = "nix-ide"; - publisher = "jnoortheen"; - version = "0.1.20"; - sha256 = "sha256-Q6X41I68m0jaCXaQGEFOoAbSUrr/wFhfCH5KrduOtZo="; - } - { - name = "json"; - publisher = "ZainChen"; - version = "2.0.2"; - sha256 = "sha256-nC3Q8KuCtn/jg1j/NaAxWGvnKe/ykrPm2PUjfsJz8aI="; - } - { - name = "prettier-vscode"; - publisher = "esbenp"; - version = "9.3.0"; - sha256 = "sha256-hJgPjWf7a8+ltjmXTK8U/MwqgIZqBjmcCfHsAk2G3PA="; - } - ]; - }) - ]; - }; - } - ); - }; -} diff --git a/scripts/netlify-skip-deploy.js b/scripts/netlify-skip-deploy.js deleted file mode 100644 index 3c2897f9..00000000 --- a/scripts/netlify-skip-deploy.js +++ /dev/null @@ -1 +0,0 @@ -process.exitCode = process.env.BRANCH.includes("dependabot") ? 0 : 1 \ No newline at end of file From dda5fed7191516dcff04b96ba34763719c6bfedd Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 23:26:53 -0400 Subject: [PATCH 22/32] changed order within toml stanza --- packages/components/netlify.toml | 2 +- packages/website/netlify.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/components/netlify.toml b/packages/components/netlify.toml index 6fb5e674..830bb85d 100644 --- a/packages/components/netlify.toml +++ b/packages/components/netlify.toml @@ -1,5 +1,5 @@ [build] base = "packages/components/" - publish = "storybook-static/" build = "cd ../squiggle-lang && yarn build && cd ../components && yarn build" + publish = "storybook-static/" ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../squiggle-lang" diff --git a/packages/website/netlify.toml b/packages/website/netlify.toml index 2f2b5af5..5e52ced6 100644 --- a/packages/website/netlify.toml +++ b/packages/website/netlify.toml @@ -1,5 +1,5 @@ [build] base = "packages/website/" - publish = "build/" build = "cd ../squiggle-lang && yarn build && cd ../website && yarn build" + publish = "build/" # ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../components ../squiggle-lang" \ No newline at end of file From 7dc72bd635d5278d2be009f0a0e30fab1a983b3f Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 23:28:48 -0400 Subject: [PATCH 23/32] replace the word build with the word command --- packages/components/netlify.toml | 2 +- packages/website/netlify.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/components/netlify.toml b/packages/components/netlify.toml index 830bb85d..fbbe2e58 100644 --- a/packages/components/netlify.toml +++ b/packages/components/netlify.toml @@ -1,5 +1,5 @@ [build] base = "packages/components/" - build = "cd ../squiggle-lang && yarn build && cd ../components && yarn build" + command = "cd ../squiggle-lang && yarn build && cd ../components && yarn build" publish = "storybook-static/" ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../squiggle-lang" diff --git a/packages/website/netlify.toml b/packages/website/netlify.toml index 5e52ced6..3516e29c 100644 --- a/packages/website/netlify.toml +++ b/packages/website/netlify.toml @@ -1,5 +1,5 @@ [build] base = "packages/website/" - build = "cd ../squiggle-lang && yarn build && cd ../website && yarn build" + command = "cd ../squiggle-lang && yarn build && cd ../website && yarn build" publish = "build/" # ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../components ../squiggle-lang" \ No newline at end of file From 678c4dbee15637d640d8c72c6d8ecd320f992644 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 23:36:05 -0400 Subject: [PATCH 24/32] trying without toplevel netlify.toml --- netlify.toml | 8 -------- packages/components/netlify.toml | 3 +++ packages/website/netlify.toml | 5 ++++- 3 files changed, 7 insertions(+), 9 deletions(-) delete mode 100644 netlify.toml diff --git a/netlify.toml b/netlify.toml deleted file mode 100644 index afa64ba5..00000000 --- a/netlify.toml +++ /dev/null @@ -1,8 +0,0 @@ -[build] - base = "./" - -[build.environment] - NETLIFY_USE_YARN = "true" - -[context.deploy-preview] - ignore = "node -e 'process.exitCode = process.env.BRANCH.includes(\"dependabot\") ? 0 : 1' && gt diff --quiet $CACHED_COMMIT_REF $COMMIT_REF packages" \ No newline at end of file diff --git a/packages/components/netlify.toml b/packages/components/netlify.toml index fbbe2e58..47faacaa 100644 --- a/packages/components/netlify.toml +++ b/packages/components/netlify.toml @@ -3,3 +3,6 @@ command = "cd ../squiggle-lang && yarn build && cd ../components && yarn build" publish = "storybook-static/" ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../squiggle-lang" + +[build.environment] + NETLIFY_USE_YARN = "true" \ No newline at end of file diff --git a/packages/website/netlify.toml b/packages/website/netlify.toml index 3516e29c..fce0febf 100644 --- a/packages/website/netlify.toml +++ b/packages/website/netlify.toml @@ -2,4 +2,7 @@ base = "packages/website/" command = "cd ../squiggle-lang && yarn build && cd ../website && yarn build" publish = "build/" - # ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../components ../squiggle-lang" \ No newline at end of file + ignore = "node -e 'process.exitCode = process.env.BRANCH.includes(\"dependabot\") ? 0 : 1' && gt diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../" + +[build.environment] + NETLIFY_USE_YARN = "true" \ No newline at end of file From b327e08c0e306efa75a2b2ed46d25a74bf61dae8 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 14 Apr 2022 23:40:59 -0400 Subject: [PATCH 25/32] I _think_ the ignore trigger is correct.. --- packages/components/netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/netlify.toml b/packages/components/netlify.toml index 47faacaa..33f923b9 100644 --- a/packages/components/netlify.toml +++ b/packages/components/netlify.toml @@ -2,7 +2,7 @@ base = "packages/components/" command = "cd ../squiggle-lang && yarn build && cd ../components && yarn build" publish = "storybook-static/" - ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../squiggle-lang" + ignore = "node -e 'process.exitCode = process.env.BRANCH.includes(\"dependabot\") ? 0 : 1' && gt diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../squiggle-lang" [build.environment] NETLIFY_USE_YARN = "true" \ No newline at end of file From a1d38b71a17936a6c10d39f2e980f1c9a2780160 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Apr 2022 14:34:48 +0000 Subject: [PATCH 26/32] Bump @types/react-dom from 18.0.0 to 18.0.1 Bumps [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) from 18.0.0 to 18.0.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom) --- updated-dependencies: - dependency-name: "@types/react-dom" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index e5095583..7446be71 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -10,7 +10,7 @@ "@types/lodash": "^4.14.181", "@types/node": "^17.0.24", "@types/react": "^18.0.3", - "@types/react-dom": "^18.0.0", + "@types/react-dom": "^18.0.1", "antd": "^4.19.3", "cross-env": "^7.0.3", "lodash": "^4.17.21", diff --git a/yarn.lock b/yarn.lock index 1dbbc5f6..b26a2308 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3995,10 +3995,10 @@ resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== -"@types/react-dom@^18.0.0": - version "18.0.0" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.0.0.tgz#b13f8d098e4b0c45df4f1ed123833143b0c71141" - integrity sha512-49897Y0UiCGmxZqpC8Blrf6meL8QUla6eb+BBhn69dTXlmuOlzkfr7HHY/O8J25e1lTUMs+YYxSlVDAaGHCOLg== +"@types/react-dom@^18.0.0", "@types/react-dom@^18.0.1": + version "18.0.1" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.0.1.tgz#cb3cc10ea91141b12c71001fede1017acfbce4db" + integrity sha512-jCwTXvHtRLiyVvKm9aEdHXs8rflVOGd5Sl913JZrPshfXjn8NYsTNZOz70bCsA31IR0TOqwi3ad+X4tSCBoMTw== dependencies: "@types/react" "*" From 4c5a0e51749536e1f2d8c8e2b7ca9bb963e0bd6b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Apr 2022 14:35:17 +0000 Subject: [PATCH 27/32] Bump react-ace from 9.5.0 to 10.0.0 Bumps [react-ace](https://github.com/securingsincity/react-ace) from 9.5.0 to 10.0.0. - [Release notes](https://github.com/securingsincity/react-ace/releases) - [Changelog](https://github.com/securingsincity/react-ace/blob/main/CHANGELOG.md) - [Commits](https://github.com/securingsincity/react-ace/compare/v9.5.0...v10.0.0) --- updated-dependencies: - dependency-name: react-ace dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index e5095583..e9519c5f 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -15,7 +15,7 @@ "cross-env": "^7.0.3", "lodash": "^4.17.21", "react": "^18.0.0", - "react-ace": "9.5.0", + "react-ace": "10.0.0", "react-dom": "^18.0.0", "react-scripts": "5.0.1", "react-vega": "^7.5.0", diff --git a/yarn.lock b/yarn.lock index 1dbbc5f6..56d91ab0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4592,7 +4592,7 @@ accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.8: mime-types "~2.1.34" negotiator "0.6.3" -ace-builds@^1.4.13: +ace-builds@^1.4.14: version "1.4.14" resolved "https://registry.yarnpkg.com/ace-builds/-/ace-builds-1.4.14.tgz#2c41ccbccdd09e665d3489f161a20baeb3a3c852" integrity sha512-NBOQlm9+7RBqRqZwimpgquaLeTJFayqb9UEPtTkpC3TkkwDnlsT/TwsCC0svjt9kEZ6G9mH5AEOHSz6Q/HrzQQ== @@ -14020,12 +14020,12 @@ rc@^1.2.8: minimist "^1.2.0" strip-json-comments "~2.0.1" -react-ace@9.5.0: - version "9.5.0" - resolved "https://registry.yarnpkg.com/react-ace/-/react-ace-9.5.0.tgz#b6c32b70d404dd821a7e01accc2d76da667ff1f7" - integrity sha512-4l5FgwGh6K7A0yWVMQlPIXDItM4Q9zzXRqOae8KkCl6MkOob7sC1CzHxZdOGvV+QioKWbX2p5HcdOVUv6cAdSg== +react-ace@10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/react-ace/-/react-ace-10.0.0.tgz#1760e302604cff35ba40963db43eb027513b6572" + integrity sha512-AUoA2OsKOCv8fXLqcFM232dF/Z8w14bwPUZ9z5I2zjBfqfZOZLqxnhXN+qKL6VrQXs1DLUvalGOuM5TABAFOCA== dependencies: - ace-builds "^1.4.13" + ace-builds "^1.4.14" diff-match-patch "^1.0.5" lodash.get "^4.4.2" lodash.isequal "^4.5.0" From 1e8e05ba9537f10353b3475da81581b4512b35c2 Mon Sep 17 00:00:00 2001 From: Quinn Date: Fri, 15 Apr 2022 10:41:06 -0400 Subject: [PATCH 28/32] `gt` => `git` --- packages/website/netlify.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/website/netlify.toml b/packages/website/netlify.toml index fce0febf..1827c88e 100644 --- a/packages/website/netlify.toml +++ b/packages/website/netlify.toml @@ -2,7 +2,7 @@ base = "packages/website/" command = "cd ../squiggle-lang && yarn build && cd ../website && yarn build" publish = "build/" - ignore = "node -e 'process.exitCode = process.env.BRANCH.includes(\"dependabot\") ? 0 : 1' && gt diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../" + ignore = "node -e 'process.exitCode = process.env.BRANCH.includes(\"dependabot\") ? 0 : 1' && git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../" [build.environment] - NETLIFY_USE_YARN = "true" \ No newline at end of file + NETLIFY_USE_YARN = "true" From bc26e424fe790e66e12d31a3a1fcca621e02c405 Mon Sep 17 00:00:00 2001 From: Quinn Date: Fri, 15 Apr 2022 10:41:38 -0400 Subject: [PATCH 29/32] `gt` -> `git` --- packages/components/netlify.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/components/netlify.toml b/packages/components/netlify.toml index 33f923b9..d6e5474d 100644 --- a/packages/components/netlify.toml +++ b/packages/components/netlify.toml @@ -2,7 +2,7 @@ base = "packages/components/" command = "cd ../squiggle-lang && yarn build && cd ../components && yarn build" publish = "storybook-static/" - ignore = "node -e 'process.exitCode = process.env.BRANCH.includes(\"dependabot\") ? 0 : 1' && gt diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../squiggle-lang" + ignore = "node -e 'process.exitCode = process.env.BRANCH.includes(\"dependabot\") ? 0 : 1' && git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../squiggle-lang" [build.environment] - NETLIFY_USE_YARN = "true" \ No newline at end of file + NETLIFY_USE_YARN = "true" From 27610e2a6f066621329561f3400eea2f6bd7fb29 Mon Sep 17 00:00:00 2001 From: Quinn Date: Fri, 15 Apr 2022 10:58:13 -0400 Subject: [PATCH 30/32] Update user-bug.md --- .github/ISSUE_TEMPLATE/user-bug.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/user-bug.md b/.github/ISSUE_TEMPLATE/user-bug.md index 281a859f..e31036df 100644 --- a/.github/ISSUE_TEMPLATE/user-bug.md +++ b/.github/ISSUE_TEMPLATE/user-bug.md @@ -1,6 +1,6 @@ --- name: Bug reports for Squiggle users -about: Rendering oddly, trouble with the playground, something like this? +about: Rendering oddly? Is there a mathematical correctness problem? labels: "bug" --- From 8743b235d6ccfbe408d6a54e61aab53572db2aba Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Fri, 15 Apr 2022 12:54:04 -0400 Subject: [PATCH 31/32] fix: typo --- .../src/rescript/Distributions/SymbolicDist/SymbolicDist.res | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/Distributions/SymbolicDist/SymbolicDist.res b/packages/squiggle-lang/src/rescript/Distributions/SymbolicDist/SymbolicDist.res index 0ef8b3d0..da722036 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/SymbolicDist/SymbolicDist.res +++ b/packages/squiggle-lang/src/rescript/Distributions/SymbolicDist/SymbolicDist.res @@ -160,14 +160,14 @@ module Lognormal = { let multiply = (l1, l2) => { // https://wikiless.org/wiki/Log-normal_distribution?lang=en#Multiplication_and_division_of_independent,_log-normal_random_variables let mu = l1.mu +. l2.mu - let sigma = Js.Math.sqrt(l1.sigma ** 2. +. l2.sigma ** 2.) // m + let sigma = Js.Math.sqrt(l1.sigma ** 2. +. l2.sigma ** 2.) #Lognormal({mu: mu, sigma: sigma}) } let divide = (l1, l2) => { let mu = l1.mu -. l2.mu // We believe the ratiands will have covariance zero. // See here https://stats.stackexchange.com/questions/21735/what-are-the-mean-and-variance-of-the-ratio-of-two-lognormal-variables for details - let sigma = Js.Math.sqrt(l1.sigma ** 2. +. l2.sigma ** 2.) // m + let sigma = Js.Math.sqrt(l1.sigma ** 2. +. l2.sigma ** 2.) #Lognormal({mu: mu, sigma: sigma}) } let operate = (operation: Operation.Algebraic.t, n1: t, n2: t) => From c15412642ac1bcfb748db7b7b5495984c81f6a7e Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Fri, 15 Apr 2022 13:01:49 -0400 Subject: [PATCH 32/32] fix: Failing tests --- .../ReducerInterface/ReducerInterface_Distribution_test.res | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/squiggle-lang/__tests__/ReducerInterface/ReducerInterface_Distribution_test.res b/packages/squiggle-lang/__tests__/ReducerInterface/ReducerInterface_Distribution_test.res index 9e25f7e2..1b5f8bfd 100644 --- a/packages/squiggle-lang/__tests__/ReducerInterface/ReducerInterface_Distribution_test.res +++ b/packages/squiggle-lang/__tests__/ReducerInterface/ReducerInterface_Distribution_test.res @@ -63,8 +63,8 @@ describe("eval on distribution functions", () => { testEval("lognormal(5, 2) * 2", "Ok(Lognormal(5.693147180559945,2))") }) describe("division", () => { - testEval("lognormal(5,2) / lognormal(10,2)", "Ok(Lognormal(-5,4))") - testEval("lognormal(10,2) / lognormal(5,2)", "Ok(Lognormal(5,4))") + testEval("lognormal(5,2) / lognormal(10,2)", "Ok(Lognormal(-5,2.8284271247461903))") + testEval("lognormal(10,2) / lognormal(5,2)", "Ok(Lognormal(5,2.8284271247461903))") testEval("lognormal(5, 2) / 2", "Ok(Lognormal(4.306852819440055,2))") testEval("2 / lognormal(5, 2)", "Ok(Lognormal(-4.306852819440055,2))") testEval("2 / normal(10, 2)", "Ok(Point Set Distribution)")