diff --git a/apps/class-solid/src/components/PermutationSweepButton.tsx b/apps/class-solid/src/components/PermutationSweepButton.tsx
deleted file mode 100644
index e5a40848..00000000
--- a/apps/class-solid/src/components/PermutationSweepButton.tsx
+++ /dev/null
@@ -1,120 +0,0 @@
-import type { Config } from "@classmodel/class/config";
-import {
- type PartialConfig,
- mergeConfigurations,
-} from "@classmodel/class/config_utils";
-import { type Sweep, performSweep } from "@classmodel/class/sweep";
-import { For, createSignal } from "solid-js";
-import { unwrap } from "solid-js/store";
-import { Button } from "~/components/ui/button";
-import { type Experiment, runExperiment, setExperiments } from "~/lib/store";
-import {
- Dialog,
- DialogContent,
- DialogFooter,
- DialogHeader,
- DialogTitle,
- DialogTrigger,
-} from "./ui/dialog";
-
-function nameForPermutation(config: PartialConfig): string {
- const chunks = [];
- for (const [section, params] of Object.entries(config)) {
- const paramChunks = [];
- for (const [param, value] of Object.entries(params)) {
- paramChunks.push(`${param}=${value}`);
- }
- // Add section?
- chunks.push(paramChunks.join(","));
- }
- return chunks.join(",");
-}
-
-function config2permutation(reference: Config, config: PartialConfig): Config {
- return {
- ...mergeConfigurations(reference, config),
- name: nameForPermutation(config),
- description: "",
- };
-}
-
-function configs2Permutations(
- reference: Config,
- configs: PartialConfig[],
-): Config[] {
- return configs.map((c) => config2permutation(reference, c));
-}
-
-export function PermutationSweepButton(props: {
- experiment: Experiment;
- experimentIndex: number;
-}) {
- const sweeps: Sweep[] = [
- {
- section: "initialState",
- parameter: "h_0",
- start: 100,
- step: 100,
- steps: 5,
- },
- {
- section: "mixedLayer",
- parameter: "beta",
- start: 0.1,
- step: 0.1,
- steps: 5,
- },
- ];
-
- function addSweep() {
- const configs = performSweep(sweeps);
- const perms = configs2Permutations(
- unwrap(props.experiment.config.reference),
- configs,
- );
- setOpen(false);
- setExperiments(props.experimentIndex, "config", "permutations", perms);
- runExperiment(props.experimentIndex);
- }
- const [open, setOpen] = createSignal(false);
- return (
-
- );
-}
diff --git a/apps/class-solid/src/components/PermutationsList.tsx b/apps/class-solid/src/components/PermutationsList.tsx
index 8a7b2071..608d9302 100644
--- a/apps/class-solid/src/components/PermutationsList.tsx
+++ b/apps/class-solid/src/components/PermutationsList.tsx
@@ -14,7 +14,6 @@ import {
setPermutationConfigInExperiment,
swapPermutationAndReferenceConfiguration,
} from "~/lib/store";
-import { PermutationSweepButton } from "./PermutationSweepButton";
import {
MdiCakeVariantOutline,
MdiCog,
@@ -303,10 +302,6 @@ export function PermutationsList(props: {
experiment={props.experiment}
experimentIndex={props.experimentIndex}
/>
-
diff --git a/apps/class-solid/src/lib/presets/death-valley.json b/apps/class-solid/src/lib/presets/death-valley.json
index cd713d66..17f3f851 100644
--- a/apps/class-solid/src/lib/presets/death-valley.json
+++ b/apps/class-solid/src/lib/presets/death-valley.json
@@ -1,25 +1,19 @@
{
"name": "Death Valley",
"description": "Preset with Death Valley conditions",
- "initialState": {
- "theta_0": 323,
- "h_0": 200,
- "dtheta_0": 1,
- "q_0": 0.008,
- "dq_0": -0.001
- },
- "timeControl": {
- "dt": 60,
- "runtime": 4320
- },
- "mixedLayer": {
- "wtheta": 0.1,
- "advtheta": 0,
- "gammatheta": 0.006,
- "wq": 0.0001,
- "advq": 0,
- "gammaq": 0,
- "divU": 0,
- "beta": 0.2
- }
+ "theta_0": 323,
+ "h_0": 200,
+ "dtheta_0": 1,
+ "q_0": 0.008,
+ "dq_0": -0.001,
+ "dt": 60,
+ "runtime": 43200,
+ "wtheta": [0.1],
+ "advtheta": 0,
+ "gammatheta": 0.006,
+ "wq": 0.0001,
+ "advq": 0,
+ "gammaq": 0,
+ "divU": 0,
+ "beta": 0.2
}
diff --git a/apps/class-solid/tests/share.spec.ts b/apps/class-solid/tests/share.spec.ts
index d9399a64..f0580a69 100644
--- a/apps/class-solid/tests/share.spec.ts
+++ b/apps/class-solid/tests/share.spec.ts
@@ -44,35 +44,3 @@ test("Create share link from an experiment", async ({ page }) => {
// TODO: finalheight is gone; implement alternative check to see that experiment finished
});
-
-test("Given large app state, sharing is not possible", async ({ page }) => {
- test.skip(
- true,
- "Plotting is too slow, to render 13 experiments with 24 permuations each",
- );
- await page.goto("/");
-
- // Create a new experiment
- await page.getByRole("button", { name: "Add Start from preset" }).click();
- await page
- .getByRole("button", { name: "Default The classic default" })
- .click();
- await page.getByRole("button", { name: "Run" }).click();
- // Add permutation sweep
- await page.getByRole("button", { name: "S", exact: true }).click();
- await page.getByRole("button", { name: "Perform sweep" }).click();
-
- // Duplicate the experiment 12 times
- const times = 12;
- for (let i = 0; i < times; i++) {
- await page
- .getByLabel("Default", { exact: true })
- .getByRole("button", { name: "Duplicate experiment" })
- .click();
- }
-
- await page.getByRole("button", { name: "Share" }).click();
- await page.waitForSelector(
- "text=Cannot share application state, it is too large. Please download each experiment by itself or make it smaller by removing permutations and/or experiments.",
- );
-});
diff --git a/packages/class/package.json b/packages/class/package.json
index 58242f47..22ad98f9 100644
--- a/packages/class/package.json
+++ b/packages/class/package.json
@@ -47,12 +47,6 @@
"default": "./dist/validate.js",
"types": "./dist/validate.d.ts"
}
- },
- "./sweep": {
- "import": {
- "default": "./dist/sweep.js",
- "types": "./dist/sweep.d.ts"
- }
}
},
"homepage": "https://classmodel.github.io/class-web",
diff --git a/packages/class/src/sweep.test.ts b/packages/class/src/sweep.test.ts
deleted file mode 100644
index e0fd06fd..00000000
--- a/packages/class/src/sweep.test.ts
+++ /dev/null
@@ -1,166 +0,0 @@
-import assert from "node:assert";
-import test, { describe } from "node:test";
-import { performSweep } from "./sweep.js";
-
-describe("performSweep", () => {
- test("zero sweeps", () => {
- const perms = performSweep([]);
- assert.deepEqual(perms, []);
- });
-
- test("one sweep", () => {
- const sweeps = [
- {
- section: "initialState",
- parameter: "h_0",
- start: 100,
- step: 100,
- steps: 5,
- },
- ];
-
- const perms = performSweep(sweeps);
-
- const expected = [
- {
- initialState: {
- h_0: 100,
- },
- },
- {
- initialState: {
- h_0: 200,
- },
- },
- {
- initialState: {
- h_0: 300,
- },
- },
- {
- initialState: {
- h_0: 400,
- },
- },
- {
- initialState: {
- h_0: 500,
- },
- },
- ];
- assert.deepEqual(perms, expected);
- });
-
- test("two sweeps", () => {
- const sweeps = [
- {
- section: "initialState",
- parameter: "h_0",
- start: 100,
- step: 100,
- steps: 2,
- },
- {
- section: "mixedLayer",
- parameter: "beta",
- start: 0.1,
- step: 0.1,
- steps: 2,
- },
- ];
-
- const perms = performSweep(sweeps);
-
- const expected = [
- {
- initialState: {
- h_0: 100,
- },
- mixedLayer: {
- beta: 0.1,
- },
- },
- {
- initialState: {
- h_0: 100,
- },
- mixedLayer: {
- beta: 0.2,
- },
- },
- {
- initialState: {
- h_0: 200,
- },
- mixedLayer: {
- beta: 0.1,
- },
- },
- {
- initialState: {
- h_0: 200,
- },
- mixedLayer: {
- beta: 0.2,
- },
- },
- ];
- assert.deepEqual(perms, expected);
- });
-
- test("3 uneven sweeps", () => {
- const sweeps = [
- {
- section: "initialState",
- parameter: "h_0",
- start: 100,
- step: 100,
- steps: 2,
- },
- {
- section: "mixedLayer",
- parameter: "beta",
- start: 0.1,
- step: 0.1,
- steps: 3,
- },
- {
- section: "initialState",
- parameter: "theta_0",
- start: 268,
- step: 5,
- steps: 4,
- },
- ];
-
- const perms = performSweep(sweeps);
-
- const expected = [
- { initialState: { h_0: 100, theta_0: 268 }, mixedLayer: { beta: 0.1 } },
- { initialState: { h_0: 100, theta_0: 273 }, mixedLayer: { beta: 0.1 } },
- { initialState: { h_0: 100, theta_0: 278 }, mixedLayer: { beta: 0.1 } },
- { initialState: { h_0: 100, theta_0: 283 }, mixedLayer: { beta: 0.1 } },
- { initialState: { h_0: 100, theta_0: 268 }, mixedLayer: { beta: 0.2 } },
- { initialState: { h_0: 100, theta_0: 273 }, mixedLayer: { beta: 0.2 } },
- { initialState: { h_0: 100, theta_0: 278 }, mixedLayer: { beta: 0.2 } },
- { initialState: { h_0: 100, theta_0: 283 }, mixedLayer: { beta: 0.2 } },
- { initialState: { h_0: 100, theta_0: 268 }, mixedLayer: { beta: 0.3 } },
- { initialState: { h_0: 100, theta_0: 273 }, mixedLayer: { beta: 0.3 } },
- { initialState: { h_0: 100, theta_0: 278 }, mixedLayer: { beta: 0.3 } },
- { initialState: { h_0: 100, theta_0: 283 }, mixedLayer: { beta: 0.3 } },
- { initialState: { h_0: 200, theta_0: 268 }, mixedLayer: { beta: 0.1 } },
- { initialState: { h_0: 200, theta_0: 273 }, mixedLayer: { beta: 0.1 } },
- { initialState: { h_0: 200, theta_0: 278 }, mixedLayer: { beta: 0.1 } },
- { initialState: { h_0: 200, theta_0: 283 }, mixedLayer: { beta: 0.1 } },
- { initialState: { h_0: 200, theta_0: 268 }, mixedLayer: { beta: 0.2 } },
- { initialState: { h_0: 200, theta_0: 273 }, mixedLayer: { beta: 0.2 } },
- { initialState: { h_0: 200, theta_0: 278 }, mixedLayer: { beta: 0.2 } },
- { initialState: { h_0: 200, theta_0: 283 }, mixedLayer: { beta: 0.2 } },
- { initialState: { h_0: 200, theta_0: 268 }, mixedLayer: { beta: 0.3 } },
- { initialState: { h_0: 200, theta_0: 273 }, mixedLayer: { beta: 0.3 } },
- { initialState: { h_0: 200, theta_0: 278 }, mixedLayer: { beta: 0.3 } },
- { initialState: { h_0: 200, theta_0: 283 }, mixedLayer: { beta: 0.3 } },
- ];
- assert.deepEqual(perms, expected);
- });
-});
diff --git a/packages/class/src/sweep.ts b/packages/class/src/sweep.ts
deleted file mode 100644
index 513a277d..00000000
--- a/packages/class/src/sweep.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import { type PartialConfig, mergeConfigurations } from "./config_utils.js";
-
-export interface Sweep {
- section: string; // Only handles single level nesting
- parameter: string;
- start: number;
- step: number;
- steps: number;
-}
-
-function cartesianProduct(values: PartialConfig[][]): PartialConfig[] {
- if (values.length === 0) return [];
- return values.reduce(
- (acc, curr) =>
- acc.flatMap((a) => curr.map((b) => mergeConfigurations(a, b))),
- [{}],
- );
-}
-export function performSweep(sweeps: Sweep[]): PartialConfig[] {
- if (sweeps.length === 0) {
- return [];
- }
-
- const values = [];
- for (const sweep of sweeps) {
- const sweepValues = [];
- for (let i = 0; i < sweep.steps; i++) {
- const value = Number.parseFloat(
- (sweep.start + i * sweep.step).toFixed(4),
- );
- const perm = {
- [sweep.section]: {
- [sweep.parameter]: value,
- },
- };
- sweepValues.push(perm);
- }
- values.push(sweepValues);
- }
-
- return cartesianProduct(values);
-}