nhamid289 commited on
Commit
118e662
·
verified ·
1 Parent(s): 8071c8f

Deploy from elvis-code (redesigned with the ELVIS design system)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. backend/.python-version +1 -1
  2. backend/README.md +10 -0
  3. backend/contract/gradient_descent_quadratic.json +11 -0
  4. backend/contract/invalid_function.json +6 -0
  5. backend/contract/newton_singular_hessian.json +20 -0
  6. backend/contract/past_the_end.json +6 -0
  7. backend/pyproject.toml +16 -7
  8. backend/requirements.txt +0 -4
  9. backend/src/__pycache__/opimization_logic.cpython-313.pyc +0 -0
  10. backend/src/__pycache__/optimization_logic.cpython-314.pyc +0 -0
  11. backend/src/__pycache__/optimization_manager.cpython-313.pyc +0 -0
  12. backend/src/algorithms.json +60 -0
  13. backend/src/logic.py +256 -0
  14. backend/src/main.py +0 -102
  15. backend/src/manager.py +125 -0
  16. backend/src/optimization_logic.py +0 -663
  17. backend/src/optimization_manager.py +0 -356
  18. backend/tests/test_contract.py +53 -0
  19. backend/tests/test_logic.py +244 -0
  20. backend/uv.lock +51 -397
  21. dist/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
  22. dist/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
  23. dist/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
  24. dist/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
  25. dist/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
  26. dist/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
  27. dist/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
  28. dist/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
  29. dist/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
  30. dist/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
  31. dist/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
  32. dist/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
  33. dist/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
  34. dist/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
  35. dist/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
  36. dist/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
  37. dist/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
  38. dist/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
  39. dist/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
  40. dist/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
  41. dist/assets/{index-D36_PHax.js → index-B28BwTux.js} +0 -0
  42. dist/assets/index-BO7EriOM.css +1 -0
  43. dist/assets/index-DSUxBIVD.css +0 -1
  44. dist/assets/instrument-sans-latin-ext-wght-normal-B5bTHO_g.woff2 +0 -0
  45. dist/assets/instrument-sans-latin-wght-normal-BbzFLZTg.woff2 +0 -0
  46. dist/assets/pyodide.worker-B-lwJug5.js +442 -0
  47. dist/assets/pyodide.worker-Cq5E6qzM.js +0 -1020
  48. dist/index.html +3 -3
  49. frontends/react/.vite/deps/_metadata.json +0 -8
  50. frontends/react/.vite/deps/package.json +0 -3
backend/.python-version CHANGED
@@ -1 +1 @@
1
- 3.13
 
1
+ 3.12
backend/README.md ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ # Optimisation backend
2
+
3
+ Python run in the browser by Pyodide (see `frontends/react/src/pyodide.worker.ts`).
4
+
5
+ - `src/logic.py`: parsing the function, its derivatives, the optimisers and runs
6
+ - `src/manager.py`: the `Manager` methods the UI calls
7
+ - `src/algorithms.json`: each optimiser's settings, shared with the UI
8
+ - `contract/`: example calls, checked by `tests/test_contract.py` and the frontend's `contract.check.ts`
9
+
10
+ Run the tests with `uv run pytest`. They use the Python, NumPy and SymPy versions Pyodide 0.26.1 ships (pinned in `pyproject.toml`), so they match the browser.
backend/contract/gradient_descent_quadratic.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "description": "Gradient descent on x^2 from x = 1 with learning rate 0.25 halves x each iteration",
3
+ "calls": {
4
+ "handle_set_function": { "args": { "variables": 1, "expression": "x^2" }, "result": null },
5
+ "handle_set_runs": { "args": { "runs": [{ "algorithm": "gradient_descent", "start": [1.0], "params": { "learning_rate": 0.25 } }] }, "result": null },
6
+ "handle_state": {
7
+ "args": { "iteration": 2 },
8
+ "result": { "runs": [{ "point": { "position": [0.25], "value": 0.0625, "gradient": [0.5], "hessian": [[2.0]] }, "stopped": null }] }
9
+ }
10
+ }
11
+ }
backend/contract/invalid_function.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "description": "A function of one variable can't use y",
3
+ "calls": {
4
+ "handle_set_function": { "args": { "variables": 1, "expression": "x^2 + y" }, "error": { "kind": "user", "message": "Unknown name y: functions can use x, and" } }
5
+ }
6
+ }
backend/contract/newton_singular_hessian.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "description": "Two runs stepped together on x^2 + 0y: Newton stops at once (singular Hessian), gradient descent (default learning rate 0.1) carries on",
3
+ "calls": {
4
+ "handle_set_function": { "args": { "variables": 2, "expression": "x^2 + 0y" }, "result": null },
5
+ "handle_set_runs": {
6
+ "args": { "runs": [
7
+ { "algorithm": "gradient_descent", "start": [1.0, 1.0], "params": {} },
8
+ { "algorithm": "newton", "start": [1.0, 1.0], "params": {} }
9
+ ] },
10
+ "result": null
11
+ },
12
+ "handle_state": {
13
+ "args": { "iteration": 1 },
14
+ "result": { "runs": [
15
+ { "point": { "position": [0.8, 1.0], "value": 0.64, "gradient": [1.6, 0.0], "hessian": [[2.0, 0.0], [0.0, 0.0]] }, "stopped": null },
16
+ { "point": null, "stopped": "The Hessian is singular here, so Newton's method can't take a step." }
17
+ ] }
18
+ }
19
+ }
20
+ }
backend/contract/past_the_end.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "description": "Before any runs are set there is no state, so the stepper finds the end at iteration 0",
3
+ "calls": {
4
+ "handle_state": { "args": { "iteration": 0 }, "result": null }
5
+ }
6
+ }
backend/pyproject.toml CHANGED
@@ -1,12 +1,21 @@
1
  [project]
2
  name = "backend"
3
  version = "0.1.0"
4
- description = "Add your description here"
5
- readme = "README.md"
6
- requires-python = ">=3.13"
 
7
  dependencies = [
8
- "fastapi>=0.128.0",
9
- "numpy>=2.4.0",
10
- "sympy>=1.14.0",
11
- "uvicorn[standard]>=0.40.0",
12
  ]
 
 
 
 
 
 
 
 
 
 
1
  [project]
2
  name = "backend"
3
  version = "0.1.0"
4
+ description = "Optimisation visualisation: objective functions and optimisers, run in the browser by Pyodide"
5
+ requires-python = ">=3.12,<3.13"
6
+ # The versions Pyodide 0.26.1 ships (pyodide-lock.json), so tests run on the
7
+ # browser's stack; update these with the Pyodide version in packages/pyodide
8
  dependencies = [
9
+ "numpy==1.26.4",
10
+ "sympy==1.12",
11
+ "mpmath==1.3.0",
 
12
  ]
13
+
14
+ [dependency-groups]
15
+ dev = [
16
+ "pytest>=9.2.0",
17
+ ]
18
+
19
+ [tool.pytest.ini_options]
20
+ pythonpath = ["src", "."]
21
+ testpaths = ["tests"]
backend/requirements.txt DELETED
@@ -1,4 +0,0 @@
1
- fastapi
2
- uvicorn[standard]
3
- numpy
4
- sympy
 
 
 
 
 
backend/src/__pycache__/opimization_logic.cpython-313.pyc DELETED
Binary file (16.2 kB)
 
backend/src/__pycache__/optimization_logic.cpython-314.pyc DELETED
Binary file (27.9 kB)
 
backend/src/__pycache__/optimization_manager.cpython-313.pyc DELETED
Binary file (11.6 kB)
 
backend/src/algorithms.json ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "algorithms": [
3
+ {
4
+ "id": "gradient_descent",
5
+ "label": "Gradient descent",
6
+ "params": [
7
+ { "name": "learning_rate", "label": "Learning rate η", "symbol": "η", "kind": "number", "min": 0, "minExclusive": true, "default": 0.1, "description": "How far each step moves along the negative gradient." },
8
+ { "name": "momentum", "label": "Momentum μ", "symbol": "μ", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.0, "description": "How much of the previous step carries over into the next one." }
9
+ ]
10
+ },
11
+ {
12
+ "id": "nesterov",
13
+ "label": "Nesterov momentum",
14
+ "params": [
15
+ { "name": "learning_rate", "label": "Learning rate η", "symbol": "η", "kind": "number", "min": 0, "minExclusive": true, "default": 0.1, "description": "How far each step moves along the negative gradient." },
16
+ { "name": "momentum", "label": "Momentum μ", "symbol": "μ", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.1, "description": "How much of the previous step carries over; the gradient is taken at the look-ahead point." }
17
+ ]
18
+ },
19
+ {
20
+ "id": "newton",
21
+ "label": "Newton's method",
22
+ "params": []
23
+ },
24
+ {
25
+ "id": "adam",
26
+ "label": "Adam",
27
+ "params": [
28
+ { "name": "learning_rate", "label": "Learning rate η", "symbol": "η", "kind": "number", "min": 0, "minExclusive": true, "default": 0.1, "description": "The largest step size, roughly." },
29
+ { "name": "beta1", "label": "Decay β₁", "symbol": "β₁", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.9, "description": "Decay rate of the moving average of gradients (first moment)." },
30
+ { "name": "beta2", "label": "Decay β₂", "symbol": "β₂", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.999, "description": "Decay rate of the moving average of squared gradients (second moment)." },
31
+ { "name": "epsilon", "label": "Epsilon ε", "symbol": "ε", "kind": "number", "min": 0, "minExclusive": true, "default": 1e-8, "description": "Added to √v in the denominator, η / (√v + ε), to avoid dividing by zero." }
32
+ ]
33
+ },
34
+ {
35
+ "id": "adagrad",
36
+ "label": "Adagrad",
37
+ "params": [
38
+ { "name": "learning_rate", "label": "Learning rate η", "symbol": "η", "kind": "number", "min": 0, "minExclusive": true, "default": 0.1, "description": "Divided by the root of the summed squared gradients." },
39
+ { "name": "epsilon", "label": "Epsilon ε", "symbol": "ε", "kind": "number", "min": 0, "minExclusive": true, "default": 1e-8, "description": "Added to √v in the denominator, η / (√v + ε), to avoid dividing by zero." }
40
+ ]
41
+ },
42
+ {
43
+ "id": "rmsprop",
44
+ "label": "RMSProp",
45
+ "params": [
46
+ { "name": "learning_rate", "label": "Learning rate η", "symbol": "η", "kind": "number", "min": 0, "minExclusive": true, "default": 0.1, "description": "Divided by the root of the moving average of squared gradients." },
47
+ { "name": "beta", "label": "Decay β", "symbol": "β", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.9, "description": "Decay rate of the moving average of squared gradients." },
48
+ { "name": "epsilon", "label": "Epsilon ε", "symbol": "ε", "kind": "number", "min": 0, "minExclusive": true, "default": 1e-8, "description": "Added to √v in the denominator, η / (√v + ε), to avoid dividing by zero." }
49
+ ]
50
+ },
51
+ {
52
+ "id": "adadelta",
53
+ "label": "Adadelta",
54
+ "params": [
55
+ { "name": "beta", "label": "Decay β", "symbol": "β", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.9, "description": "Decay rate of the moving averages of squared gradients and squared updates." },
56
+ { "name": "epsilon", "label": "Epsilon ε", "symbol": "ε", "kind": "number", "min": 0, "minExclusive": true, "default": 0.001, "description": "Sets the first step size, and avoids dividing by zero." }
57
+ ]
58
+ }
59
+ ]
60
+ }
backend/src/logic.py ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Objective functions and optimisers, in one or two variables.
2
+
3
+ Positions, gradients and Hessians are NumPy arrays of length 1 or 2, so each
4
+ optimiser is written once for both.
5
+ """
6
+
7
+ import re
8
+
9
+ import numpy as np
10
+ from sympy import Abs, DiracDelta, Expr, Float, Integer, Rational, Symbol, acos, asin, atan, cos, exp, lambdify, log, pi, sin, sqrt, symbols, tan
11
+ from sympy.parsing.sympy_parser import (
12
+ convert_xor,
13
+ implicit_multiplication_application,
14
+ parse_expr,
15
+ standard_transformations,
16
+ )
17
+
18
+ # Real, so that e.g. d/dx |x| is sign(x)
19
+ VARIABLES = symbols("x y", real=True)
20
+
21
+ ALLOWED_NAMES = {
22
+ "sin": sin, "cos": cos, "tan": tan, "asin": asin, "acos": acos, "atan": atan,
23
+ "log": log, "ln": log, "sqrt": sqrt, "abs": Abs, "exp": exp,
24
+ "e": exp(1), "pi": pi, "π": pi,
25
+ }
26
+ # The parser's own helpers for numbers and names, and nothing else: no other
27
+ # sympy functions and no Python builtins
28
+ PARSER_NAMES = {"Integer": Integer, "Float": Float, "Rational": Rational, "Symbol": Symbol, "__builtins__": {}}
29
+ FUNCTION_NAMES = "sin, cos, tan, asin, acos, atan, exp, log, sqrt, abs, e and pi"
30
+
31
+
32
+ def _unknown_names(expression: str, variables: list[str]) -> list[str]:
33
+ """Words that aren't a variable, a run of variables (xy is x·y) or an allowed name."""
34
+ words = re.findall(r"[A-Za-z_]\w*", expression)
35
+ return sorted({w for w in words if w not in ALLOWED_NAMES and not set(w) <= set(variables)})
36
+
37
+
38
+ def parse_function(expression: str, n_variables: int) -> Expr:
39
+ """Parse e.g. "x^2 + 3y^2"; raises ValueError with a message for students."""
40
+ if not expression.strip():
41
+ raise ValueError("Enter a function.")
42
+ variables = VARIABLES[:n_variables]
43
+ allowed = " and ".join(str(v) for v in variables)
44
+ unknown = _unknown_names(expression, [str(v) for v in variables])
45
+ if unknown:
46
+ raise ValueError(f"Unknown name {', '.join(unknown)}: functions can use {allowed}, and {FUNCTION_NAMES}.")
47
+ names = {str(v): v for v in VARIABLES} | ALLOWED_NAMES
48
+ try:
49
+ expr = parse_expr(
50
+ expression,
51
+ local_dict=names,
52
+ global_dict=PARSER_NAMES,
53
+ transformations=standard_transformations + (implicit_multiplication_application, convert_xor),
54
+ )
55
+ except Exception:
56
+ raise ValueError("This isn't a function sympy can read. Check the brackets and operators.")
57
+ if not isinstance(expr, Expr):
58
+ raise ValueError("This isn't a function sympy can read. Check the brackets and operators.")
59
+ unknown = expr.free_symbols - set(variables)
60
+ if unknown:
61
+ raise ValueError(f"Unknown name {', '.join(sorted(map(str, unknown)))}: functions can use {allowed}, and {FUNCTION_NAMES}.")
62
+ return expr
63
+
64
+
65
+ def derivative(expr: Expr, *variables) -> Expr:
66
+ """∂expr/∂variables, with kinks treated as PyTorch's autograd does: d|x|/dx is
67
+ sign(x) (0 at x = 0) and sign has no curvature, so the Dirac delta sympy
68
+ gives for d²|x|/dx² becomes 0. NumPy has no Dirac delta to evaluate anyway."""
69
+ return expr.diff(*variables).replace(DiracDelta, lambda *args: 0)
70
+
71
+
72
+ class Objective:
73
+ """f with its gradient and Hessian, evaluated at a point or on a grid."""
74
+
75
+ def __init__(self, expr: Expr, n_variables: int):
76
+ variables = VARIABLES[:n_variables]
77
+ self.n = n_variables
78
+ self._f = lambdify(variables, expr, modules="numpy")
79
+ self._gradient = [lambdify(variables, derivative(expr, v), modules="numpy") for v in variables]
80
+ self._hessian = [[lambdify(variables, derivative(expr, a, b), modules="numpy") for b in variables] for a in variables]
81
+
82
+ def value(self, p: np.ndarray) -> float:
83
+ return float(self._f(*p))
84
+
85
+ def gradient(self, p: np.ndarray) -> np.ndarray:
86
+ return np.array([float(g(*p)) for g in self._gradient])
87
+
88
+ def hessian(self, p: np.ndarray) -> np.ndarray:
89
+ return np.array([[float(h(*p)) for h in row] for row in self._hessian])
90
+
91
+ def values_on(self, *grid: np.ndarray) -> np.ndarray:
92
+ # Constant expressions give a scalar; spread it over the grid
93
+ return np.broadcast_to(np.asarray(self._f(*grid), dtype=float), grid[0].shape)
94
+
95
+ def gradient_on(self, *grid: np.ndarray) -> list[np.ndarray]:
96
+ return [np.broadcast_to(np.asarray(g(*grid), dtype=float), grid[0].shape) for g in self._gradient]
97
+
98
+
99
+ class SingularHessian(Exception):
100
+ pass
101
+
102
+
103
+ # Each optimiser keeps its own state between steps; step(p) returns the next position.
104
+
105
+ class GradientDescent:
106
+ """Heavy-ball momentum: v ← μv − η∇f(x), x ← x + v."""
107
+
108
+ def __init__(self, objective: Objective, learning_rate: float, momentum: float):
109
+ self.f, self.lr, self.momentum = objective, learning_rate, momentum
110
+ self.v = 0.0
111
+
112
+ def step(self, p: np.ndarray) -> np.ndarray:
113
+ self.v = self.momentum * self.v - self.lr * self.f.gradient(p)
114
+ return p + self.v
115
+
116
+
117
+ class Nesterov:
118
+ """Gradient taken at the look-ahead point x + μv."""
119
+
120
+ def __init__(self, objective: Objective, learning_rate: float, momentum: float):
121
+ self.f, self.lr, self.momentum = objective, learning_rate, momentum
122
+ self.v = 0.0
123
+
124
+ def step(self, p: np.ndarray) -> np.ndarray:
125
+ self.v = self.momentum * self.v - self.lr * self.f.gradient(p + self.momentum * self.v)
126
+ return p + self.v
127
+
128
+
129
+ class Newton:
130
+ """x ← x − H⁻¹∇f(x)."""
131
+
132
+ def __init__(self, objective: Objective):
133
+ self.f = objective
134
+
135
+ def step(self, p: np.ndarray) -> np.ndarray:
136
+ h, g = self.f.hessian(p), self.f.gradient(p)
137
+ try:
138
+ delta = np.linalg.solve(h, g)
139
+ except np.linalg.LinAlgError:
140
+ raise SingularHessian()
141
+ # Pyodide's NumPy can't see floating-point errors, so solve returns inf or nan instead of raising
142
+ if np.all(np.isfinite(h)) and np.all(np.isfinite(g)) and not np.all(np.isfinite(delta)):
143
+ raise SingularHessian()
144
+ return p - delta
145
+
146
+
147
+ class Adagrad:
148
+ def __init__(self, objective: Objective, learning_rate: float, epsilon: float):
149
+ self.f, self.lr, self.eps = objective, learning_rate, epsilon
150
+ self.v = 0.0 # sum of squared gradients
151
+
152
+ def step(self, p: np.ndarray) -> np.ndarray:
153
+ g = self.f.gradient(p)
154
+ self.v = self.v + g**2
155
+ # ε outside the square root, as PyTorch does
156
+ return p - self.lr / (np.sqrt(self.v) + self.eps) * g
157
+
158
+
159
+ class RMSProp:
160
+ def __init__(self, objective: Objective, learning_rate: float, beta: float, epsilon: float):
161
+ self.f, self.lr, self.beta, self.eps = objective, learning_rate, beta, epsilon
162
+ self.v = 0.0 # moving average of squared gradients
163
+
164
+ def step(self, p: np.ndarray) -> np.ndarray:
165
+ g = self.f.gradient(p)
166
+ self.v = self.beta * self.v + (1 - self.beta) * g**2
167
+ # ε outside the square root, as PyTorch does
168
+ return p - self.lr / (np.sqrt(self.v) + self.eps) * g
169
+
170
+
171
+ class Adadelta:
172
+ def __init__(self, objective: Objective, beta: float, epsilon: float):
173
+ self.f, self.beta, self.eps = objective, beta, epsilon
174
+ self.v = 0.0 # moving average of squared gradients
175
+ self.s = 0.0 # moving average of squared updates
176
+
177
+ def step(self, p: np.ndarray) -> np.ndarray:
178
+ g = self.f.gradient(p)
179
+ self.v = self.beta * self.v + (1 - self.beta) * g**2
180
+ delta = -np.sqrt(self.s + self.eps) / np.sqrt(self.v + self.eps) * g
181
+ self.s = self.beta * self.s + (1 - self.beta) * delta**2
182
+ return p + delta
183
+
184
+
185
+ class Adam:
186
+ def __init__(self, objective: Objective, learning_rate: float, beta1: float, beta2: float, epsilon: float):
187
+ self.f, self.lr, self.beta1, self.beta2, self.eps = objective, learning_rate, beta1, beta2, epsilon
188
+ self.m = 0.0 # first moment
189
+ self.v = 0.0 # second moment
190
+ self.t = 0
191
+
192
+ def step(self, p: np.ndarray) -> np.ndarray:
193
+ g = self.f.gradient(p)
194
+ self.t += 1
195
+ self.m = self.beta1 * self.m + (1 - self.beta1) * g
196
+ self.v = self.beta2 * self.v + (1 - self.beta2) * g**2
197
+ m_hat = self.m / (1 - self.beta1**self.t)
198
+ v_hat = self.v / (1 - self.beta2**self.t)
199
+ return p - self.lr / (np.sqrt(v_hat) + self.eps) * m_hat
200
+
201
+
202
+ # Ids match backend/src/algorithms.json
203
+ OPTIMISERS = {
204
+ "gradient_descent": GradientDescent,
205
+ "nesterov": Nesterov,
206
+ "newton": Newton,
207
+ "adam": Adam,
208
+ "adagrad": Adagrad,
209
+ "rmsprop": RMSProp,
210
+ "adadelta": Adadelta,
211
+ }
212
+
213
+ # A run that gets further than this from the origin has diverged
214
+ DIVERGENCE_LIMIT = 1e6
215
+
216
+ DIVERGED = "The next point has no finite value or is beyond 1,000,000: the run diverged or left the function's domain."
217
+ SINGULAR = "The Hessian is singular here, so Newton's method can't take a step."
218
+
219
+
220
+ class Run:
221
+ """One optimiser's trajectory, computed as far as it has been asked for."""
222
+
223
+ def __init__(self, objective: Objective, optimiser, start: np.ndarray):
224
+ self.f = objective
225
+ self.optimiser = optimiser
226
+ self.points = [self._describe(start)]
227
+ self.position = start
228
+ # Why the run ended, once it has
229
+ self.stopped: str | None = None
230
+
231
+ def point(self, k: int) -> dict | None:
232
+ """The point after k iterations, or None if the run stopped before then."""
233
+ with np.errstate(all="ignore"):
234
+ while len(self.points) <= k and self.stopped is None:
235
+ self._advance()
236
+ return self.points[k] if k < len(self.points) else None
237
+
238
+ def _advance(self) -> None:
239
+ try:
240
+ p = self.optimiser.step(self.position)
241
+ except SingularHessian:
242
+ self.stopped = SINGULAR
243
+ return
244
+ if not np.all(np.abs(p) <= DIVERGENCE_LIMIT) or not np.isfinite(self.f.value(p)):
245
+ self.stopped = DIVERGED
246
+ return
247
+ self.position = p
248
+ self.points.append(self._describe(p))
249
+
250
+ def _describe(self, p: np.ndarray) -> dict:
251
+ return {
252
+ "position": p.tolist(),
253
+ "value": self.f.value(p),
254
+ "gradient": self.f.gradient(p).tolist(),
255
+ "hessian": self.f.hessian(p).tolist(),
256
+ }
backend/src/main.py DELETED
@@ -1,102 +0,0 @@
1
- from fastapi import FastAPI, WebSocket, WebSocketDisconnect
2
- from fastapi.staticfiles import StaticFiles
3
- from optimization_manager import OptimizationManager
4
-
5
- app = FastAPI()
6
- PORT = 7860
7
-
8
-
9
- @app.websocket("/ws")
10
- async def websocket_endpoint(websocket: WebSocket):
11
- print("starting")
12
- await websocket.accept()
13
- manager = OptimizationManager()
14
-
15
- try:
16
- while True:
17
- # Receive message from client
18
- message = await websocket.receive_json()
19
- message_type = message.get("type")
20
-
21
- # Handle different message types
22
- if message_type == "init":
23
- await handle_init(websocket, manager, message.get("settings", {}))
24
-
25
- elif message_type == "reset":
26
- await handle_reset(websocket, manager)
27
-
28
- elif message_type == "next-step":
29
- await handle_next_step(websocket, manager)
30
-
31
- elif message_type == "prev-step":
32
- await handle_prev_step(websocket, manager)
33
-
34
- elif message_type == "play":
35
- await handle_play(websocket, manager)
36
-
37
- elif message_type == "pause":
38
- await handle_pause(websocket, manager)
39
-
40
- else:
41
- await send_error(websocket, f"Unknown message type: {message_type}")
42
-
43
- except WebSocketDisconnect:
44
- print("Client disconnected")
45
- except Exception as e:
46
- print(f"Error: {e}")
47
- await send_error(websocket, str(e))
48
-
49
-
50
- async def handle_init(websocket: WebSocket, manager: OptimizationManager, settings: dict):
51
- """Handle settings update."""
52
- data = manager.handle_update_settings(settings)
53
- if data:
54
- await websocket.send_json(data)
55
-
56
-
57
- async def handle_reset(websocket: WebSocket, manager: OptimizationManager):
58
- """Handle trajectory reset."""
59
- data = manager.handle_reset()
60
- if data:
61
- await websocket.send_json(data)
62
-
63
-
64
- async def handle_next_step(websocket: WebSocket, manager: OptimizationManager):
65
- """Handle next step request."""
66
- data = manager.handle_next_step()
67
- if data:
68
- await websocket.send_json(data)
69
-
70
-
71
- async def handle_prev_step(websocket: WebSocket, manager: OptimizationManager):
72
- """Handle previous step request."""
73
- data = manager.handle_prev_step()
74
- if data:
75
- await websocket.send_json(data)
76
-
77
-
78
- async def handle_play(websocket: WebSocket, manager: OptimizationManager):
79
- """Handle play request (to be implemented)."""
80
- # TODO: Implement play functionality with automatic step advancement
81
- pass
82
-
83
-
84
- async def handle_pause(websocket: WebSocket, manager: OptimizationManager):
85
- """Handle pause request (to be implemented)."""
86
- # TODO: Implement pause functionality
87
- pass
88
-
89
-
90
- async def send_error(websocket: WebSocket, error_message: str):
91
- """Send error message to client."""
92
- await websocket.send_json({
93
- "type": "error",
94
- "message": error_message
95
- })
96
-
97
-
98
- app.mount("/", StaticFiles(directory="../frontend/dist", html=True), name="frontend")
99
-
100
- if __name__ == "__main__":
101
- import uvicorn
102
- uvicorn.run(app, host="0.0.0.0", port=PORT)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
backend/src/manager.py ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ from pathlib import Path
3
+
4
+ import numpy as np
5
+
6
+ from logic import OPTIMISERS, Objective, Run, parse_function
7
+
8
+ ALGORITHMS = {
9
+ spec["id"]: spec
10
+ for spec in json.loads((Path(__file__).parent / "algorithms.json").read_text())["algorithms"]
11
+ }
12
+
13
+ # Iterations a run can take before stepping stops
14
+ MAX_ITERATIONS = 1000
15
+ LIMIT_REACHED = f"Reached the {MAX_ITERATIONS}-iteration limit."
16
+ # Sample points for the plotted curve (one variable) or surface (two, per side)
17
+ CURVE_POINTS = 401
18
+ GRID_POINTS = 101
19
+ # Gradient arrows per side
20
+ ARROW_POINTS = 15
21
+
22
+
23
+ class UserError(Exception):
24
+ """A mistake the student can fix; its message is shown in the UI."""
25
+
26
+
27
+ def _json_values(values: np.ndarray) -> list:
28
+ """Values as JSON numbers, with null where f has no finite value."""
29
+ return [float(v) if np.isfinite(v) else None for v in values]
30
+
31
+
32
+ class Manager:
33
+ def __init__(self):
34
+ self._objective: Objective | None = None
35
+ self._runs: list[Run] = []
36
+
37
+ def handle_set_function(self, args: dict) -> None:
38
+ """{variables: 1 | 2, expression}; clears the runs."""
39
+ self._objective = None
40
+ self._runs = []
41
+ n = int(args["variables"])
42
+ try:
43
+ expr = parse_function(str(args["expression"]), n)
44
+ except ValueError as e:
45
+ raise UserError(str(e))
46
+ try:
47
+ objective = Objective(expr, n)
48
+ # Evaluate everything once, so a failure shows here rather than mid-run.
49
+ # Values may be inf or nan (outside the domain); only errors count.
50
+ p = np.full(n, 0.5)
51
+ with np.errstate(all="ignore"):
52
+ objective.value(p), objective.gradient(p), objective.hessian(p)
53
+ except Exception:
54
+ raise UserError("This function can't be evaluated or differentiated. Try writing it another way.")
55
+ self._objective = objective
56
+
57
+ def handle_function_values(self, args: dict) -> dict | None:
58
+ """f sampled over the plot's {x_range, y_range}; None with no function."""
59
+ f = self._objective
60
+ if f is None:
61
+ return None
62
+ with np.errstate(all="ignore"):
63
+ if f.n == 1:
64
+ x = np.linspace(*args["x_range"], CURVE_POINTS)
65
+ return {"x": x.tolist(), "f": _json_values(f.values_on(x))}
66
+
67
+ x = np.linspace(*args["x_range"], GRID_POINTS)
68
+ y = np.linspace(*args["y_range"], GRID_POINTS)
69
+ z = f.values_on(*np.meshgrid(x, y))
70
+ ax, ay = np.meshgrid(np.linspace(*args["x_range"], ARROW_POINTS), np.linspace(*args["y_range"], ARROW_POINTS))
71
+ u, v = f.gradient_on(ax, ay)
72
+ return {
73
+ "x": x.tolist(),
74
+ "y": y.tolist(),
75
+ # Rows follow y, columns follow x
76
+ "f": [_json_values(row) for row in z],
77
+ "arrows": {
78
+ "x": ax.ravel().tolist(),
79
+ "y": ay.ravel().tolist(),
80
+ "u": _json_values(u.ravel()),
81
+ "v": _json_values(v.ravel()),
82
+ },
83
+ }
84
+
85
+ def handle_set_runs(self, args: dict) -> None:
86
+ """{runs: [{algorithm, start, params}]}: the optimisers to step together."""
87
+ self._runs = []
88
+ f = self._objective
89
+ if f is None:
90
+ raise ValueError("Function not set")
91
+ runs = []
92
+ for run in args["runs"]:
93
+ spec = ALGORITHMS[run["algorithm"]]
94
+ given = dict(run.get("params", {}))
95
+ params = {p["name"]: float(given.get(p["name"], p["default"])) for p in spec["params"]}
96
+ start = np.array(run["start"], dtype=float)
97
+ if start.shape != (f.n,):
98
+ raise ValueError(f"Start point needs {f.n} coordinates, got {start.tolist()}")
99
+ with np.errstate(all="ignore"):
100
+ if not np.isfinite(f.value(start)):
101
+ point = ", ".join(f"{c:g}" for c in start)
102
+ raise UserError(f"The function has no finite value at the initial point ({point}).")
103
+ runs.append(Run(f, OPTIMISERS[spec["id"]](f, **params), start))
104
+ self._runs = runs
105
+
106
+ def handle_state(self, args: dict) -> dict | None:
107
+ """Every run after {iteration} iterations; None once all have stopped.
108
+
109
+ "stopped" says why a run ended, at its last point and after it (where
110
+ point is None). It is None while the run carries on.
111
+ """
112
+ k = int(args["iteration"])
113
+ if not self._runs or k > MAX_ITERATIONS:
114
+ return None
115
+ points = [run.point(k) for run in self._runs]
116
+ if all(p is None for p in points):
117
+ return None
118
+ # Look one iteration ahead to know whether this is a run's last point
119
+ ended = [p is None or run.point(k + 1) is None for run, p in zip(self._runs, points)]
120
+ return {
121
+ "runs": [
122
+ {"point": p, "stopped": run.stopped if end else (LIMIT_REACHED if k == MAX_ITERATIONS else None)}
123
+ for run, p, end in zip(self._runs, points, ended)
124
+ ]
125
+ }
backend/src/optimization_logic.py DELETED
@@ -1,663 +0,0 @@
1
- import numpy as np
2
- from sympy import lambdify, Expr
3
-
4
-
5
- def _gradient_values(fx, fy, x: float, y: float) -> list:
6
- return [float(fx(x, y)), float(fy(x, y))]
7
-
8
-
9
- def _hessian_values(fxx, fxy, fyy, x: float, y: float) -> list:
10
- return [
11
- [float(fxx(x, y)), float(fxy(x, y))],
12
- [float(fxy(x, y)), float(fyy(x, y))],
13
- ]
14
-
15
-
16
- def gd_univariate(
17
- function: Expr,
18
- x0: float,
19
- learning_rate: float,
20
- momentum: float,
21
- steps: int,
22
- ) -> dict:
23
- """
24
- Perform gradient descent on a univariate function.
25
-
26
- Assumes function is valid and in terms of x
27
- """
28
- f = lambdify('x', function, modules=['numpy'])
29
- f_prime = lambdify('x', function.diff('x'), modules=['numpy'])
30
- f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy'])
31
-
32
- x_values = [x0]
33
- y_values = [f(x0)]
34
- derivative_values = [f_prime(x0)]
35
- second_derivative_values = [f_prime_prime(x0)]
36
-
37
- x = x0
38
- for i in range(steps - 1):
39
- if i == 0:
40
- m = 0
41
- else:
42
- m = momentum * (x_values[-1] - x_values[-2])
43
-
44
- x = x - learning_rate * f_prime(x) + m
45
- x_values.append(x)
46
- y_values.append(f(x))
47
- derivative_values.append(f_prime(x))
48
- second_derivative_values.append(f_prime_prime(x))
49
-
50
- return {
51
- "x": x_values,
52
- "y": y_values,
53
- "derivative": derivative_values,
54
- "secondDerivative": second_derivative_values,
55
- }
56
-
57
-
58
- def gd_bivariate(
59
- function: Expr,
60
- x0: float,
61
- y0: float,
62
- learning_rate: float,
63
- momentum: float,
64
- steps: int,
65
- ) -> dict:
66
- f = lambdify(('x', 'y'), function, modules=['numpy'])
67
- fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy'])
68
- fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy'])
69
- fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy'])
70
- fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy'])
71
- fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy'])
72
-
73
- x_values = [x0]
74
- y_values = [y0]
75
- z_values = [f(x0, y0)]
76
- gradient_values = [_gradient_values(fx, fy, x0, y0)]
77
- hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)]
78
-
79
- x = x0
80
- y = y0
81
- for i in range(steps - 1):
82
- if i == 0:
83
- mx = 0
84
- my = 0
85
- else:
86
- mx = momentum * (x_values[-1] - x_values[-2])
87
- my = momentum * (y_values[-1] - y_values[-2])
88
-
89
- x_new = x - learning_rate * fx(x, y) + mx
90
- y_new = y - learning_rate * fy(x, y) + my
91
- x = x_new
92
- y = y_new
93
- x_values.append(x)
94
- y_values.append(y)
95
- z_values.append(f(x, y))
96
- gradient_values.append(_gradient_values(fx, fy, x, y))
97
- hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y))
98
-
99
- return {
100
- "x": x_values,
101
- "y": y_values,
102
- "z": z_values,
103
- "gradient": gradient_values,
104
- "hessian": hessian_values,
105
- }
106
-
107
-
108
- def nesterov_univariate(
109
- function: Expr,
110
- x0: float,
111
- learning_rate: float,
112
- momentum: float,
113
- steps: int,
114
- ) -> dict:
115
- f = lambdify('x', function, modules=['numpy'])
116
- f_prime = lambdify('x', function.diff('x'), modules=['numpy'])
117
- f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy'])
118
-
119
- x_values = [x0]
120
- y_values = [f(x0)]
121
- derivative_values = [f_prime(x0)]
122
- second_derivative_values = [f_prime_prime(x0)]
123
-
124
- x = x0
125
- for i in range(steps - 1):
126
- if i == 0:
127
- m = 0
128
- else:
129
- m = momentum * (x_values[-1] - x_values[-2])
130
-
131
- x_lookahead = x + m
132
- x = x_lookahead - learning_rate * f_prime(x_lookahead)
133
-
134
- x_values.append(x)
135
- y_values.append(f(x))
136
- derivative_values.append(f_prime(x))
137
- second_derivative_values.append(f_prime_prime(x))
138
-
139
- return {
140
- "x": x_values,
141
- "y": y_values,
142
- "derivative": derivative_values,
143
- "secondDerivative": second_derivative_values,
144
- }
145
-
146
-
147
- def nesterov_bivariate(
148
- function: Expr,
149
- x0: float,
150
- y0: float,
151
- learning_rate: float,
152
- momentum: float,
153
- steps: int,
154
- ) -> dict:
155
- f = lambdify(('x', 'y'), function, modules=['numpy'])
156
- fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy'])
157
- fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy'])
158
- fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy'])
159
- fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy'])
160
- fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy'])
161
-
162
- x_values = [x0]
163
- y_values = [y0]
164
- z_values = [f(x0, y0)]
165
- gradient_values = [_gradient_values(fx, fy, x0, y0)]
166
- hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)]
167
-
168
- x = x0
169
- y = y0
170
- for i in range(steps - 1):
171
- if i == 0:
172
- mx = 0
173
- my = 0
174
- else:
175
- mx = momentum * (x_values[-1] - x_values[-2])
176
- my = momentum * (y_values[-1] - y_values[-2])
177
-
178
- x_lookahead = x + mx
179
- y_lookahead = y + my
180
-
181
- x = x_lookahead - learning_rate * fx(x_lookahead, y_lookahead)
182
- y = y_lookahead - learning_rate * fy(x_lookahead, y_lookahead)
183
-
184
- x_values.append(x)
185
- y_values.append(y)
186
- z_values.append(f(x, y))
187
- gradient_values.append(_gradient_values(fx, fy, x, y))
188
- hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y))
189
-
190
- return {
191
- "x": x_values,
192
- "y": y_values,
193
- "z": z_values,
194
- "gradient": gradient_values,
195
- "hessian": hessian_values,
196
- }
197
-
198
-
199
- def newton_univariate(
200
- function: Expr,
201
- x0: float,
202
- steps: int,
203
- ) -> dict:
204
- f = lambdify('x', function, modules=['numpy'])
205
- f_prime = lambdify('x', function.diff('x'), modules=['numpy'])
206
- f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy'])
207
-
208
- x_values = [x0]
209
- y_values = [f(x0)]
210
- derivative_values = [f_prime(x0)]
211
- second_derivative_values = [f_prime_prime(x0)]
212
-
213
- x = x0
214
- for i in range(steps - 1):
215
- x = x - f_prime(x) / f_prime_prime(x)
216
- x_values.append(x)
217
- y_values.append(f(x))
218
- derivative_values.append(f_prime(x))
219
- second_derivative_values.append(f_prime_prime(x))
220
-
221
- return {
222
- "x": x_values,
223
- "y": y_values,
224
- "derivative": derivative_values,
225
- "secondDerivative": second_derivative_values,
226
- }
227
-
228
-
229
- def newton_bivariate(
230
- function: Expr,
231
- x0: float,
232
- y0: float,
233
- steps: int,
234
- ) -> dict:
235
- f = lambdify(('x', 'y'), function, modules=['numpy'])
236
- fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy'])
237
- fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy'])
238
- fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy'])
239
- fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy'])
240
- fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy'])
241
-
242
- x_values = [x0]
243
- y_values = [y0]
244
- z_values = [f(x0, y0)]
245
- gradient_values = [_gradient_values(fx, fy, x0, y0)]
246
- hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)]
247
-
248
- x = x0
249
- y = y0
250
- for i in range(steps - 1):
251
- hessian = np.array(
252
- [
253
- [fxx(x, y), fxy(x, y)],
254
- [fxy(x, y), fyy(x, y)],
255
- ],
256
- )
257
- grad = np.array([fx(x, y), fy(x, y)])
258
-
259
- try:
260
- # delta = hessian^-1 * grad
261
- delta = np.linalg.solve(hessian, grad)
262
- except np.linalg.LinAlgError:
263
- # singular hessian - cannot proceed
264
- break
265
-
266
- x = x - delta[0]
267
- y = y - delta[1]
268
-
269
- x_values.append(x)
270
- y_values.append(y)
271
- z_values.append(f(x, y))
272
- gradient_values.append(_gradient_values(fx, fy, x, y))
273
- hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y))
274
-
275
- return {
276
- "x": x_values,
277
- "y": y_values,
278
- "z": z_values,
279
- "gradient": gradient_values,
280
- "hessian": hessian_values,
281
- }
282
-
283
-
284
- def adagrad_univariate(
285
- function: Expr,
286
- x0: float,
287
- learning_rate: float,
288
- epsilon: float,
289
- steps: int,
290
- ) -> dict:
291
- f = lambdify('x', function, modules=['numpy'])
292
- f_prime = lambdify('x', function.diff('x'), modules=['numpy'])
293
- f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy'])
294
-
295
- x_values = [x0]
296
- y_values = [f(x0)]
297
- derivative_values = [f_prime(x0)]
298
- second_derivative_values = [f_prime_prime(x0)]
299
-
300
- x = x0
301
- v = 0 # accumulated squared gradients
302
- for i in range(steps - 1):
303
- g = f_prime(x)
304
- v += g ** 2
305
- x = x - (learning_rate / (np.sqrt(v + epsilon))) * g
306
-
307
- x_values.append(x)
308
- y_values.append(f(x))
309
- derivative_values.append(f_prime(x))
310
- second_derivative_values.append(f_prime_prime(x))
311
-
312
- return {
313
- "x": x_values,
314
- "y": y_values,
315
- "derivative": derivative_values,
316
- "secondDerivative": second_derivative_values,
317
- }
318
-
319
-
320
- def adagrad_bivariate(
321
- function: Expr,
322
- x0: float,
323
- y0: float,
324
- learning_rate: float,
325
- epsilon: float,
326
- steps: int,
327
- ) -> dict:
328
- f = lambdify(('x', 'y'), function, modules=['numpy'])
329
- fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy'])
330
- fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy'])
331
- fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy'])
332
- fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy'])
333
- fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy'])
334
-
335
- x_values = [x0]
336
- y_values = [y0]
337
- z_values = [f(x0, y0)]
338
- gradient_values = [_gradient_values(fx, fy, x0, y0)]
339
- hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)]
340
-
341
- x = x0
342
- y = y0
343
- # accumulated squared gradients
344
- vx = 0
345
- vy = 0
346
- for i in range(steps - 1):
347
- gx = fx(x, y)
348
- gy = fy(x, y)
349
- vx += gx ** 2
350
- vy += gy ** 2
351
-
352
- x = x - (learning_rate / (np.sqrt(vx + epsilon))) * gx
353
- y = y - (learning_rate / (np.sqrt(vy + epsilon))) * gy
354
-
355
- x_values.append(x)
356
- y_values.append(y)
357
- z_values.append(f(x, y))
358
- gradient_values.append(_gradient_values(fx, fy, x, y))
359
- hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y))
360
-
361
- return {
362
- "x": x_values,
363
- "y": y_values,
364
- "z": z_values,
365
- "gradient": gradient_values,
366
- "hessian": hessian_values,
367
- }
368
-
369
-
370
- def rmsprop_univariate(
371
- function: Expr,
372
- x0: float,
373
- learning_rate: float,
374
- beta: float,
375
- epsilon: float,
376
- steps: int,
377
- ) -> dict:
378
- f = lambdify('x', function, modules=['numpy'])
379
- f_prime = lambdify('x', function.diff('x'), modules=['numpy'])
380
- f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy'])
381
-
382
- x_values = [x0]
383
- y_values = [f(x0)]
384
- derivative_values = [f_prime(x0)]
385
- second_derivative_values = [f_prime_prime(x0)]
386
-
387
- x = x0
388
- v = 0 # exponentially weighted average of squared gradients
389
- for i in range(steps - 1):
390
- g = f_prime(x)
391
- v = beta * v + (1 - beta) * g ** 2
392
- x = x - (learning_rate / (np.sqrt(v + epsilon))) * g
393
-
394
- x_values.append(x)
395
- y_values.append(f(x))
396
- derivative_values.append(f_prime(x))
397
- second_derivative_values.append(f_prime_prime(x))
398
-
399
- return {
400
- "x": x_values,
401
- "y": y_values,
402
- "derivative": derivative_values,
403
- "secondDerivative": second_derivative_values,
404
- }
405
-
406
-
407
- def rmsprop_bivariate(
408
- function: Expr,
409
- x0: float,
410
- y0: float,
411
- learning_rate: float,
412
- beta: float,
413
- epsilon: float,
414
- steps: int,
415
- ) -> dict:
416
- f = lambdify(('x', 'y'), function, modules=['numpy'])
417
- fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy'])
418
- fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy'])
419
- fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy'])
420
- fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy'])
421
- fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy'])
422
-
423
- x_values = [x0]
424
- y_values = [y0]
425
- z_values = [f(x0, y0)]
426
- gradient_values = [_gradient_values(fx, fy, x0, y0)]
427
- hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)]
428
-
429
- x = x0
430
- y = y0
431
- # exponentially weighted average of squared gradients
432
- vx = 0
433
- vy = 0
434
- for i in range(steps - 1):
435
- gx = fx(x, y)
436
- gy = fy(x, y)
437
- vx = beta * vx + (1 - beta) * gx ** 2
438
- vy = beta * vy + (1 - beta) * gy ** 2
439
-
440
- x = x - (learning_rate / (np.sqrt(vx + epsilon))) * gx
441
- y = y - (learning_rate / (np.sqrt(vy + epsilon))) * gy
442
-
443
- x_values.append(x)
444
- y_values.append(y)
445
- z_values.append(f(x, y))
446
- gradient_values.append(_gradient_values(fx, fy, x, y))
447
- hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y))
448
-
449
- return {
450
- "x": x_values,
451
- "y": y_values,
452
- "z": z_values,
453
- "gradient": gradient_values,
454
- "hessian": hessian_values,
455
- }
456
-
457
-
458
- def adadelta_univariate(
459
- function: Expr,
460
- x0: float,
461
- beta: float,
462
- epsilon: float,
463
- steps: int,
464
- ) -> dict:
465
- f = lambdify('x', function, modules=['numpy'])
466
- f_prime = lambdify('x', function.diff('x'), modules=['numpy'])
467
- f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy'])
468
-
469
- x_values = [x0]
470
- y_values = [f(x0)]
471
- derivative_values = [f_prime(x0)]
472
- second_derivative_values = [f_prime_prime(x0)]
473
-
474
- x = x0
475
- v = 0 # exponentially weighted average of squared gradients
476
- s = 0 # exponentially weighted average of squared updates
477
- for i in range(steps - 1):
478
- g = f_prime(x)
479
- v = beta * v + (1 - beta) * g ** 2
480
- delta_x = - (np.sqrt(s + epsilon) / np.sqrt(v + epsilon)) * g
481
- x = x + delta_x
482
-
483
- s = beta * s + (1 - beta) * delta_x ** 2
484
-
485
- x_values.append(x)
486
- y_values.append(f(x))
487
- derivative_values.append(f_prime(x))
488
- second_derivative_values.append(f_prime_prime(x))
489
-
490
- return {
491
- "x": x_values,
492
- "y": y_values,
493
- "derivative": derivative_values,
494
- "secondDerivative": second_derivative_values,
495
- }
496
-
497
-
498
- def adadelta_bivariate(
499
- function: Expr,
500
- x0: float,
501
- y0: float,
502
- beta: float,
503
- epsilon: float,
504
- steps: int,
505
- ) -> dict:
506
- f = lambdify(('x', 'y'), function, modules=['numpy'])
507
- fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy'])
508
- fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy'])
509
- fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy'])
510
- fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy'])
511
- fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy'])
512
-
513
- x_values = [x0]
514
- y_values = [y0]
515
- z_values = [f(x0, y0)]
516
- gradient_values = [_gradient_values(fx, fy, x0, y0)]
517
- hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)]
518
-
519
- x = x0
520
- y = y0
521
- # exponentially weighted average of squared gradients
522
- vx = 0
523
- vy = 0
524
- # exponentially weighted average of squared updates
525
- sx = 0
526
- sy = 0
527
- for i in range(steps - 1):
528
- gx = fx(x, y)
529
- gy = fy(x, y)
530
- vx = beta * vx + (1 - beta) * gx ** 2
531
- vy = beta * vy + (1 - beta) * gy ** 2
532
-
533
- delta_x = - (np.sqrt(sx + epsilon) / np.sqrt(vx + epsilon)) * gx
534
- delta_y = - (np.sqrt(sy + epsilon) / np.sqrt(vy + epsilon)) * gy
535
-
536
- x = x + delta_x
537
- y = y + delta_y
538
-
539
- sx = beta * sx + (1 - beta) * delta_x ** 2
540
- sy = beta * sy + (1 - beta) * delta_y ** 2
541
-
542
- x_values.append(x)
543
- y_values.append(y)
544
- z_values.append(f(x, y))
545
- gradient_values.append(_gradient_values(fx, fy, x, y))
546
- hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y))
547
-
548
- return {
549
- "x": x_values,
550
- "y": y_values,
551
- "z": z_values,
552
- "gradient": gradient_values,
553
- "hessian": hessian_values,
554
- }
555
-
556
-
557
- def adam_univariate(
558
- function: Expr,
559
- x0: float,
560
- learning_rate: float,
561
- beta1: float,
562
- beta2: float,
563
- epsilon: float,
564
- steps: int,
565
- ) -> dict:
566
- f = lambdify('x', function, modules=['numpy'])
567
- f_prime = lambdify('x', function.diff('x'), modules=['numpy'])
568
- f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy'])
569
-
570
- x_values = [x0]
571
- y_values = [f(x0)]
572
- derivative_values = [f_prime(x0)]
573
- second_derivative_values = [f_prime_prime(x0)]
574
-
575
- x = x0
576
- m = 0 # first moment
577
- v = 0 # second moment
578
- for i in range(steps - 1):
579
- g = f_prime(x)
580
- m = beta1 * m + (1 - beta1) * g
581
- v = beta2 * v + (1 - beta2) * g ** 2
582
-
583
- m_hat = m / (1 - beta1 ** (i + 1))
584
- v_hat = v / (1 - beta2 ** (i + 1))
585
-
586
- x = x - (learning_rate / (np.sqrt(v_hat) + epsilon)) * m_hat
587
-
588
- x_values.append(x)
589
- y_values.append(f(x))
590
- derivative_values.append(f_prime(x))
591
- second_derivative_values.append(f_prime_prime(x))
592
-
593
- return {
594
- "x": x_values,
595
- "y": y_values,
596
- "derivative": derivative_values,
597
- "secondDerivative": second_derivative_values,
598
- }
599
-
600
-
601
- def adam_bivariate(
602
- function: Expr,
603
- x0: float,
604
- y0: float,
605
- learning_rate: float,
606
- beta1: float,
607
- beta2: float,
608
- epsilon: float,
609
- steps: int,
610
- ) -> dict:
611
- f = lambdify(('x', 'y'), function, modules=['numpy'])
612
- fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy'])
613
- fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy'])
614
- fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy'])
615
- fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy'])
616
- fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy'])
617
-
618
- x_values = [x0]
619
- y_values = [y0]
620
- z_values = [f(x0, y0)]
621
- gradient_values = [_gradient_values(fx, fy, x0, y0)]
622
- hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)]
623
-
624
- x = x0
625
- y = y0
626
- # first moments
627
- mx = 0
628
- my = 0
629
- # second moments
630
- vx = 0
631
- vy = 0
632
- for i in range(steps - 1):
633
- gx = fx(x, y)
634
- gy = fy(x, y)
635
-
636
- mx = beta1 * mx + (1 - beta1) * gx
637
- my = beta1 * my + (1 - beta1) * gy
638
-
639
- vx = beta2 * vx + (1 - beta2) * gx ** 2
640
- vy = beta2 * vy + (1 - beta2) * gy ** 2
641
-
642
- mx_hat = mx / (1 - beta1 ** (i + 1))
643
- my_hat = my / (1 - beta1 ** (i + 1))
644
-
645
- vx_hat = vx / (1 - beta2 ** (i + 1))
646
- vy_hat = vy / (1 - beta2 ** (i + 1))
647
-
648
- x = x - (learning_rate / (np.sqrt(vx_hat) + epsilon)) * mx_hat
649
- y = y - (learning_rate / (np.sqrt(vy_hat) + epsilon)) * my_hat
650
-
651
- x_values.append(x)
652
- y_values.append(y)
653
- z_values.append(f(x, y))
654
- gradient_values.append(_gradient_values(fx, fy, x, y))
655
- hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y))
656
-
657
- return {
658
- "x": x_values,
659
- "y": y_values,
660
- "z": z_values,
661
- "gradient": gradient_values,
662
- "hessian": hessian_values,
663
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
backend/src/optimization_manager.py DELETED
@@ -1,356 +0,0 @@
1
- import numpy as np
2
- from sympy import (
3
- lambdify,
4
- symbols,
5
- sin,
6
- cos,
7
- tan,
8
- asin,
9
- acos,
10
- atan,
11
- exp,
12
- log,
13
- sqrt,
14
- pi,
15
- Abs,
16
- )
17
-
18
- from sympy.parsing.sympy_parser import (
19
- standard_transformations,
20
- implicit_multiplication_application,
21
- convert_xor,
22
- parse_expr,
23
- )
24
-
25
- from optimization_logic import *
26
-
27
-
28
- class OptimizationManager:
29
- def __init__(self):
30
- self.function_values = {"x": [], "y": []}
31
- self.trajectory_values = {"x": [], "y": []}
32
- self.settings = {}
33
-
34
- def handle_update_settings(self, new_settings) -> dict[str, dict] | None:
35
- if new_settings == self.settings:
36
- return None
37
-
38
- non_relayout_settings = (new_settings.keys() | self.settings.keys()) - {"xlim", "ylim"}
39
- non_relayout_settings_changed = any(
40
- new_settings.get(k) != self.settings.get(k)
41
- for k in non_relayout_settings
42
- )
43
-
44
- self.settings = new_settings
45
-
46
- function = new_settings.get("functionExpr", "").strip()
47
- mode = new_settings.get("mode", "").lower().strip()
48
- xlim = new_settings.get("xlim", [])
49
- ylim = new_settings.get("ylim", [])
50
-
51
- if not self._is_valid_function(function, mode, xlim, ylim):
52
- return {
53
- "trajectoryValues": {"x": [], "y": []},
54
- "functionValues": {"x": [], "y": []},
55
- }
56
-
57
- if non_relayout_settings_changed:
58
- self._reset_trajectory()
59
-
60
- if not self._function_changed(function, mode):
61
- return {
62
- "trajectoryValues": self.trajectory_values,
63
- }
64
-
65
- try:
66
- self._compute_function_values(function, mode, xlim, ylim)
67
- except Exception as e:
68
- self.function_values = {"x": [], "y": []}
69
- self.trajectory_values = {"x": [], "y": []}
70
-
71
- return {
72
- "functionValues": self.function_values,
73
- "trajectoryValues": self.trajectory_values,
74
- }
75
-
76
- def handle_reset(self) -> dict[str, list]:
77
- self._reset_trajectory()
78
- return {
79
- "trajectoryValues": self.trajectory_values,
80
- }
81
-
82
- def handle_next_step(self) -> dict[str, list]:
83
- current_steps = len(self.trajectory_values["x"])
84
- self._compute_trajectory_values(self.settings, current_steps + 1)
85
- return {
86
- "trajectoryValues": self.trajectory_values,
87
- }
88
-
89
- def handle_prev_step(self) -> dict[str, list]:
90
- current_steps = len(self.trajectory_values["x"])
91
- if current_steps > 1:
92
- self._compute_trajectory_values(self.settings, current_steps - 1)
93
- return {
94
- "trajectoryValues": self.trajectory_values,
95
- }
96
-
97
- def handle_play(self) -> dict[str, list]:
98
- pass
99
-
100
- def handle_pause(self) -> dict[str, list]:
101
- pass
102
-
103
- def _is_valid_function(
104
- self, function: str, mode: str, xlim: list, ylim: list
105
- ) -> bool:
106
- # axis limit checks
107
- if len(xlim) != 2 or len(ylim) != 2:
108
- return False
109
- if xlim[0] >= xlim[1] or ylim[0] >= ylim[1]:
110
- return False
111
-
112
- # function expression check
113
- try:
114
- expr = self._parse_function(function)
115
- except Exception as e:
116
- return False
117
-
118
- if mode == "univariate" and symbols("y") in expr.free_symbols:
119
- return False
120
-
121
- return True
122
-
123
- def _function_changed(self, function: str, mode: str) -> bool:
124
- function = function.strip()
125
- previous_function = self.settings.get("function", "").strip()
126
- previous_mode = self.settings.get("mode", "")
127
- return function != previous_function or mode != previous_mode
128
-
129
- def _reset_trajectory(self) -> None:
130
- try:
131
- self._compute_trajectory_values(self.settings, steps=1)
132
- except Exception as e:
133
- self.trajectory_values = {"x": [], "y": []}
134
-
135
- def _parse_function(self, function: str) -> Expr:
136
- if not function.strip():
137
- raise ValueError("Function expression cannot be empty")
138
-
139
- x, y = symbols("x y")
140
- allowed_locals = {
141
- 'x': x,
142
- 'y': y,
143
- 'sin': sin,
144
- 'cos': cos,
145
- 'tan': tan,
146
- 'asin': asin,
147
- 'acos': acos,
148
- 'atan': atan,
149
- 'log': log,
150
- 'ln': log,
151
- 'sqrt': sqrt,
152
- 'abs': Abs,
153
- 'exp': exp,
154
- 'e': exp(1),
155
- 'pi': pi,
156
- 'π': pi,
157
- }
158
-
159
- try:
160
- parsed_function = parse_expr(
161
- function,
162
- local_dict=allowed_locals,
163
- transformations=standard_transformations + (
164
- implicit_multiplication_application,
165
- convert_xor,
166
- ),
167
- evaluate=True,
168
- )
169
- except Exception as e:
170
- raise ValueError(f"Invalid function expression: {e}")
171
-
172
- unknown_symbols = parsed_function.free_symbols - {x, y}
173
- if unknown_symbols:
174
- unknown_names = ", ".join(sorted(str(s) for s in unknown_symbols))
175
- raise ValueError(f"Unknown variable(s): {unknown_names}. Allowed: x, y")
176
-
177
- return parsed_function
178
-
179
- def _compute_function_values(self, function: str, mode: str, xlim: list, ylim: list) -> None:
180
- expr = self._parse_function(function)
181
-
182
- if mode == "univariate":
183
- x = np.linspace(xlim[0], xlim[1], 101)
184
- f = lambdify('x', expr, modules=['numpy'])
185
- y = f(x)
186
-
187
- if not isinstance(y, np.ndarray):
188
- y = np.full_like(x, y)
189
-
190
- self.function_values = {
191
- "x": x.tolist(),
192
- "y": y.tolist(),
193
- }
194
-
195
- elif mode == "bivariate":
196
- x = np.linspace(xlim[0], xlim[1], 101)
197
- y = np.linspace(ylim[0], ylim[1], 101)
198
- X, Y = np.meshgrid(x, y)
199
- f = lambdify(('x', 'y'), expr, modules=['numpy'])
200
- gradient_x = lambdify(('x', 'y'), expr.diff('x'), modules=['numpy'])
201
- gradient_y = lambdify(('x', 'y'), expr.diff('y'), modules=['numpy'])
202
- Z = f(X, Y)
203
- gradient_x_values = gradient_x(X, Y)
204
- gradient_y_values = gradient_y(X, Y)
205
-
206
- if not isinstance(Z, np.ndarray):
207
- Z = np.full_like(X, Z)
208
- if not isinstance(gradient_x_values, np.ndarray):
209
- gradient_x_values = np.full_like(X, gradient_x_values)
210
- if not isinstance(gradient_y_values, np.ndarray):
211
- gradient_y_values = np.full_like(Y, gradient_y_values)
212
-
213
- self.function_values = {
214
- "x": x.tolist(),
215
- "y": y.tolist(),
216
- "z": Z.tolist(),
217
- "gradientX": gradient_x_values.tolist(),
218
- "gradientY": gradient_y_values.tolist(),
219
- }
220
-
221
- else:
222
- raise ValueError("Unsupported mode")
223
-
224
- def _compute_trajectory_values(self, settings: dict, steps: int) -> None:
225
- mode = settings.get("mode", "").lower().strip()
226
- algorithm = settings.get("algorithm", "").lower().strip().replace(" ", "_")
227
- function = self._parse_function(settings.get("functionExpr", "").strip())
228
-
229
- if mode == "univariate":
230
- if algorithm == "gradient_descent":
231
- self.trajectory_values = gd_univariate(
232
- function,
233
- float(settings["x0"]),
234
- float(settings["learningRate"]),
235
- float(settings["momentum"]),
236
- steps,
237
- )
238
- elif algorithm == "nesterov":
239
- self.trajectory_values = nesterov_univariate(
240
- function,
241
- float(settings["x0"]),
242
- float(settings["learningRate"]),
243
- float(settings["momentum"]),
244
- steps,
245
- )
246
- elif algorithm == "adam":
247
- self.trajectory_values = adam_univariate(
248
- function,
249
- float(settings["x0"]),
250
- float(settings["learningRate"]),
251
- float(settings["beta1"]),
252
- float(settings["beta2"]),
253
- float(settings["epsilon"]),
254
- steps,
255
- )
256
- elif algorithm == "adagrad":
257
- self.trajectory_values = adagrad_univariate(
258
- function,
259
- float(settings["x0"]),
260
- float(settings["learningRate"]),
261
- float(settings["epsilon"]),
262
- steps,
263
- )
264
- elif algorithm == "rmsprop":
265
- self.trajectory_values = rmsprop_univariate(
266
- function,
267
- float(settings["x0"]),
268
- float(settings["learningRate"]),
269
- float(settings["beta"]),
270
- float(settings["epsilon"]),
271
- steps,
272
- )
273
- elif algorithm == "adadelta":
274
- self.trajectory_values = adadelta_univariate(
275
- function,
276
- float(settings["x0"]),
277
- float(settings["beta"]),
278
- float(settings["epsilon"]),
279
- steps,
280
- )
281
- elif algorithm == "newton":
282
- self.trajectory_values = newton_univariate(
283
- function,
284
- float(settings["x0"]),
285
- steps,
286
- )
287
- else:
288
- raise ValueError("Unsupported algorithm for univariate mode")
289
-
290
- elif mode == "bivariate":
291
- if algorithm == "gradient_descent":
292
- self.trajectory_values = gd_bivariate(
293
- function,
294
- float(settings["x0"]),
295
- float(settings["y0"]),
296
- float(settings["learningRate"]),
297
- float(settings["momentum"]),
298
- steps,
299
- )
300
- elif algorithm == "nesterov":
301
- self.trajectory_values = nesterov_bivariate(
302
- function,
303
- float(settings["x0"]),
304
- float(settings["y0"]),
305
- float(settings["learningRate"]),
306
- float(settings["momentum"]),
307
- steps,
308
- )
309
- elif algorithm == "adam":
310
- self.trajectory_values = adam_bivariate(
311
- function,
312
- float(settings["x0"]),
313
- float(settings["y0"]),
314
- float(settings["learningRate"]),
315
- float(settings["beta1"]),
316
- float(settings["beta2"]),
317
- float(settings["epsilon"]),
318
- steps,
319
- )
320
- elif algorithm == "adagrad":
321
- self.trajectory_values = adagrad_bivariate(
322
- function,
323
- float(settings["x0"]),
324
- float(settings["y0"]),
325
- float(settings["learningRate"]),
326
- float(settings["epsilon"]),
327
- steps,
328
- )
329
- elif algorithm == "rmsprop":
330
- self.trajectory_values = rmsprop_bivariate(
331
- function,
332
- float(settings["x0"]),
333
- float(settings["y0"]),
334
- float(settings["learningRate"]),
335
- float(settings["beta"]),
336
- float(settings["epsilon"]),
337
- steps,
338
- )
339
- elif algorithm == "adadelta":
340
- self.trajectory_values = adadelta_bivariate(
341
- function,
342
- float(settings["x0"]),
343
- float(settings["y0"]),
344
- float(settings["beta"]),
345
- float(settings["epsilon"]),
346
- steps,
347
- )
348
- elif algorithm == "newton":
349
- self.trajectory_values = newton_bivariate(
350
- function,
351
- float(settings["x0"]),
352
- float(settings["y0"]),
353
- steps,
354
- )
355
- else:
356
- raise ValueError("Unsupported algorithm for bivariate mode")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
backend/tests/test_contract.py ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Replay each contract example in ../contract against a fresh Manager.
2
+
3
+ Each example lists calls in order, keyed by method name. A call has "args"
4
+ (omitted for methods that take none) and either "result" (the expected return
5
+ value as JSON; floats are compared to 6 significant figures) or "error" (a
6
+ UserError of "kind": "user", whose text contains "message" if given). This
7
+ mirrors what @elvis/pyodide's worker sends to the UI.
8
+ """
9
+
10
+ import json
11
+ from pathlib import Path
12
+
13
+ import pytest
14
+
15
+ from manager import Manager
16
+
17
+ CONTRACT_DIR = Path(__file__).parent.parent / "contract"
18
+ EXAMPLES = sorted(CONTRACT_DIR.glob("*.json"))
19
+
20
+
21
+ def same(actual, expected) -> bool:
22
+ """Equal JSON values, with floats compared approximately."""
23
+ if isinstance(expected, float) or isinstance(actual, float):
24
+ return isinstance(actual, (int, float)) and actual == pytest.approx(expected, rel=1e-6, abs=1e-12)
25
+ if isinstance(expected, dict):
26
+ return isinstance(actual, dict) and actual.keys() == expected.keys() and all(same(actual[k], expected[k]) for k in expected)
27
+ if isinstance(expected, list):
28
+ return isinstance(actual, list) and len(actual) == len(expected) and all(same(a, e) for a, e in zip(actual, expected))
29
+ return actual == expected
30
+
31
+
32
+ @pytest.mark.parametrize("path", EXAMPLES, ids=[p.stem for p in EXAMPLES])
33
+ def test_contract_example(path: Path) -> None:
34
+ example = json.loads(path.read_text())
35
+ manager = Manager()
36
+
37
+ for method, call in example["calls"].items():
38
+ fn = getattr(manager, method)
39
+ try:
40
+ data = fn(call["args"]) if "args" in call else fn()
41
+ except Exception as e:
42
+ # The worker treats only UserError as a user error; anything else is a bug
43
+ if type(e).__name__ != "UserError":
44
+ raise
45
+ assert "error" in call, f"{method} raised UserError: {e}"
46
+ assert call["error"]["kind"] == "user"
47
+ assert call["error"].get("message", "") in str(e)
48
+ continue
49
+
50
+ assert "error" not in call, f"{method} returned {data!r} instead of raising UserError"
51
+ # Results must be plain JSON values (no NumPy types) to reach the UI unchanged
52
+ actual = json.loads(json.dumps(data))
53
+ assert same(actual, call["result"]), f"{method} returned {actual!r}"
backend/tests/test_logic.py ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import inspect
2
+ import json
3
+ from pathlib import Path
4
+
5
+ import numpy as np
6
+ import pytest
7
+
8
+ from logic import DIVERGED, OPTIMISERS, SINGULAR, Objective, Run, parse_function
9
+ from manager import MAX_ITERATIONS, Manager, UserError
10
+
11
+ SPEC = json.loads((Path(__file__).parent.parent / "src" / "algorithms.json").read_text())["algorithms"]
12
+ DEFAULTS = {spec["id"]: {p["name"]: p["default"] for p in spec["params"]} for spec in SPEC}
13
+
14
+
15
+ def run(expression: str, algorithm: str, start: list[float], **params) -> Run:
16
+ f = Objective(parse_function(expression, len(start)), len(start))
17
+ return Run(f, OPTIMISERS[algorithm](f, **(DEFAULTS[algorithm] | params)), np.array(start, dtype=float))
18
+
19
+
20
+ def test_spec_matches_optimisers():
21
+ assert [spec["id"] for spec in SPEC] == list(OPTIMISERS)
22
+ for spec in SPEC:
23
+ names = list(inspect.signature(OPTIMISERS[spec["id"]]).parameters)[1:]
24
+ assert names == [p["name"] for p in spec["params"]], spec["id"]
25
+
26
+
27
+ @pytest.mark.parametrize("expression, n, expected", [
28
+ ("x^2 - 0.1cos(20x)", 1, 0.81 - 0.1 * np.cos(18)),
29
+ ("2x y + e", 2, 2 * 0.9 * -0.5 + np.e),
30
+ ("sqrt(abs(x)) + ln(exp(y))", 2, np.sqrt(0.9) - 0.5),
31
+ ])
32
+ def test_parse_function(expression, n, expected):
33
+ f = Objective(parse_function(expression, n), n)
34
+ point = np.array([0.9, -0.5][:n])
35
+ assert f.value(point) == pytest.approx(expected)
36
+
37
+
38
+ @pytest.mark.parametrize("expression, message", [
39
+ ("", "Enter a function"),
40
+ ("x^2 + (", "can read"),
41
+ ("x + z", "Unknown name z"),
42
+ # Only the listed functions: none of sympy's others, and nothing from Python
43
+ ("gamma(x)", "Unknown name gamma"),
44
+ ("factorial(x) + y", "Unknown name factorial"),
45
+ ("Max(x, y)", "Unknown name Max"),
46
+ ("__import__('os')", "Unknown name __import__"),
47
+ ("x.__class__", "Unknown name __class__"),
48
+ ])
49
+ def test_parse_function_errors(expression, message):
50
+ with pytest.raises(ValueError, match=message):
51
+ parse_function(expression, 2)
52
+
53
+
54
+ def test_unknown_names_list_what_can_be_used():
55
+ with pytest.raises(ValueError, match="x and y, and sin, cos"):
56
+ parse_function("gamma(x)", 2)
57
+ with pytest.raises(ValueError, match="Unknown name y: functions can use x, and sin"):
58
+ parse_function("x + y", 1)
59
+
60
+
61
+ @pytest.mark.parametrize("expression, expected", [
62
+ ("xy", 0.9 * -0.5),
63
+ ("2x y", 2 * 0.9 * -0.5),
64
+ ("π x", np.pi * 0.9),
65
+ ("e^x", np.exp(0.9)),
66
+ ("sin(x)cos(y)", np.sin(0.9) * np.cos(-0.5)),
67
+ ])
68
+ def test_implicit_multiplication_still_works(expression, expected):
69
+ f = Objective(parse_function(expression, 2), 2)
70
+ assert f.value(np.array([0.9, -0.5])) == pytest.approx(expected)
71
+
72
+
73
+ def test_a_function_that_fails_to_evaluate_is_a_user_error(monkeypatch):
74
+ # E.g. a derivative NumPy can't evaluate: caught when the function is set, not mid-run
75
+ import logic
76
+ from sympy import DiracDelta
77
+ monkeypatch.setattr(logic, "derivative", lambda expr, *v: DiracDelta(v[0]))
78
+ with pytest.raises(UserError, match="can't be evaluated"):
79
+ Manager().handle_set_function({"variables": 1, "expression": "x^2"})
80
+
81
+
82
+ def test_gradient_and_hessian():
83
+ f = Objective(parse_function("x^2 y + y^3", 2), 2)
84
+ p = np.array([1.0, 2.0])
85
+ assert f.gradient(p).tolist() == [4.0, 13.0]
86
+ assert f.hessian(p).tolist() == [[4.0, 2.0], [2.0, 12.0]]
87
+
88
+
89
+ def test_abs_has_pytorch_derivatives():
90
+ # As PyTorch's autograd: d|x|/dx = sign(x), 0 at the kink, and no curvature (not a Dirac delta)
91
+ f = Objective(parse_function("abs(x) + abs(x y)", 2), 2)
92
+ assert f.gradient(np.array([-2.0, 3.0])).tolist() == [-1.0 - 3.0, 2.0]
93
+ assert f.gradient(np.array([0.0, 0.0])).tolist() == [0.0, 0.0]
94
+ assert f.hessian(np.array([0.0, 0.0])).tolist() == [[0.0, 0.0], [0.0, 0.0]]
95
+ assert f.hessian(np.array([1.0, 2.0])).tolist() == [[0.0, 1.0], [1.0, 0.0]]
96
+
97
+
98
+ @pytest.mark.parametrize("algorithm", [spec["id"] for spec in SPEC if spec["id"] != "newton"])
99
+ def test_every_first_order_optimiser_runs_on_abs(algorithm):
100
+ r = run("abs(x) + y^2", algorithm, [0.8, -0.6])
101
+ assert r.point(50)["value"] < r.point(0)["value"]
102
+
103
+
104
+ def test_newton_stops_on_abs_with_no_curvature():
105
+ r = run("abs(x)", "newton", [1.0])
106
+ assert r.point(1) is None
107
+ assert r.stopped == SINGULAR
108
+
109
+
110
+ def test_gradient_descent_on_a_quadratic():
111
+ # x_k = (1 - 2η)^k x_0
112
+ r = run("x^2", "gradient_descent", [1.0], learning_rate=0.1)
113
+ assert r.point(10)["position"][0] == pytest.approx(0.8**10)
114
+
115
+
116
+ def test_momentum_overshoots_and_nesterov_damps_it():
117
+ plain = run("x^2", "gradient_descent", [1.0], learning_rate=0.1, momentum=0.9)
118
+ nesterov = run("x^2", "nesterov", [1.0], learning_rate=0.1, momentum=0.9)
119
+ assert min(plain.point(k)["position"][0] for k in range(20)) < -0.5
120
+ assert abs(nesterov.point(20)["position"][0]) < abs(plain.point(20)["position"][0])
121
+
122
+
123
+ def test_newton_solves_a_quadratic_in_one_step():
124
+ r = run("(x - 1)^2 + 3(y + 2)^2 + x y", "newton", [5.0, 5.0])
125
+ assert r.point(1)["gradient"] == pytest.approx([0, 0], abs=1e-12)
126
+
127
+
128
+ @pytest.mark.parametrize("algorithm", [spec["id"] for spec in SPEC])
129
+ def test_every_optimiser_goes_downhill_on_a_bowl(algorithm):
130
+ r = run("x^2 + 3y^2", algorithm, [0.8, -0.6])
131
+ assert r.point(50)["value"] < r.point(0)["value"]
132
+
133
+
134
+ @pytest.mark.parametrize("algorithm, extra", [("adagrad", {}), ("rmsprop", {"beta": 0.0}), ("adam", {"beta1": 0.0, "beta2": 0.0})])
135
+ def test_epsilon_is_outside_the_square_root(algorithm, extra):
136
+ # As PyTorch: x ← x − η g / (√v + ε). On x² from x = 1, g = 2 and v = g² = 4
137
+ # (beta 0 keeps only the latest gradient), so the step is 0.1 · 2 / (2 + 1)
138
+ r = run("x^2", algorithm, [1.0], learning_rate=0.1, epsilon=1.0, **extra)
139
+ assert r.point(1)["position"][0] == pytest.approx(1 - 0.1 * 2 / 3)
140
+
141
+
142
+ def test_divergence_stops_the_run():
143
+ r = run("x^2", "gradient_descent", [1.0], learning_rate=1.5)
144
+ # |x| doubles each step, so it passes 1e6 after 20 steps
145
+ assert r.point(20) is None and r.point(19) is not None
146
+ assert r.stopped == DIVERGED
147
+
148
+
149
+ def test_leaving_the_domain_stops_the_run():
150
+ r = run("sqrt(x)", "gradient_descent", [0.5], learning_rate=1.0)
151
+ assert r.point(3) is None
152
+ assert r.stopped == DIVERGED
153
+
154
+
155
+ def test_singular_hessian_stops_newton():
156
+ r = run("x^3", "newton", [0.0])
157
+ assert r.point(1) is None
158
+ assert r.stopped == SINGULAR
159
+
160
+
161
+ def test_singular_hessian_stops_newton_in_pyodide(monkeypatch):
162
+ # Pyodide's solve returns inf rather than raising LinAlgError
163
+ monkeypatch.setattr(np.linalg, "solve", lambda a, b: np.full_like(b, np.inf))
164
+ r = run("x^2 + 0y", "newton", [1.0, 1.0])
165
+ assert r.point(1) is None
166
+ assert r.stopped == SINGULAR
167
+
168
+
169
+ def test_points_are_cached_and_asked_for_in_any_order():
170
+ r = run("x^2 + y^2", "adam", [1.0, 1.0])
171
+ late = r.point(30)
172
+ assert r.point(3) == r.points[3]
173
+ assert r.point(30) == late
174
+
175
+
176
+ def manager_with(expression: str, *runs: dict) -> Manager:
177
+ m = Manager()
178
+ m.handle_set_function({"variables": len(runs[0]["start"]), "expression": expression})
179
+ m.handle_set_runs({"runs": list(runs)})
180
+ return m
181
+
182
+
183
+ def test_state_past_the_last_iteration():
184
+ m = manager_with("x^2", {"algorithm": "gradient_descent", "start": [1.0], "params": {}})
185
+ assert m.handle_state({"iteration": MAX_ITERATIONS}) is not None
186
+ assert m.handle_state({"iteration": MAX_ITERATIONS + 1}) is None
187
+
188
+
189
+ def test_reaching_the_iteration_limit_says_so():
190
+ m = manager_with("x^2", {"algorithm": "gradient_descent", "start": [1.0], "params": {"learning_rate": 0.001}})
191
+ assert m.handle_state({"iteration": MAX_ITERATIONS - 1})["runs"][0]["stopped"] is None
192
+ assert m.handle_state({"iteration": MAX_ITERATIONS})["runs"][0]["stopped"] == "Reached the 1000-iteration limit."
193
+
194
+
195
+ def test_state_ends_when_every_run_has_stopped():
196
+ m = manager_with(
197
+ "x^3 + x^2",
198
+ {"algorithm": "gradient_descent", "start": [1.0], "params": {"learning_rate": 1.5}},
199
+ {"algorithm": "newton", "start": [-1/3], "params": {}}, # f'' = 0 here
200
+ )
201
+ states = [m.handle_state({"iteration": k}) for k in range(MAX_ITERATIONS)]
202
+ end = states.index(None)
203
+ assert 1 < end and all(s is None for s in states[end:])
204
+ # Newton stops first and says why while gradient descent carries on
205
+ assert states[1]["runs"][1] == {"point": None, "stopped": SINGULAR}
206
+ assert states[1]["runs"][0]["point"] is not None
207
+ # Each run says why at its last point
208
+ assert states[0]["runs"][1]["stopped"] == SINGULAR
209
+ assert states[end - 2]["runs"][0]["stopped"] is None
210
+ assert states[end - 1]["runs"][0]["stopped"] == DIVERGED
211
+
212
+
213
+ def test_start_point_outside_the_domain():
214
+ m = Manager()
215
+ m.handle_set_function({"variables": 1, "expression": "log(x)"})
216
+ with pytest.raises(UserError, match="no finite value at the initial point"):
217
+ m.handle_set_runs({"runs": [{"algorithm": "adam", "start": [-1.0], "params": {}}]})
218
+
219
+
220
+ def test_failed_runs_replace_the_old_ones():
221
+ m = manager_with("log(x)", {"algorithm": "adam", "start": [1.0], "params": {}})
222
+ with pytest.raises(UserError):
223
+ m.handle_set_runs({"runs": [{"algorithm": "adam", "start": [-1.0], "params": {}}]})
224
+ assert m.handle_state({"iteration": 0}) is None
225
+
226
+
227
+ def test_function_values_one_variable():
228
+ m = Manager()
229
+ m.handle_set_function({"variables": 1, "expression": "log(x)"})
230
+ values = m.handle_function_values({"x_range": [-1, 1], "y_range": [0, 1]})
231
+ assert len(values["x"]) == len(values["f"])
232
+ assert values["f"][0] is None and values["f"][-1] == 0.0
233
+
234
+
235
+ def test_function_values_two_variables():
236
+ m = Manager()
237
+ m.handle_set_function({"variables": 2, "expression": "x + 2y"})
238
+ values = m.handle_function_values({"x_range": [0, 1], "y_range": [0, 2]})
239
+ assert values["f"][-1][0] == 4.0 # rows follow y
240
+ assert set(values["arrows"]["u"]) == {1.0} and set(values["arrows"]["v"]) == {2.0}
241
+
242
+
243
+ def test_no_function_values_without_a_function():
244
+ assert Manager().handle_function_values({"x_range": [0, 1], "y_range": [0, 1]}) is None
backend/uv.lock CHANGED
@@ -1,67 +1,31 @@
1
  version = 1
2
- revision = 3
3
- requires-python = ">=3.13"
4
-
5
- [[package]]
6
- name = "annotated-doc"
7
- version = "0.0.4"
8
- source = { registry = "https://pypi.org/simple" }
9
- sdist = { url = "https://files.pythonhosted.org/packages/57/ba/046ceea27344560984e26a590f90bc7f4a75b06701f653222458922b558c/annotated_doc-0.0.4.tar.gz", hash = "sha256:fbcda96e87e9c92ad167c2e53839e57503ecfda18804ea28102353485033faa4", size = 7288, upload-time = "2025-11-10T22:07:42.062Z" }
10
- wheels = [
11
- { url = "https://files.pythonhosted.org/packages/1e/d3/26bf1008eb3d2daa8ef4cacc7f3bfdc11818d111f7e2d0201bc6e3b49d45/annotated_doc-0.0.4-py3-none-any.whl", hash = "sha256:571ac1dc6991c450b25a9c2d84a3705e2ae7a53467b5d111c24fa8baabbed320", size = 5303, upload-time = "2025-11-10T22:07:40.673Z" },
12
- ]
13
-
14
- [[package]]
15
- name = "annotated-types"
16
- version = "0.7.0"
17
- source = { registry = "https://pypi.org/simple" }
18
- sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081, upload-time = "2024-05-20T21:33:25.928Z" }
19
- wheels = [
20
- { url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643, upload-time = "2024-05-20T21:33:24.1Z" },
21
- ]
22
-
23
- [[package]]
24
- name = "anyio"
25
- version = "4.12.1"
26
- source = { registry = "https://pypi.org/simple" }
27
- dependencies = [
28
- { name = "idna" },
29
- ]
30
- sdist = { url = "https://files.pythonhosted.org/packages/96/f0/5eb65b2bb0d09ac6776f2eb54adee6abe8228ea05b20a5ad0e4945de8aac/anyio-4.12.1.tar.gz", hash = "sha256:41cfcc3a4c85d3f05c932da7c26d0201ac36f72abd4435ba90d0464a3ffed703", size = 228685, upload-time = "2026-01-06T11:45:21.246Z" }
31
- wheels = [
32
- { url = "https://files.pythonhosted.org/packages/38/0e/27be9fdef66e72d64c0cdc3cc2823101b80585f8119b5c112c2e8f5f7dab/anyio-4.12.1-py3-none-any.whl", hash = "sha256:d405828884fc140aa80a3c667b8beed277f1dfedec42ba031bd6ac3db606ab6c", size = 113592, upload-time = "2026-01-06T11:45:19.497Z" },
33
- ]
34
 
35
  [[package]]
36
  name = "backend"
37
  version = "0.1.0"
38
  source = { virtual = "." }
39
  dependencies = [
40
- { name = "fastapi" },
41
  { name = "numpy" },
42
  { name = "sympy" },
43
- { name = "uvicorn", extra = ["standard"] },
 
 
 
 
44
  ]
45
 
46
  [package.metadata]
47
  requires-dist = [
48
- { name = "fastapi", specifier = ">=0.128.0" },
49
- { name = "numpy", specifier = ">=2.4.0" },
50
- { name = "sympy", specifier = ">=1.14.0" },
51
- { name = "uvicorn", extras = ["standard"], specifier = ">=0.40.0" },
52
  ]
53
 
54
- [[package]]
55
- name = "click"
56
- version = "8.3.1"
57
- source = { registry = "https://pypi.org/simple" }
58
- dependencies = [
59
- { name = "colorama", marker = "sys_platform == 'win32'" },
60
- ]
61
- sdist = { url = "https://files.pythonhosted.org/packages/3d/fa/656b739db8587d7b5dfa22e22ed02566950fbfbcdc20311993483657a5c0/click-8.3.1.tar.gz", hash = "sha256:12ff4785d337a1bb490bb7e9c2b1ee5da3112e94a8622f26a6c77f5d2fc6842a", size = 295065, upload-time = "2025-11-15T20:45:42.706Z" }
62
- wheels = [
63
- { url = "https://files.pythonhosted.org/packages/98/78/01c019cdb5d6498122777c1a43056ebb3ebfeef2076d9d026bfe15583b2b/click-8.3.1-py3-none-any.whl", hash = "sha256:981153a64e25f12d547d3426c367a4857371575ee7ad18df2a6183ab0545b2a6", size = 108274, upload-time = "2025-11-15T20:45:41.139Z" },
64
- ]
65
 
66
  [[package]]
67
  name = "colorama"
@@ -73,58 +37,12 @@ wheels = [
73
  ]
74
 
75
  [[package]]
76
- name = "fastapi"
77
- version = "0.128.0"
78
- source = { registry = "https://pypi.org/simple" }
79
- dependencies = [
80
- { name = "annotated-doc" },
81
- { name = "pydantic" },
82
- { name = "starlette" },
83
- { name = "typing-extensions" },
84
- ]
85
- sdist = { url = "https://files.pythonhosted.org/packages/52/08/8c8508db6c7b9aae8f7175046af41baad690771c9bcde676419965e338c7/fastapi-0.128.0.tar.gz", hash = "sha256:1cc179e1cef10a6be60ffe429f79b829dce99d8de32d7acb7e6c8dfdf7f2645a", size = 365682, upload-time = "2025-12-27T15:21:13.714Z" }
86
- wheels = [
87
- { url = "https://files.pythonhosted.org/packages/5c/05/5cbb59154b093548acd0f4c7c474a118eda06da25aa75c616b72d8fcd92a/fastapi-0.128.0-py3-none-any.whl", hash = "sha256:aebd93f9716ee3b4f4fcfe13ffb7cf308d99c9f3ab5622d8877441072561582d", size = 103094, upload-time = "2025-12-27T15:21:12.154Z" },
88
- ]
89
-
90
- [[package]]
91
- name = "h11"
92
- version = "0.16.0"
93
  source = { registry = "https://pypi.org/simple" }
94
- sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" }
95
  wheels = [
96
- { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" },
97
- ]
98
-
99
- [[package]]
100
- name = "httptools"
101
- version = "0.7.1"
102
- source = { registry = "https://pypi.org/simple" }
103
- sdist = { url = "https://files.pythonhosted.org/packages/b5/46/120a669232c7bdedb9d52d4aeae7e6c7dfe151e99dc70802e2fc7a5e1993/httptools-0.7.1.tar.gz", hash = "sha256:abd72556974f8e7c74a259655924a717a2365b236c882c3f6f8a45fe94703ac9", size = 258961, upload-time = "2025-10-10T03:55:08.559Z" }
104
- wheels = [
105
- { url = "https://files.pythonhosted.org/packages/09/8f/c77b1fcbfd262d422f12da02feb0d218fa228d52485b77b953832105bb90/httptools-0.7.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:6babce6cfa2a99545c60bfef8bee0cc0545413cb0018f617c8059a30ad985de3", size = 202889, upload-time = "2025-10-10T03:54:47.089Z" },
106
- { url = "https://files.pythonhosted.org/packages/0a/1a/22887f53602feaa066354867bc49a68fc295c2293433177ee90870a7d517/httptools-0.7.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:601b7628de7504077dd3dcb3791c6b8694bbd967148a6d1f01806509254fb1ca", size = 108180, upload-time = "2025-10-10T03:54:48.052Z" },
107
- { url = "https://files.pythonhosted.org/packages/32/6a/6aaa91937f0010d288d3d124ca2946d48d60c3a5ee7ca62afe870e3ea011/httptools-0.7.1-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:04c6c0e6c5fb0739c5b8a9eb046d298650a0ff38cf42537fc372b28dc7e4472c", size = 478596, upload-time = "2025-10-10T03:54:48.919Z" },
108
- { url = "https://files.pythonhosted.org/packages/6d/70/023d7ce117993107be88d2cbca566a7c1323ccbaf0af7eabf2064fe356f6/httptools-0.7.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:69d4f9705c405ae3ee83d6a12283dc9feba8cc6aaec671b412917e644ab4fa66", size = 473268, upload-time = "2025-10-10T03:54:49.993Z" },
109
- { url = "https://files.pythonhosted.org/packages/32/4d/9dd616c38da088e3f436e9a616e1d0cc66544b8cdac405cc4e81c8679fc7/httptools-0.7.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:44c8f4347d4b31269c8a9205d8a5ee2df5322b09bbbd30f8f862185bb6b05346", size = 455517, upload-time = "2025-10-10T03:54:51.066Z" },
110
- { url = "https://files.pythonhosted.org/packages/1d/3a/a6c595c310b7df958e739aae88724e24f9246a514d909547778d776799be/httptools-0.7.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:465275d76db4d554918aba40bf1cbebe324670f3dfc979eaffaa5d108e2ed650", size = 458337, upload-time = "2025-10-10T03:54:52.196Z" },
111
- { url = "https://files.pythonhosted.org/packages/fd/82/88e8d6d2c51edc1cc391b6e044c6c435b6aebe97b1abc33db1b0b24cd582/httptools-0.7.1-cp313-cp313-win_amd64.whl", hash = "sha256:322d00c2068d125bd570f7bf78b2d367dad02b919d8581d7476d8b75b294e3e6", size = 85743, upload-time = "2025-10-10T03:54:53.448Z" },
112
- { url = "https://files.pythonhosted.org/packages/34/50/9d095fcbb6de2d523e027a2f304d4551855c2f46e0b82befd718b8b20056/httptools-0.7.1-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:c08fe65728b8d70b6923ce31e3956f859d5e1e8548e6f22ec520a962c6757270", size = 203619, upload-time = "2025-10-10T03:54:54.321Z" },
113
- { url = "https://files.pythonhosted.org/packages/07/f0/89720dc5139ae54b03f861b5e2c55a37dba9a5da7d51e1e824a1f343627f/httptools-0.7.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:7aea2e3c3953521c3c51106ee11487a910d45586e351202474d45472db7d72d3", size = 108714, upload-time = "2025-10-10T03:54:55.163Z" },
114
- { url = "https://files.pythonhosted.org/packages/b3/cb/eea88506f191fb552c11787c23f9a405f4c7b0c5799bf73f2249cd4f5228/httptools-0.7.1-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:0e68b8582f4ea9166be62926077a3334064d422cf08ab87d8b74664f8e9058e1", size = 472909, upload-time = "2025-10-10T03:54:56.056Z" },
115
- { url = "https://files.pythonhosted.org/packages/e0/4a/a548bdfae6369c0d078bab5769f7b66f17f1bfaa6fa28f81d6be6959066b/httptools-0.7.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:df091cf961a3be783d6aebae963cc9b71e00d57fa6f149025075217bc6a55a7b", size = 470831, upload-time = "2025-10-10T03:54:57.219Z" },
116
- { url = "https://files.pythonhosted.org/packages/4d/31/14df99e1c43bd132eec921c2e7e11cda7852f65619bc0fc5bdc2d0cb126c/httptools-0.7.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:f084813239e1eb403ddacd06a30de3d3e09a9b76e7894dcda2b22f8a726e9c60", size = 452631, upload-time = "2025-10-10T03:54:58.219Z" },
117
- { url = "https://files.pythonhosted.org/packages/22/d2/b7e131f7be8d854d48cb6d048113c30f9a46dca0c9a8b08fcb3fcd588cdc/httptools-0.7.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:7347714368fb2b335e9063bc2b96f2f87a9ceffcd9758ac295f8bbcd3ffbc0ca", size = 452910, upload-time = "2025-10-10T03:54:59.366Z" },
118
- { url = "https://files.pythonhosted.org/packages/53/cf/878f3b91e4e6e011eff6d1fa9ca39f7eb17d19c9d7971b04873734112f30/httptools-0.7.1-cp314-cp314-win_amd64.whl", hash = "sha256:cfabda2a5bb85aa2a904ce06d974a3f30fb36cc63d7feaddec05d2050acede96", size = 88205, upload-time = "2025-10-10T03:55:00.389Z" },
119
- ]
120
-
121
- [[package]]
122
- name = "idna"
123
- version = "3.11"
124
- source = { registry = "https://pypi.org/simple" }
125
- sdist = { url = "https://files.pythonhosted.org/packages/6f/6d/0703ccc57f3a7233505399edb88de3cbd678da106337b9fcde432b65ed60/idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902", size = 194582, upload-time = "2025-10-12T14:55:20.501Z" }
126
- wheels = [
127
- { url = "https://files.pythonhosted.org/packages/0e/61/66938bbb5fc52dbdf84594873d5b51fb1f7c7794e9c0f5bd885f30bc507b/idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea", size = 71008, upload-time = "2025-10-12T14:55:18.883Z" },
128
  ]
129
 
130
  [[package]]
@@ -138,335 +56,71 @@ wheels = [
138
 
139
  [[package]]
140
  name = "numpy"
141
- version = "2.4.0"
142
  source = { registry = "https://pypi.org/simple" }
143
- sdist = { url = "https://files.pythonhosted.org/packages/a4/7a/6a3d14e205d292b738db449d0de649b373a59edb0d0b4493821d0a3e8718/numpy-2.4.0.tar.gz", hash = "sha256:6e504f7b16118198f138ef31ba24d985b124c2c469fe8467007cf30fd992f934", size = 20685720, upload-time = "2025-12-20T16:18:19.023Z" }
144
  wheels = [
145
- { url = "https://files.pythonhosted.org/packages/a7/0d/853fd96372eda07c824d24adf02e8bc92bb3731b43a9b2a39161c3667cc4/numpy-2.4.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a152d86a3ae00ba5f47b3acf3b827509fd0b6cb7d3259665e63dafbad22a75ea", size = 16649088, upload-time = "2025-12-20T16:16:31.421Z" },
146
- { url = "https://files.pythonhosted.org/packages/e3/37/cc636f1f2a9f585434e20a3e6e63422f70bfe4f7f6698e941db52ea1ac9a/numpy-2.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:39b19251dec4de8ff8496cd0806cbe27bf0684f765abb1f4809554de93785f2d", size = 12364065, upload-time = "2025-12-20T16:16:33.491Z" },
147
- { url = "https://files.pythonhosted.org/packages/ed/69/0b78f37ca3690969beee54103ce5f6021709134e8020767e93ba691a72f1/numpy-2.4.0-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:009bd0ea12d3c784b6639a8457537016ce5172109e585338e11334f6a7bb88ee", size = 5192640, upload-time = "2025-12-20T16:16:35.636Z" },
148
- { url = "https://files.pythonhosted.org/packages/1d/2a/08569f8252abf590294dbb09a430543ec8f8cc710383abfb3e75cc73aeda/numpy-2.4.0-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:5fe44e277225fd3dff6882d86d3d447205d43532c3627313d17e754fb3905a0e", size = 6541556, upload-time = "2025-12-20T16:16:37.276Z" },
149
- { url = "https://files.pythonhosted.org/packages/93/e9/a949885a4e177493d61519377952186b6cbfdf1d6002764c664ba28349b5/numpy-2.4.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f935c4493eda9069851058fa0d9e39dbf6286be690066509305e52912714dbb2", size = 14396562, upload-time = "2025-12-20T16:16:38.953Z" },
150
- { url = "https://files.pythonhosted.org/packages/99/98/9d4ad53b0e9ef901c2ef1d550d2136f5ac42d3fd2988390a6def32e23e48/numpy-2.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8cfa5f29a695cb7438965e6c3e8d06e0416060cf0d709c1b1c1653a939bf5c2a", size = 16351719, upload-time = "2025-12-20T16:16:41.503Z" },
151
- { url = "https://files.pythonhosted.org/packages/28/de/5f3711a38341d6e8dd619f6353251a0cdd07f3d6d101a8fd46f4ef87f895/numpy-2.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ba0cb30acd3ef11c94dc27fbfba68940652492bc107075e7ffe23057f9425681", size = 16176053, upload-time = "2025-12-20T16:16:44.552Z" },
152
- { url = "https://files.pythonhosted.org/packages/2a/5b/2a3753dc43916501b4183532e7ace862e13211042bceafa253afb5c71272/numpy-2.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:60e8c196cd82cbbd4f130b5290007e13e6de3eca79f0d4d38014769d96a7c475", size = 18277859, upload-time = "2025-12-20T16:16:47.174Z" },
153
- { url = "https://files.pythonhosted.org/packages/2c/c5/a18bcdd07a941db3076ef489d036ab16d2bfc2eae0cf27e5a26e29189434/numpy-2.4.0-cp313-cp313-win32.whl", hash = "sha256:5f48cb3e88fbc294dc90e215d86fbaf1c852c63dbdb6c3a3e63f45c4b57f7344", size = 5953849, upload-time = "2025-12-20T16:16:49.554Z" },
154
- { url = "https://files.pythonhosted.org/packages/4f/f1/719010ff8061da6e8a26e1980cf090412d4f5f8060b31f0c45d77dd67a01/numpy-2.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:a899699294f28f7be8992853c0c60741f16ff199205e2e6cdca155762cbaa59d", size = 12302840, upload-time = "2025-12-20T16:16:51.227Z" },
155
- { url = "https://files.pythonhosted.org/packages/f5/5a/b3d259083ed8b4d335270c76966cb6cf14a5d1b69e1a608994ac57a659e6/numpy-2.4.0-cp313-cp313-win_arm64.whl", hash = "sha256:9198f447e1dc5647d07c9a6bbe2063cc0132728cc7175b39dbc796da5b54920d", size = 10308509, upload-time = "2025-12-20T16:16:53.313Z" },
156
- { url = "https://files.pythonhosted.org/packages/31/01/95edcffd1bb6c0633df4e808130545c4f07383ab629ac7e316fb44fff677/numpy-2.4.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:74623f2ab5cc3f7c886add4f735d1031a1d2be4a4ae63c0546cfd74e7a31ddf6", size = 12491815, upload-time = "2025-12-20T16:16:55.496Z" },
157
- { url = "https://files.pythonhosted.org/packages/59/ea/5644b8baa92cc1c7163b4b4458c8679852733fa74ca49c942cfa82ded4e0/numpy-2.4.0-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:0804a8e4ab070d1d35496e65ffd3cf8114c136a2b81f61dfab0de4b218aacfd5", size = 5320321, upload-time = "2025-12-20T16:16:57.468Z" },
158
- { url = "https://files.pythonhosted.org/packages/26/4e/e10938106d70bc21319bd6a86ae726da37edc802ce35a3a71ecdf1fdfe7f/numpy-2.4.0-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:02a2038eb27f9443a8b266a66911e926566b5a6ffd1a689b588f7f35b81e7dc3", size = 6641635, upload-time = "2025-12-20T16:16:59.379Z" },
159
- { url = "https://files.pythonhosted.org/packages/b3/8d/a8828e3eaf5c0b4ab116924df82f24ce3416fa38d0674d8f708ddc6c8aac/numpy-2.4.0-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1889b3a3f47a7b5bee16bc25a2145bd7cb91897f815ce3499db64c7458b6d91d", size = 14456053, upload-time = "2025-12-20T16:17:01.768Z" },
160
- { url = "https://files.pythonhosted.org/packages/68/a1/17d97609d87d4520aa5ae2dcfb32305654550ac6a35effb946d303e594ce/numpy-2.4.0-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:85eef4cb5625c47ee6425c58a3502555e10f45ee973da878ac8248ad58c136f3", size = 16401702, upload-time = "2025-12-20T16:17:04.235Z" },
161
- { url = "https://files.pythonhosted.org/packages/18/32/0f13c1b2d22bea1118356b8b963195446f3af124ed7a5adfa8fdecb1b6ca/numpy-2.4.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:6dc8b7e2f4eb184b37655195f421836cfae6f58197b67e3ffc501f1333d993fa", size = 16242493, upload-time = "2025-12-20T16:17:06.856Z" },
162
- { url = "https://files.pythonhosted.org/packages/ae/23/48f21e3d309fbc137c068a1475358cbd3a901b3987dcfc97a029ab3068e2/numpy-2.4.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:44aba2f0cafd287871a495fb3163408b0bd25bbce135c6f621534a07f4f7875c", size = 18324222, upload-time = "2025-12-20T16:17:09.392Z" },
163
- { url = "https://files.pythonhosted.org/packages/ac/52/41f3d71296a3dcaa4f456aaa3c6fc8e745b43d0552b6bde56571bb4b4a0f/numpy-2.4.0-cp313-cp313t-win32.whl", hash = "sha256:20c115517513831860c573996e395707aa9fb691eb179200125c250e895fcd93", size = 6076216, upload-time = "2025-12-20T16:17:11.437Z" },
164
- { url = "https://files.pythonhosted.org/packages/35/ff/46fbfe60ab0710d2a2b16995f708750307d30eccbb4c38371ea9e986866e/numpy-2.4.0-cp313-cp313t-win_amd64.whl", hash = "sha256:b48e35f4ab6f6a7597c46e301126ceba4c44cd3280e3750f85db48b082624fa4", size = 12444263, upload-time = "2025-12-20T16:17:13.182Z" },
165
- { url = "https://files.pythonhosted.org/packages/a3/e3/9189ab319c01d2ed556c932ccf55064c5d75bb5850d1df7a482ce0badead/numpy-2.4.0-cp313-cp313t-win_arm64.whl", hash = "sha256:4d1cfce39e511069b11e67cd0bd78ceff31443b7c9e5c04db73c7a19f572967c", size = 10378265, upload-time = "2025-12-20T16:17:15.211Z" },
166
- { url = "https://files.pythonhosted.org/packages/ab/ed/52eac27de39d5e5a6c9aadabe672bc06f55e24a3d9010cd1183948055d76/numpy-2.4.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:c95eb6db2884917d86cde0b4d4cf31adf485c8ec36bf8696dd66fa70de96f36b", size = 16647476, upload-time = "2025-12-20T16:17:17.671Z" },
167
- { url = "https://files.pythonhosted.org/packages/77/c0/990ce1b7fcd4e09aeaa574e2a0a839589e4b08b2ca68070f1acb1fea6736/numpy-2.4.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:65167da969cd1ec3a1df31cb221ca3a19a8aaa25370ecb17d428415e93c1935e", size = 12374563, upload-time = "2025-12-20T16:17:20.216Z" },
168
- { url = "https://files.pythonhosted.org/packages/37/7c/8c5e389c6ae8f5fd2277a988600d79e9625db3fff011a2d87ac80b881a4c/numpy-2.4.0-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:3de19cfecd1465d0dcf8a5b5ea8b3155b42ed0b639dba4b71e323d74f2a3be5e", size = 5203107, upload-time = "2025-12-20T16:17:22.47Z" },
169
- { url = "https://files.pythonhosted.org/packages/e6/94/ca5b3bd6a8a70a5eec9a0b8dd7f980c1eff4b8a54970a9a7fef248ef564f/numpy-2.4.0-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:6c05483c3136ac4c91b4e81903cb53a8707d316f488124d0398499a4f8e8ef51", size = 6538067, upload-time = "2025-12-20T16:17:24.001Z" },
170
- { url = "https://files.pythonhosted.org/packages/79/43/993eb7bb5be6761dde2b3a3a594d689cec83398e3f58f4758010f3b85727/numpy-2.4.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:36667db4d6c1cea79c8930ab72fadfb4060feb4bfe724141cd4bd064d2e5f8ce", size = 14411926, upload-time = "2025-12-20T16:17:25.822Z" },
171
- { url = "https://files.pythonhosted.org/packages/03/75/d4c43b61de473912496317a854dac54f1efec3eeb158438da6884b70bb90/numpy-2.4.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9a818668b674047fd88c4cddada7ab8f1c298812783e8328e956b78dc4807f9f", size = 16354295, upload-time = "2025-12-20T16:17:28.308Z" },
172
- { url = "https://files.pythonhosted.org/packages/b8/0a/b54615b47ee8736a6461a4bb6749128dd3435c5a759d5663f11f0e9af4ac/numpy-2.4.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:1ee32359fb7543b7b7bd0b2f46294db27e29e7bbdf70541e81b190836cd83ded", size = 16190242, upload-time = "2025-12-20T16:17:30.993Z" },
173
- { url = "https://files.pythonhosted.org/packages/98/ce/ea207769aacad6246525ec6c6bbd66a2bf56c72443dc10e2f90feed29290/numpy-2.4.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:e493962256a38f58283de033d8af176c5c91c084ea30f15834f7545451c42059", size = 18280875, upload-time = "2025-12-20T16:17:33.327Z" },
174
- { url = "https://files.pythonhosted.org/packages/17/ef/ec409437aa962ea372ed601c519a2b141701683ff028f894b7466f0ab42b/numpy-2.4.0-cp314-cp314-win32.whl", hash = "sha256:6bbaebf0d11567fa8926215ae731e1d58e6ec28a8a25235b8a47405d301332db", size = 6002530, upload-time = "2025-12-20T16:17:35.729Z" },
175
- { url = "https://files.pythonhosted.org/packages/5f/4a/5cb94c787a3ed1ac65e1271b968686521169a7b3ec0b6544bb3ca32960b0/numpy-2.4.0-cp314-cp314-win_amd64.whl", hash = "sha256:3d857f55e7fdf7c38ab96c4558c95b97d1c685be6b05c249f5fdafcbd6f9899e", size = 12435890, upload-time = "2025-12-20T16:17:37.599Z" },
176
- { url = "https://files.pythonhosted.org/packages/48/a0/04b89db963af9de1104975e2544f30de89adbf75b9e75f7dd2599be12c79/numpy-2.4.0-cp314-cp314-win_arm64.whl", hash = "sha256:bb50ce5fb202a26fd5404620e7ef820ad1ab3558b444cb0b55beb7ef66cd2d63", size = 10591892, upload-time = "2025-12-20T16:17:39.649Z" },
177
- { url = "https://files.pythonhosted.org/packages/53/e5/d74b5ccf6712c06c7a545025a6a71bfa03bdc7e0568b405b0d655232fd92/numpy-2.4.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:355354388cba60f2132df297e2d53053d4063f79077b67b481d21276d61fc4df", size = 12494312, upload-time = "2025-12-20T16:17:41.714Z" },
178
- { url = "https://files.pythonhosted.org/packages/c2/08/3ca9cc2ddf54dfee7ae9a6479c071092a228c68aef08252aa08dac2af002/numpy-2.4.0-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:1d8f9fde5f6dc1b6fc34df8162f3b3079365468703fee7f31d4e0cc8c63baed9", size = 5322862, upload-time = "2025-12-20T16:17:44.145Z" },
179
- { url = "https://files.pythonhosted.org/packages/87/74/0bb63a68394c0c1e52670cfff2e309afa41edbe11b3327d9af29e4383f34/numpy-2.4.0-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:e0434aa22c821f44eeb4c650b81c7fbdd8c0122c6c4b5a576a76d5a35625ecd9", size = 6644986, upload-time = "2025-12-20T16:17:46.203Z" },
180
- { url = "https://files.pythonhosted.org/packages/06/8f/9264d9bdbcf8236af2823623fe2f3981d740fc3461e2787e231d97c38c28/numpy-2.4.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:40483b2f2d3ba7aad426443767ff5632ec3156ef09742b96913787d13c336471", size = 14457958, upload-time = "2025-12-20T16:17:48.017Z" },
181
- { url = "https://files.pythonhosted.org/packages/8c/d9/f9a69ae564bbc7236a35aa883319364ef5fd41f72aa320cc1cbe66148fe2/numpy-2.4.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d9e6a7664ddd9746e20b7325351fe1a8408d0a2bf9c63b5e898290ddc8f09544", size = 16398394, upload-time = "2025-12-20T16:17:50.409Z" },
182
- { url = "https://files.pythonhosted.org/packages/34/c7/39241501408dde7f885d241a98caba5421061a2c6d2b2197ac5e3aa842d8/numpy-2.4.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:ecb0019d44f4cdb50b676c5d0cb4b1eae8e15d1ed3d3e6639f986fc92b2ec52c", size = 16241044, upload-time = "2025-12-20T16:17:52.661Z" },
183
- { url = "https://files.pythonhosted.org/packages/7c/95/cae7effd90e065a95e59fe710eeee05d7328ed169776dfdd9f789e032125/numpy-2.4.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:d0ffd9e2e4441c96a9c91ec1783285d80bf835b677853fc2770a89d50c1e48ac", size = 18321772, upload-time = "2025-12-20T16:17:54.947Z" },
184
- { url = "https://files.pythonhosted.org/packages/96/df/3c6c279accd2bfb968a76298e5b276310bd55d243df4fa8ac5816d79347d/numpy-2.4.0-cp314-cp314t-win32.whl", hash = "sha256:77f0d13fa87036d7553bf81f0e1fe3ce68d14c9976c9851744e4d3e91127e95f", size = 6148320, upload-time = "2025-12-20T16:17:57.249Z" },
185
- { url = "https://files.pythonhosted.org/packages/92/8d/f23033cce252e7a75cae853d17f582e86534c46404dea1c8ee094a9d6d84/numpy-2.4.0-cp314-cp314t-win_amd64.whl", hash = "sha256:b1f5b45829ac1848893f0ddf5cb326110604d6df96cdc255b0bf9edd154104d4", size = 12623460, upload-time = "2025-12-20T16:17:58.963Z" },
186
- { url = "https://files.pythonhosted.org/packages/a4/4f/1f8475907d1a7c4ef9020edf7f39ea2422ec896849245f00688e4b268a71/numpy-2.4.0-cp314-cp314t-win_arm64.whl", hash = "sha256:23a3e9d1a6f360267e8fbb38ba5db355a6a7e9be71d7fce7ab3125e88bb646c8", size = 10661799, upload-time = "2025-12-20T16:18:01.078Z" },
187
  ]
188
 
189
  [[package]]
190
- name = "pydantic"
191
- version = "2.12.5"
192
  source = { registry = "https://pypi.org/simple" }
193
- dependencies = [
194
- { name = "annotated-types" },
195
- { name = "pydantic-core" },
196
- { name = "typing-extensions" },
197
- { name = "typing-inspection" },
198
- ]
199
- sdist = { url = "https://files.pythonhosted.org/packages/69/44/36f1a6e523abc58ae5f928898e4aca2e0ea509b5aa6f6f392a5d882be928/pydantic-2.12.5.tar.gz", hash = "sha256:4d351024c75c0f085a9febbb665ce8c0c6ec5d30e903bdb6394b7ede26aebb49", size = 821591, upload-time = "2025-11-26T15:11:46.471Z" }
200
  wheels = [
201
- { url = "https://files.pythonhosted.org/packages/5a/87/b70ad306ebb6f9b585f114d0ac2137d792b48be34d732d60e597c2f8465a/pydantic-2.12.5-py3-none-any.whl", hash = "sha256:e561593fccf61e8a20fc46dfc2dfe075b8be7d0188df33f221ad1f0139180f9d", size = 463580, upload-time = "2025-11-26T15:11:44.605Z" },
202
  ]
203
 
204
  [[package]]
205
- name = "pydantic-core"
206
- version = "2.41.5"
207
  source = { registry = "https://pypi.org/simple" }
208
- dependencies = [
209
- { name = "typing-extensions" },
210
- ]
211
- sdist = { url = "https://files.pythonhosted.org/packages/71/70/23b021c950c2addd24ec408e9ab05d59b035b39d97cdc1130e1bce647bb6/pydantic_core-2.41.5.tar.gz", hash = "sha256:08daa51ea16ad373ffd5e7606252cc32f07bc72b28284b6bc9c6df804816476e", size = 460952, upload-time = "2025-11-04T13:43:49.098Z" }
212
- wheels = [
213
- { url = "https://files.pythonhosted.org/packages/87/06/8806241ff1f70d9939f9af039c6c35f2360cf16e93c2ca76f184e76b1564/pydantic_core-2.41.5-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:941103c9be18ac8daf7b7adca8228f8ed6bb7a1849020f643b3a14d15b1924d9", size = 2120403, upload-time = "2025-11-04T13:40:25.248Z" },
214
- { url = "https://files.pythonhosted.org/packages/94/02/abfa0e0bda67faa65fef1c84971c7e45928e108fe24333c81f3bfe35d5f5/pydantic_core-2.41.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:112e305c3314f40c93998e567879e887a3160bb8689ef3d2c04b6cc62c33ac34", size = 1896206, upload-time = "2025-11-04T13:40:27.099Z" },
215
- { url = "https://files.pythonhosted.org/packages/15/df/a4c740c0943e93e6500f9eb23f4ca7ec9bf71b19e608ae5b579678c8d02f/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cbaad15cb0c90aa221d43c00e77bb33c93e8d36e0bf74760cd00e732d10a6a0", size = 1919307, upload-time = "2025-11-04T13:40:29.806Z" },
216
- { url = "https://files.pythonhosted.org/packages/9a/e3/6324802931ae1d123528988e0e86587c2072ac2e5394b4bc2bc34b61ff6e/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:03ca43e12fab6023fc79d28ca6b39b05f794ad08ec2feccc59a339b02f2b3d33", size = 2063258, upload-time = "2025-11-04T13:40:33.544Z" },
217
- { url = "https://files.pythonhosted.org/packages/c9/d4/2230d7151d4957dd79c3044ea26346c148c98fbf0ee6ebd41056f2d62ab5/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dc799088c08fa04e43144b164feb0c13f9a0bc40503f8df3e9fde58a3c0c101e", size = 2214917, upload-time = "2025-11-04T13:40:35.479Z" },
218
- { url = "https://files.pythonhosted.org/packages/e6/9f/eaac5df17a3672fef0081b6c1bb0b82b33ee89aa5cec0d7b05f52fd4a1fa/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:97aeba56665b4c3235a0e52b2c2f5ae9cd071b8a8310ad27bddb3f7fb30e9aa2", size = 2332186, upload-time = "2025-11-04T13:40:37.436Z" },
219
- { url = "https://files.pythonhosted.org/packages/cf/4e/35a80cae583a37cf15604b44240e45c05e04e86f9cfd766623149297e971/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:406bf18d345822d6c21366031003612b9c77b3e29ffdb0f612367352aab7d586", size = 2073164, upload-time = "2025-11-04T13:40:40.289Z" },
220
- { url = "https://files.pythonhosted.org/packages/bf/e3/f6e262673c6140dd3305d144d032f7bd5f7497d3871c1428521f19f9efa2/pydantic_core-2.41.5-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b93590ae81f7010dbe380cdeab6f515902ebcbefe0b9327cc4804d74e93ae69d", size = 2179146, upload-time = "2025-11-04T13:40:42.809Z" },
221
- { url = "https://files.pythonhosted.org/packages/75/c7/20bd7fc05f0c6ea2056a4565c6f36f8968c0924f19b7d97bbfea55780e73/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:01a3d0ab748ee531f4ea6c3e48ad9dac84ddba4b0d82291f87248f2f9de8d740", size = 2137788, upload-time = "2025-11-04T13:40:44.752Z" },
222
- { url = "https://files.pythonhosted.org/packages/3a/8d/34318ef985c45196e004bc46c6eab2eda437e744c124ef0dbe1ff2c9d06b/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:6561e94ba9dacc9c61bce40e2d6bdc3bfaa0259d3ff36ace3b1e6901936d2e3e", size = 2340133, upload-time = "2025-11-04T13:40:46.66Z" },
223
- { url = "https://files.pythonhosted.org/packages/9c/59/013626bf8c78a5a5d9350d12e7697d3d4de951a75565496abd40ccd46bee/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:915c3d10f81bec3a74fbd4faebe8391013ba61e5a1a8d48c4455b923bdda7858", size = 2324852, upload-time = "2025-11-04T13:40:48.575Z" },
224
- { url = "https://files.pythonhosted.org/packages/1a/d9/c248c103856f807ef70c18a4f986693a46a8ffe1602e5d361485da502d20/pydantic_core-2.41.5-cp313-cp313-win32.whl", hash = "sha256:650ae77860b45cfa6e2cdafc42618ceafab3a2d9a3811fcfbd3bbf8ac3c40d36", size = 1994679, upload-time = "2025-11-04T13:40:50.619Z" },
225
- { url = "https://files.pythonhosted.org/packages/9e/8b/341991b158ddab181cff136acd2552c9f35bd30380422a639c0671e99a91/pydantic_core-2.41.5-cp313-cp313-win_amd64.whl", hash = "sha256:79ec52ec461e99e13791ec6508c722742ad745571f234ea6255bed38c6480f11", size = 2019766, upload-time = "2025-11-04T13:40:52.631Z" },
226
- { url = "https://files.pythonhosted.org/packages/73/7d/f2f9db34af103bea3e09735bb40b021788a5e834c81eedb541991badf8f5/pydantic_core-2.41.5-cp313-cp313-win_arm64.whl", hash = "sha256:3f84d5c1b4ab906093bdc1ff10484838aca54ef08de4afa9de0f5f14d69639cd", size = 1981005, upload-time = "2025-11-04T13:40:54.734Z" },
227
- { url = "https://files.pythonhosted.org/packages/ea/28/46b7c5c9635ae96ea0fbb779e271a38129df2550f763937659ee6c5dbc65/pydantic_core-2.41.5-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:3f37a19d7ebcdd20b96485056ba9e8b304e27d9904d233d7b1015db320e51f0a", size = 2119622, upload-time = "2025-11-04T13:40:56.68Z" },
228
- { url = "https://files.pythonhosted.org/packages/74/1a/145646e5687e8d9a1e8d09acb278c8535ebe9e972e1f162ed338a622f193/pydantic_core-2.41.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1d1d9764366c73f996edd17abb6d9d7649a7eb690006ab6adbda117717099b14", size = 1891725, upload-time = "2025-11-04T13:40:58.807Z" },
229
- { url = "https://files.pythonhosted.org/packages/23/04/e89c29e267b8060b40dca97bfc64a19b2a3cf99018167ea1677d96368273/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:25e1c2af0fce638d5f1988b686f3b3ea8cd7de5f244ca147c777769e798a9cd1", size = 1915040, upload-time = "2025-11-04T13:41:00.853Z" },
230
- { url = "https://files.pythonhosted.org/packages/84/a3/15a82ac7bd97992a82257f777b3583d3e84bdb06ba6858f745daa2ec8a85/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:506d766a8727beef16b7adaeb8ee6217c64fc813646b424d0804d67c16eddb66", size = 2063691, upload-time = "2025-11-04T13:41:03.504Z" },
231
- { url = "https://files.pythonhosted.org/packages/74/9b/0046701313c6ef08c0c1cf0e028c67c770a4e1275ca73131563c5f2a310a/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4819fa52133c9aa3c387b3328f25c1facc356491e6135b459f1de698ff64d869", size = 2213897, upload-time = "2025-11-04T13:41:05.804Z" },
232
- { url = "https://files.pythonhosted.org/packages/8a/cd/6bac76ecd1b27e75a95ca3a9a559c643b3afcd2dd62086d4b7a32a18b169/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2b761d210c9ea91feda40d25b4efe82a1707da2ef62901466a42492c028553a2", size = 2333302, upload-time = "2025-11-04T13:41:07.809Z" },
233
- { url = "https://files.pythonhosted.org/packages/4c/d2/ef2074dc020dd6e109611a8be4449b98cd25e1b9b8a303c2f0fca2f2bcf7/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:22f0fb8c1c583a3b6f24df2470833b40207e907b90c928cc8d3594b76f874375", size = 2064877, upload-time = "2025-11-04T13:41:09.827Z" },
234
- { url = "https://files.pythonhosted.org/packages/18/66/e9db17a9a763d72f03de903883c057b2592c09509ccfe468187f2a2eef29/pydantic_core-2.41.5-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2782c870e99878c634505236d81e5443092fba820f0373997ff75f90f68cd553", size = 2180680, upload-time = "2025-11-04T13:41:12.379Z" },
235
- { url = "https://files.pythonhosted.org/packages/d3/9e/3ce66cebb929f3ced22be85d4c2399b8e85b622db77dad36b73c5387f8f8/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:0177272f88ab8312479336e1d777f6b124537d47f2123f89cb37e0accea97f90", size = 2138960, upload-time = "2025-11-04T13:41:14.627Z" },
236
- { url = "https://files.pythonhosted.org/packages/a6/62/205a998f4327d2079326b01abee48e502ea739d174f0a89295c481a2272e/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:63510af5e38f8955b8ee5687740d6ebf7c2a0886d15a6d65c32814613681bc07", size = 2339102, upload-time = "2025-11-04T13:41:16.868Z" },
237
- { url = "https://files.pythonhosted.org/packages/3c/0d/f05e79471e889d74d3d88f5bd20d0ed189ad94c2423d81ff8d0000aab4ff/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:e56ba91f47764cc14f1daacd723e3e82d1a89d783f0f5afe9c364b8bb491ccdb", size = 2326039, upload-time = "2025-11-04T13:41:18.934Z" },
238
- { url = "https://files.pythonhosted.org/packages/ec/e1/e08a6208bb100da7e0c4b288eed624a703f4d129bde2da475721a80cab32/pydantic_core-2.41.5-cp314-cp314-win32.whl", hash = "sha256:aec5cf2fd867b4ff45b9959f8b20ea3993fc93e63c7363fe6851424c8a7e7c23", size = 1995126, upload-time = "2025-11-04T13:41:21.418Z" },
239
- { url = "https://files.pythonhosted.org/packages/48/5d/56ba7b24e9557f99c9237e29f5c09913c81eeb2f3217e40e922353668092/pydantic_core-2.41.5-cp314-cp314-win_amd64.whl", hash = "sha256:8e7c86f27c585ef37c35e56a96363ab8de4e549a95512445b85c96d3e2f7c1bf", size = 2015489, upload-time = "2025-11-04T13:41:24.076Z" },
240
- { url = "https://files.pythonhosted.org/packages/4e/bb/f7a190991ec9e3e0ba22e4993d8755bbc4a32925c0b5b42775c03e8148f9/pydantic_core-2.41.5-cp314-cp314-win_arm64.whl", hash = "sha256:e672ba74fbc2dc8eea59fb6d4aed6845e6905fc2a8afe93175d94a83ba2a01a0", size = 1977288, upload-time = "2025-11-04T13:41:26.33Z" },
241
- { url = "https://files.pythonhosted.org/packages/92/ed/77542d0c51538e32e15afe7899d79efce4b81eee631d99850edc2f5e9349/pydantic_core-2.41.5-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:8566def80554c3faa0e65ac30ab0932b9e3a5cd7f8323764303d468e5c37595a", size = 2120255, upload-time = "2025-11-04T13:41:28.569Z" },
242
- { url = "https://files.pythonhosted.org/packages/bb/3d/6913dde84d5be21e284439676168b28d8bbba5600d838b9dca99de0fad71/pydantic_core-2.41.5-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:b80aa5095cd3109962a298ce14110ae16b8c1aece8b72f9dafe81cf597ad80b3", size = 1863760, upload-time = "2025-11-04T13:41:31.055Z" },
243
- { url = "https://files.pythonhosted.org/packages/5a/f0/e5e6b99d4191da102f2b0eb9687aaa7f5bea5d9964071a84effc3e40f997/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3006c3dd9ba34b0c094c544c6006cc79e87d8612999f1a5d43b769b89181f23c", size = 1878092, upload-time = "2025-11-04T13:41:33.21Z" },
244
- { url = "https://files.pythonhosted.org/packages/71/48/36fb760642d568925953bcc8116455513d6e34c4beaa37544118c36aba6d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:72f6c8b11857a856bcfa48c86f5368439f74453563f951e473514579d44aa612", size = 2053385, upload-time = "2025-11-04T13:41:35.508Z" },
245
- { url = "https://files.pythonhosted.org/packages/20/25/92dc684dd8eb75a234bc1c764b4210cf2646479d54b47bf46061657292a8/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5cb1b2f9742240e4bb26b652a5aeb840aa4b417c7748b6f8387927bc6e45e40d", size = 2218832, upload-time = "2025-11-04T13:41:37.732Z" },
246
- { url = "https://files.pythonhosted.org/packages/e2/09/f53e0b05023d3e30357d82eb35835d0f6340ca344720a4599cd663dca599/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bd3d54f38609ff308209bd43acea66061494157703364ae40c951f83ba99a1a9", size = 2327585, upload-time = "2025-11-04T13:41:40Z" },
247
- { url = "https://files.pythonhosted.org/packages/aa/4e/2ae1aa85d6af35a39b236b1b1641de73f5a6ac4d5a7509f77b814885760c/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2ff4321e56e879ee8d2a879501c8e469414d948f4aba74a2d4593184eb326660", size = 2041078, upload-time = "2025-11-04T13:41:42.323Z" },
248
- { url = "https://files.pythonhosted.org/packages/cd/13/2e215f17f0ef326fc72afe94776edb77525142c693767fc347ed6288728d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d0d2568a8c11bf8225044aa94409e21da0cb09dcdafe9ecd10250b2baad531a9", size = 2173914, upload-time = "2025-11-04T13:41:45.221Z" },
249
- { url = "https://files.pythonhosted.org/packages/02/7a/f999a6dcbcd0e5660bc348a3991c8915ce6599f4f2c6ac22f01d7a10816c/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:a39455728aabd58ceabb03c90e12f71fd30fa69615760a075b9fec596456ccc3", size = 2129560, upload-time = "2025-11-04T13:41:47.474Z" },
250
- { url = "https://files.pythonhosted.org/packages/3a/b1/6c990ac65e3b4c079a4fb9f5b05f5b013afa0f4ed6780a3dd236d2cbdc64/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:239edca560d05757817c13dc17c50766136d21f7cd0fac50295499ae24f90fdf", size = 2329244, upload-time = "2025-11-04T13:41:49.992Z" },
251
- { url = "https://files.pythonhosted.org/packages/d9/02/3c562f3a51afd4d88fff8dffb1771b30cfdfd79befd9883ee094f5b6c0d8/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:2a5e06546e19f24c6a96a129142a75cee553cc018ffee48a460059b1185f4470", size = 2331955, upload-time = "2025-11-04T13:41:54.079Z" },
252
- { url = "https://files.pythonhosted.org/packages/5c/96/5fb7d8c3c17bc8c62fdb031c47d77a1af698f1d7a406b0f79aaa1338f9ad/pydantic_core-2.41.5-cp314-cp314t-win32.whl", hash = "sha256:b4ececa40ac28afa90871c2cc2b9ffd2ff0bf749380fbdf57d165fd23da353aa", size = 1988906, upload-time = "2025-11-04T13:41:56.606Z" },
253
- { url = "https://files.pythonhosted.org/packages/22/ed/182129d83032702912c2e2d8bbe33c036f342cc735737064668585dac28f/pydantic_core-2.41.5-cp314-cp314t-win_amd64.whl", hash = "sha256:80aa89cad80b32a912a65332f64a4450ed00966111b6615ca6816153d3585a8c", size = 1981607, upload-time = "2025-11-04T13:41:58.889Z" },
254
- { url = "https://files.pythonhosted.org/packages/9f/ed/068e41660b832bb0b1aa5b58011dea2a3fe0ba7861ff38c4d4904c1c1a99/pydantic_core-2.41.5-cp314-cp314t-win_arm64.whl", hash = "sha256:35b44f37a3199f771c3eaa53051bc8a70cd7b54f333531c59e29fd4db5d15008", size = 1974769, upload-time = "2025-11-04T13:42:01.186Z" },
255
- ]
256
-
257
- [[package]]
258
- name = "python-dotenv"
259
- version = "1.2.1"
260
- source = { registry = "https://pypi.org/simple" }
261
- sdist = { url = "https://files.pythonhosted.org/packages/f0/26/19cadc79a718c5edbec86fd4919a6b6d3f681039a2f6d66d14be94e75fb9/python_dotenv-1.2.1.tar.gz", hash = "sha256:42667e897e16ab0d66954af0e60a9caa94f0fd4ecf3aaf6d2d260eec1aa36ad6", size = 44221, upload-time = "2025-10-26T15:12:10.434Z" }
262
  wheels = [
263
- { url = "https://files.pythonhosted.org/packages/14/1b/a298b06749107c305e1fe0f814c6c74aea7b2f1e10989cb30f544a1b3253/python_dotenv-1.2.1-py3-none-any.whl", hash = "sha256:b81ee9561e9ca4004139c6cbba3a238c32b03e4894671e181b671e8cb8425d61", size = 21230, upload-time = "2025-10-26T15:12:09.109Z" },
264
  ]
265
 
266
  [[package]]
267
- name = "pyyaml"
268
- version = "6.0.3"
269
  source = { registry = "https://pypi.org/simple" }
270
- sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" }
271
  wheels = [
272
- { url = "https://files.pythonhosted.org/packages/d1/11/0fd08f8192109f7169db964b5707a2f1e8b745d4e239b784a5a1dd80d1db/pyyaml-6.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8da9669d359f02c0b91ccc01cac4a67f16afec0dac22c2ad09f46bee0697eba8", size = 181669, upload-time = "2025-09-25T21:32:23.673Z" },
273
- { url = "https://files.pythonhosted.org/packages/b1/16/95309993f1d3748cd644e02e38b75d50cbc0d9561d21f390a76242ce073f/pyyaml-6.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2283a07e2c21a2aa78d9c4442724ec1eb15f5e42a723b99cb3d822d48f5f7ad1", size = 173252, upload-time = "2025-09-25T21:32:25.149Z" },
274
- { url = "https://files.pythonhosted.org/packages/50/31/b20f376d3f810b9b2371e72ef5adb33879b25edb7a6d072cb7ca0c486398/pyyaml-6.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee2922902c45ae8ccada2c5b501ab86c36525b883eff4255313a253a3160861c", size = 767081, upload-time = "2025-09-25T21:32:26.575Z" },
275
- { url = "https://files.pythonhosted.org/packages/49/1e/a55ca81e949270d5d4432fbbd19dfea5321eda7c41a849d443dc92fd1ff7/pyyaml-6.0.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a33284e20b78bd4a18c8c2282d549d10bc8408a2a7ff57653c0cf0b9be0afce5", size = 841159, upload-time = "2025-09-25T21:32:27.727Z" },
276
- { url = "https://files.pythonhosted.org/packages/74/27/e5b8f34d02d9995b80abcef563ea1f8b56d20134d8f4e5e81733b1feceb2/pyyaml-6.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0f29edc409a6392443abf94b9cf89ce99889a1dd5376d94316ae5145dfedd5d6", size = 801626, upload-time = "2025-09-25T21:32:28.878Z" },
277
- { url = "https://files.pythonhosted.org/packages/f9/11/ba845c23988798f40e52ba45f34849aa8a1f2d4af4b798588010792ebad6/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f7057c9a337546edc7973c0d3ba84ddcdf0daa14533c2065749c9075001090e6", size = 753613, upload-time = "2025-09-25T21:32:30.178Z" },
278
- { url = "https://files.pythonhosted.org/packages/3d/e0/7966e1a7bfc0a45bf0a7fb6b98ea03fc9b8d84fa7f2229e9659680b69ee3/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:eda16858a3cab07b80edaf74336ece1f986ba330fdb8ee0d6c0d68fe82bc96be", size = 794115, upload-time = "2025-09-25T21:32:31.353Z" },
279
- { url = "https://files.pythonhosted.org/packages/de/94/980b50a6531b3019e45ddeada0626d45fa85cbe22300844a7983285bed3b/pyyaml-6.0.3-cp313-cp313-win32.whl", hash = "sha256:d0eae10f8159e8fdad514efdc92d74fd8d682c933a6dd088030f3834bc8e6b26", size = 137427, upload-time = "2025-09-25T21:32:32.58Z" },
280
- { url = "https://files.pythonhosted.org/packages/97/c9/39d5b874e8b28845e4ec2202b5da735d0199dbe5b8fb85f91398814a9a46/pyyaml-6.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:79005a0d97d5ddabfeeea4cf676af11e647e41d81c9a7722a193022accdb6b7c", size = 154090, upload-time = "2025-09-25T21:32:33.659Z" },
281
- { url = "https://files.pythonhosted.org/packages/73/e8/2bdf3ca2090f68bb3d75b44da7bbc71843b19c9f2b9cb9b0f4ab7a5a4329/pyyaml-6.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:5498cd1645aa724a7c71c8f378eb29ebe23da2fc0d7a08071d89469bf1d2defb", size = 140246, upload-time = "2025-09-25T21:32:34.663Z" },
282
- { url = "https://files.pythonhosted.org/packages/9d/8c/f4bd7f6465179953d3ac9bc44ac1a8a3e6122cf8ada906b4f96c60172d43/pyyaml-6.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:8d1fab6bb153a416f9aeb4b8763bc0f22a5586065f86f7664fc23339fc1c1fac", size = 181814, upload-time = "2025-09-25T21:32:35.712Z" },
283
- { url = "https://files.pythonhosted.org/packages/bd/9c/4d95bb87eb2063d20db7b60faa3840c1b18025517ae857371c4dd55a6b3a/pyyaml-6.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:34d5fcd24b8445fadc33f9cf348c1047101756fd760b4dacb5c3e99755703310", size = 173809, upload-time = "2025-09-25T21:32:36.789Z" },
284
- { url = "https://files.pythonhosted.org/packages/92/b5/47e807c2623074914e29dabd16cbbdd4bf5e9b2db9f8090fa64411fc5382/pyyaml-6.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:501a031947e3a9025ed4405a168e6ef5ae3126c59f90ce0cd6f2bfc477be31b7", size = 766454, upload-time = "2025-09-25T21:32:37.966Z" },
285
- { url = "https://files.pythonhosted.org/packages/02/9e/e5e9b168be58564121efb3de6859c452fccde0ab093d8438905899a3a483/pyyaml-6.0.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b3bc83488de33889877a0f2543ade9f70c67d66d9ebb4ac959502e12de895788", size = 836355, upload-time = "2025-09-25T21:32:39.178Z" },
286
- { url = "https://files.pythonhosted.org/packages/88/f9/16491d7ed2a919954993e48aa941b200f38040928474c9e85ea9e64222c3/pyyaml-6.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c458b6d084f9b935061bc36216e8a69a7e293a2f1e68bf956dcd9e6cbcd143f5", size = 794175, upload-time = "2025-09-25T21:32:40.865Z" },
287
- { url = "https://files.pythonhosted.org/packages/dd/3f/5989debef34dc6397317802b527dbbafb2b4760878a53d4166579111411e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7c6610def4f163542a622a73fb39f534f8c101d690126992300bf3207eab9764", size = 755228, upload-time = "2025-09-25T21:32:42.084Z" },
288
- { url = "https://files.pythonhosted.org/packages/d7/ce/af88a49043cd2e265be63d083fc75b27b6ed062f5f9fd6cdc223ad62f03e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5190d403f121660ce8d1d2c1bb2ef1bd05b5f68533fc5c2ea899bd15f4399b35", size = 789194, upload-time = "2025-09-25T21:32:43.362Z" },
289
- { url = "https://files.pythonhosted.org/packages/23/20/bb6982b26a40bb43951265ba29d4c246ef0ff59c9fdcdf0ed04e0687de4d/pyyaml-6.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:4a2e8cebe2ff6ab7d1050ecd59c25d4c8bd7e6f400f5f82b96557ac0abafd0ac", size = 156429, upload-time = "2025-09-25T21:32:57.844Z" },
290
- { url = "https://files.pythonhosted.org/packages/f4/f4/a4541072bb9422c8a883ab55255f918fa378ecf083f5b85e87fc2b4eda1b/pyyaml-6.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:93dda82c9c22deb0a405ea4dc5f2d0cda384168e466364dec6255b293923b2f3", size = 143912, upload-time = "2025-09-25T21:32:59.247Z" },
291
- { url = "https://files.pythonhosted.org/packages/7c/f9/07dd09ae774e4616edf6cda684ee78f97777bdd15847253637a6f052a62f/pyyaml-6.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:02893d100e99e03eda1c8fd5c441d8c60103fd175728e23e431db1b589cf5ab3", size = 189108, upload-time = "2025-09-25T21:32:44.377Z" },
292
- { url = "https://files.pythonhosted.org/packages/4e/78/8d08c9fb7ce09ad8c38ad533c1191cf27f7ae1effe5bb9400a46d9437fcf/pyyaml-6.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c1ff362665ae507275af2853520967820d9124984e0f7466736aea23d8611fba", size = 183641, upload-time = "2025-09-25T21:32:45.407Z" },
293
- { url = "https://files.pythonhosted.org/packages/7b/5b/3babb19104a46945cf816d047db2788bcaf8c94527a805610b0289a01c6b/pyyaml-6.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6adc77889b628398debc7b65c073bcb99c4a0237b248cacaf3fe8a557563ef6c", size = 831901, upload-time = "2025-09-25T21:32:48.83Z" },
294
- { url = "https://files.pythonhosted.org/packages/8b/cc/dff0684d8dc44da4d22a13f35f073d558c268780ce3c6ba1b87055bb0b87/pyyaml-6.0.3-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a80cb027f6b349846a3bf6d73b5e95e782175e52f22108cfa17876aaeff93702", size = 861132, upload-time = "2025-09-25T21:32:50.149Z" },
295
- { url = "https://files.pythonhosted.org/packages/b1/5e/f77dc6b9036943e285ba76b49e118d9ea929885becb0a29ba8a7c75e29fe/pyyaml-6.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c", size = 839261, upload-time = "2025-09-25T21:32:51.808Z" },
296
- { url = "https://files.pythonhosted.org/packages/ce/88/a9db1376aa2a228197c58b37302f284b5617f56a5d959fd1763fb1675ce6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:66e1674c3ef6f541c35191caae2d429b967b99e02040f5ba928632d9a7f0f065", size = 805272, upload-time = "2025-09-25T21:32:52.941Z" },
297
- { url = "https://files.pythonhosted.org/packages/da/92/1446574745d74df0c92e6aa4a7b0b3130706a4142b2d1a5869f2eaa423c6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:16249ee61e95f858e83976573de0f5b2893b3677ba71c9dd36b9cf8be9ac6d65", size = 829923, upload-time = "2025-09-25T21:32:54.537Z" },
298
- { url = "https://files.pythonhosted.org/packages/f0/7a/1c7270340330e575b92f397352af856a8c06f230aa3e76f86b39d01b416a/pyyaml-6.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4ad1906908f2f5ae4e5a8ddfce73c320c2a1429ec52eafd27138b7f1cbe341c9", size = 174062, upload-time = "2025-09-25T21:32:55.767Z" },
299
- { url = "https://files.pythonhosted.org/packages/f1/12/de94a39c2ef588c7e6455cfbe7343d3b2dc9d6b6b2f40c4c6565744c873d/pyyaml-6.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b", size = 149341, upload-time = "2025-09-25T21:32:56.828Z" },
300
  ]
301
 
302
  [[package]]
303
- name = "starlette"
304
- version = "0.50.0"
305
  source = { registry = "https://pypi.org/simple" }
306
  dependencies = [
307
- { name = "anyio" },
 
 
 
 
308
  ]
309
- sdist = { url = "https://files.pythonhosted.org/packages/ba/b8/73a0e6a6e079a9d9cfa64113d771e421640b6f679a52eeb9b32f72d871a1/starlette-0.50.0.tar.gz", hash = "sha256:a2a17b22203254bcbc2e1f926d2d55f3f9497f769416b3190768befe598fa3ca", size = 2646985, upload-time = "2025-11-01T15:25:27.516Z" }
310
  wheels = [
311
- { url = "https://files.pythonhosted.org/packages/d9/52/1064f510b141bd54025f9b55105e26d1fa970b9be67ad766380a3c9b74b0/starlette-0.50.0-py3-none-any.whl", hash = "sha256:9e5391843ec9b6e472eed1365a78c8098cfceb7a74bfd4d6b1c0c0095efb3bca", size = 74033, upload-time = "2025-11-01T15:25:25.461Z" },
312
  ]
313
 
314
  [[package]]
315
  name = "sympy"
316
- version = "1.14.0"
317
  source = { registry = "https://pypi.org/simple" }
318
  dependencies = [
319
  { name = "mpmath" },
320
  ]
321
- sdist = { url = "https://files.pythonhosted.org/packages/83/d3/803453b36afefb7c2bb238361cd4ae6125a569b4db67cd9e79846ba2d68c/sympy-1.14.0.tar.gz", hash = "sha256:d3d3fe8df1e5a0b42f0e7bdf50541697dbe7d23746e894990c030e2b05e72517", size = 7793921, upload-time = "2025-04-27T18:05:01.611Z" }
322
- wheels = [
323
- { url = "https://files.pythonhosted.org/packages/a2/09/77d55d46fd61b4a135c444fc97158ef34a095e5681d0a6c10b75bf356191/sympy-1.14.0-py3-none-any.whl", hash = "sha256:e091cc3e99d2141a0ba2847328f5479b05d94a6635cb96148ccb3f34671bd8f5", size = 6299353, upload-time = "2025-04-27T18:04:59.103Z" },
324
- ]
325
-
326
- [[package]]
327
- name = "typing-extensions"
328
- version = "4.15.0"
329
- source = { registry = "https://pypi.org/simple" }
330
- sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" }
331
- wheels = [
332
- { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" },
333
- ]
334
-
335
- [[package]]
336
- name = "typing-inspection"
337
- version = "0.4.2"
338
- source = { registry = "https://pypi.org/simple" }
339
- dependencies = [
340
- { name = "typing-extensions" },
341
- ]
342
- sdist = { url = "https://files.pythonhosted.org/packages/55/e3/70399cb7dd41c10ac53367ae42139cf4b1ca5f36bb3dc6c9d33acdb43655/typing_inspection-0.4.2.tar.gz", hash = "sha256:ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464", size = 75949, upload-time = "2025-10-01T02:14:41.687Z" }
343
- wheels = [
344
- { url = "https://files.pythonhosted.org/packages/dc/9b/47798a6c91d8bdb567fe2698fe81e0c6b7cb7ef4d13da4114b41d239f65d/typing_inspection-0.4.2-py3-none-any.whl", hash = "sha256:4ed1cacbdc298c220f1bd249ed5287caa16f34d44ef4e9c3d0cbad5b521545e7", size = 14611, upload-time = "2025-10-01T02:14:40.154Z" },
345
- ]
346
-
347
- [[package]]
348
- name = "uvicorn"
349
- version = "0.40.0"
350
- source = { registry = "https://pypi.org/simple" }
351
- dependencies = [
352
- { name = "click" },
353
- { name = "h11" },
354
- ]
355
- sdist = { url = "https://files.pythonhosted.org/packages/c3/d1/8f3c683c9561a4e6689dd3b1d345c815f10f86acd044ee1fb9a4dcd0b8c5/uvicorn-0.40.0.tar.gz", hash = "sha256:839676675e87e73694518b5574fd0f24c9d97b46bea16df7b8c05ea1a51071ea", size = 81761, upload-time = "2025-12-21T14:16:22.45Z" }
356
- wheels = [
357
- { url = "https://files.pythonhosted.org/packages/3d/d8/2083a1daa7439a66f3a48589a57d576aa117726762618f6bb09fe3798796/uvicorn-0.40.0-py3-none-any.whl", hash = "sha256:c6c8f55bc8bf13eb6fa9ff87ad62308bbbc33d0b67f84293151efe87e0d5f2ee", size = 68502, upload-time = "2025-12-21T14:16:21.041Z" },
358
- ]
359
-
360
- [package.optional-dependencies]
361
- standard = [
362
- { name = "colorama", marker = "sys_platform == 'win32'" },
363
- { name = "httptools" },
364
- { name = "python-dotenv" },
365
- { name = "pyyaml" },
366
- { name = "uvloop", marker = "platform_python_implementation != 'PyPy' and sys_platform != 'cygwin' and sys_platform != 'win32'" },
367
- { name = "watchfiles" },
368
- { name = "websockets" },
369
- ]
370
-
371
- [[package]]
372
- name = "uvloop"
373
- version = "0.22.1"
374
- source = { registry = "https://pypi.org/simple" }
375
- sdist = { url = "https://files.pythonhosted.org/packages/06/f0/18d39dbd1971d6d62c4629cc7fa67f74821b0dc1f5a77af43719de7936a7/uvloop-0.22.1.tar.gz", hash = "sha256:6c84bae345b9147082b17371e3dd5d42775bddce91f885499017f4607fdaf39f", size = 2443250, upload-time = "2025-10-16T22:17:19.342Z" }
376
- wheels = [
377
- { url = "https://files.pythonhosted.org/packages/89/8c/182a2a593195bfd39842ea68ebc084e20c850806117213f5a299dfc513d9/uvloop-0.22.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:561577354eb94200d75aca23fbde86ee11be36b00e52a4eaf8f50fb0c86b7705", size = 1358611, upload-time = "2025-10-16T22:16:36.833Z" },
378
- { url = "https://files.pythonhosted.org/packages/d2/14/e301ee96a6dc95224b6f1162cd3312f6d1217be3907b79173b06785f2fe7/uvloop-0.22.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:1cdf5192ab3e674ca26da2eada35b288d2fa49fdd0f357a19f0e7c4e7d5077c8", size = 751811, upload-time = "2025-10-16T22:16:38.275Z" },
379
- { url = "https://files.pythonhosted.org/packages/b7/02/654426ce265ac19e2980bfd9ea6590ca96a56f10c76e63801a2df01c0486/uvloop-0.22.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6e2ea3d6190a2968f4a14a23019d3b16870dd2190cd69c8180f7c632d21de68d", size = 4288562, upload-time = "2025-10-16T22:16:39.375Z" },
380
- { url = "https://files.pythonhosted.org/packages/15/c0/0be24758891ef825f2065cd5db8741aaddabe3e248ee6acc5e8a80f04005/uvloop-0.22.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0530a5fbad9c9e4ee3f2b33b148c6a64d47bbad8000ea63704fa8260f4cf728e", size = 4366890, upload-time = "2025-10-16T22:16:40.547Z" },
381
- { url = "https://files.pythonhosted.org/packages/d2/53/8369e5219a5855869bcee5f4d317f6da0e2c669aecf0ef7d371e3d084449/uvloop-0.22.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:bc5ef13bbc10b5335792360623cc378d52d7e62c2de64660616478c32cd0598e", size = 4119472, upload-time = "2025-10-16T22:16:41.694Z" },
382
- { url = "https://files.pythonhosted.org/packages/f8/ba/d69adbe699b768f6b29a5eec7b47dd610bd17a69de51b251126a801369ea/uvloop-0.22.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:1f38ec5e3f18c8a10ded09742f7fb8de0108796eb673f30ce7762ce1b8550cad", size = 4239051, upload-time = "2025-10-16T22:16:43.224Z" },
383
- { url = "https://files.pythonhosted.org/packages/90/cd/b62bdeaa429758aee8de8b00ac0dd26593a9de93d302bff3d21439e9791d/uvloop-0.22.1-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:3879b88423ec7e97cd4eba2a443aa26ed4e59b45e6b76aabf13fe2f27023a142", size = 1362067, upload-time = "2025-10-16T22:16:44.503Z" },
384
- { url = "https://files.pythonhosted.org/packages/0d/f8/a132124dfda0777e489ca86732e85e69afcd1ff7686647000050ba670689/uvloop-0.22.1-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:4baa86acedf1d62115c1dc6ad1e17134476688f08c6efd8a2ab076e815665c74", size = 752423, upload-time = "2025-10-16T22:16:45.968Z" },
385
- { url = "https://files.pythonhosted.org/packages/a3/94/94af78c156f88da4b3a733773ad5ba0b164393e357cc4bd0ab2e2677a7d6/uvloop-0.22.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:297c27d8003520596236bdb2335e6b3f649480bd09e00d1e3a99144b691d2a35", size = 4272437, upload-time = "2025-10-16T22:16:47.451Z" },
386
- { url = "https://files.pythonhosted.org/packages/b5/35/60249e9fd07b32c665192cec7af29e06c7cd96fa1d08b84f012a56a0b38e/uvloop-0.22.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c1955d5a1dd43198244d47664a5858082a3239766a839b2102a269aaff7a4e25", size = 4292101, upload-time = "2025-10-16T22:16:49.318Z" },
387
- { url = "https://files.pythonhosted.org/packages/02/62/67d382dfcb25d0a98ce73c11ed1a6fba5037a1a1d533dcbb7cab033a2636/uvloop-0.22.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:b31dc2fccbd42adc73bc4e7cdbae4fc5086cf378979e53ca5d0301838c5682c6", size = 4114158, upload-time = "2025-10-16T22:16:50.517Z" },
388
- { url = "https://files.pythonhosted.org/packages/f0/7a/f1171b4a882a5d13c8b7576f348acfe6074d72eaf52cccef752f748d4a9f/uvloop-0.22.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:93f617675b2d03af4e72a5333ef89450dfaa5321303ede6e67ba9c9d26878079", size = 4177360, upload-time = "2025-10-16T22:16:52.646Z" },
389
- { url = "https://files.pythonhosted.org/packages/79/7b/b01414f31546caf0919da80ad57cbfe24c56b151d12af68cee1b04922ca8/uvloop-0.22.1-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:37554f70528f60cad66945b885eb01f1bb514f132d92b6eeed1c90fd54ed6289", size = 1454790, upload-time = "2025-10-16T22:16:54.355Z" },
390
- { url = "https://files.pythonhosted.org/packages/d4/31/0bb232318dd838cad3fa8fb0c68c8b40e1145b32025581975e18b11fab40/uvloop-0.22.1-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:b76324e2dc033a0b2f435f33eb88ff9913c156ef78e153fb210e03c13da746b3", size = 796783, upload-time = "2025-10-16T22:16:55.906Z" },
391
- { url = "https://files.pythonhosted.org/packages/42/38/c9b09f3271a7a723a5de69f8e237ab8e7803183131bc57c890db0b6bb872/uvloop-0.22.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:badb4d8e58ee08dad957002027830d5c3b06aea446a6a3744483c2b3b745345c", size = 4647548, upload-time = "2025-10-16T22:16:57.008Z" },
392
- { url = "https://files.pythonhosted.org/packages/c1/37/945b4ca0ac27e3dc4952642d4c900edd030b3da6c9634875af6e13ae80e5/uvloop-0.22.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b91328c72635f6f9e0282e4a57da7470c7350ab1c9f48546c0f2866205349d21", size = 4467065, upload-time = "2025-10-16T22:16:58.206Z" },
393
- { url = "https://files.pythonhosted.org/packages/97/cc/48d232f33d60e2e2e0b42f4e73455b146b76ebe216487e862700457fbf3c/uvloop-0.22.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:daf620c2995d193449393d6c62131b3fbd40a63bf7b307a1527856ace637fe88", size = 4328384, upload-time = "2025-10-16T22:16:59.36Z" },
394
- { url = "https://files.pythonhosted.org/packages/e4/16/c1fd27e9549f3c4baf1dc9c20c456cd2f822dbf8de9f463824b0c0357e06/uvloop-0.22.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:6cde23eeda1a25c75b2e07d39970f3374105d5eafbaab2a4482be82f272d5a5e", size = 4296730, upload-time = "2025-10-16T22:17:00.744Z" },
395
- ]
396
-
397
- [[package]]
398
- name = "watchfiles"
399
- version = "1.1.1"
400
- source = { registry = "https://pypi.org/simple" }
401
- dependencies = [
402
- { name = "anyio" },
403
- ]
404
- sdist = { url = "https://files.pythonhosted.org/packages/c2/c9/8869df9b2a2d6c59d79220a4db37679e74f807c559ffe5265e08b227a210/watchfiles-1.1.1.tar.gz", hash = "sha256:a173cb5c16c4f40ab19cecf48a534c409f7ea983ab8fed0741304a1c0a31b3f2", size = 94440, upload-time = "2025-10-14T15:06:21.08Z" }
405
- wheels = [
406
- { url = "https://files.pythonhosted.org/packages/bb/f4/f750b29225fe77139f7ae5de89d4949f5a99f934c65a1f1c0b248f26f747/watchfiles-1.1.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:130e4876309e8686a5e37dba7d5e9bc77e6ed908266996ca26572437a5271e18", size = 404321, upload-time = "2025-10-14T15:05:02.063Z" },
407
- { url = "https://files.pythonhosted.org/packages/2b/f9/f07a295cde762644aa4c4bb0f88921d2d141af45e735b965fb2e87858328/watchfiles-1.1.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5f3bde70f157f84ece3765b42b4a52c6ac1a50334903c6eaf765362f6ccca88a", size = 391783, upload-time = "2025-10-14T15:05:03.052Z" },
408
- { url = "https://files.pythonhosted.org/packages/bc/11/fc2502457e0bea39a5c958d86d2cb69e407a4d00b85735ca724bfa6e0d1a/watchfiles-1.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:14e0b1fe858430fc0251737ef3824c54027bedb8c37c38114488b8e131cf8219", size = 449279, upload-time = "2025-10-14T15:05:04.004Z" },
409
- { url = "https://files.pythonhosted.org/packages/e3/1f/d66bc15ea0b728df3ed96a539c777acfcad0eb78555ad9efcaa1274688f0/watchfiles-1.1.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f27db948078f3823a6bb3b465180db8ebecf26dd5dae6f6180bd87383b6b4428", size = 459405, upload-time = "2025-10-14T15:05:04.942Z" },
410
- { url = "https://files.pythonhosted.org/packages/be/90/9f4a65c0aec3ccf032703e6db02d89a157462fbb2cf20dd415128251cac0/watchfiles-1.1.1-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:059098c3a429f62fc98e8ec62b982230ef2c8df68c79e826e37b895bc359a9c0", size = 488976, upload-time = "2025-10-14T15:05:05.905Z" },
411
- { url = "https://files.pythonhosted.org/packages/37/57/ee347af605d867f712be7029bb94c8c071732a4b44792e3176fa3c612d39/watchfiles-1.1.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bfb5862016acc9b869bb57284e6cb35fdf8e22fe59f7548858e2f971d045f150", size = 595506, upload-time = "2025-10-14T15:05:06.906Z" },
412
- { url = "https://files.pythonhosted.org/packages/a8/78/cc5ab0b86c122047f75e8fc471c67a04dee395daf847d3e59381996c8707/watchfiles-1.1.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:319b27255aacd9923b8a276bb14d21a5f7ff82564c744235fc5eae58d95422ae", size = 474936, upload-time = "2025-10-14T15:05:07.906Z" },
413
- { url = "https://files.pythonhosted.org/packages/62/da/def65b170a3815af7bd40a3e7010bf6ab53089ef1b75d05dd5385b87cf08/watchfiles-1.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c755367e51db90e75b19454b680903631d41f9e3607fbd941d296a020c2d752d", size = 456147, upload-time = "2025-10-14T15:05:09.138Z" },
414
- { url = "https://files.pythonhosted.org/packages/57/99/da6573ba71166e82d288d4df0839128004c67d2778d3b566c138695f5c0b/watchfiles-1.1.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:c22c776292a23bfc7237a98f791b9ad3144b02116ff10d820829ce62dff46d0b", size = 630007, upload-time = "2025-10-14T15:05:10.117Z" },
415
- { url = "https://files.pythonhosted.org/packages/a8/51/7439c4dd39511368849eb1e53279cd3454b4a4dbace80bab88feeb83c6b5/watchfiles-1.1.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:3a476189be23c3686bc2f4321dd501cb329c0a0469e77b7b534ee10129ae6374", size = 622280, upload-time = "2025-10-14T15:05:11.146Z" },
416
- { url = "https://files.pythonhosted.org/packages/95/9c/8ed97d4bba5db6fdcdb2b298d3898f2dd5c20f6b73aee04eabe56c59677e/watchfiles-1.1.1-cp313-cp313-win32.whl", hash = "sha256:bf0a91bfb5574a2f7fc223cf95eeea79abfefa404bf1ea5e339c0c1560ae99a0", size = 272056, upload-time = "2025-10-14T15:05:12.156Z" },
417
- { url = "https://files.pythonhosted.org/packages/1f/f3/c14e28429f744a260d8ceae18bf58c1d5fa56b50d006a7a9f80e1882cb0d/watchfiles-1.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:52e06553899e11e8074503c8e716d574adeeb7e68913115c4b3653c53f9bae42", size = 288162, upload-time = "2025-10-14T15:05:13.208Z" },
418
- { url = "https://files.pythonhosted.org/packages/dc/61/fe0e56c40d5cd29523e398d31153218718c5786b5e636d9ae8ae79453d27/watchfiles-1.1.1-cp313-cp313-win_arm64.whl", hash = "sha256:ac3cc5759570cd02662b15fbcd9d917f7ecd47efe0d6b40474eafd246f91ea18", size = 277909, upload-time = "2025-10-14T15:05:14.49Z" },
419
- { url = "https://files.pythonhosted.org/packages/79/42/e0a7d749626f1e28c7108a99fb9bf524b501bbbeb9b261ceecde644d5a07/watchfiles-1.1.1-cp313-cp313t-macosx_10_12_x86_64.whl", hash = "sha256:563b116874a9a7ce6f96f87cd0b94f7faf92d08d0021e837796f0a14318ef8da", size = 403389, upload-time = "2025-10-14T15:05:15.777Z" },
420
- { url = "https://files.pythonhosted.org/packages/15/49/08732f90ce0fbbc13913f9f215c689cfc9ced345fb1bcd8829a50007cc8d/watchfiles-1.1.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:3ad9fe1dae4ab4212d8c91e80b832425e24f421703b5a42ef2e4a1e215aff051", size = 389964, upload-time = "2025-10-14T15:05:16.85Z" },
421
- { url = "https://files.pythonhosted.org/packages/27/0d/7c315d4bd5f2538910491a0393c56bf70d333d51bc5b34bee8e68e8cea19/watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ce70f96a46b894b36eba678f153f052967a0d06d5b5a19b336ab0dbbd029f73e", size = 448114, upload-time = "2025-10-14T15:05:17.876Z" },
422
- { url = "https://files.pythonhosted.org/packages/c3/24/9e096de47a4d11bc4df41e9d1e61776393eac4cb6eb11b3e23315b78b2cc/watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cb467c999c2eff23a6417e58d75e5828716f42ed8289fe6b77a7e5a91036ca70", size = 460264, upload-time = "2025-10-14T15:05:18.962Z" },
423
- { url = "https://files.pythonhosted.org/packages/cc/0f/e8dea6375f1d3ba5fcb0b3583e2b493e77379834c74fd5a22d66d85d6540/watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:836398932192dae4146c8f6f737d74baeac8b70ce14831a239bdb1ca882fc261", size = 487877, upload-time = "2025-10-14T15:05:20.094Z" },
424
- { url = "https://files.pythonhosted.org/packages/ac/5b/df24cfc6424a12deb41503b64d42fbea6b8cb357ec62ca84a5a3476f654a/watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:743185e7372b7bc7c389e1badcc606931a827112fbbd37f14c537320fca08620", size = 595176, upload-time = "2025-10-14T15:05:21.134Z" },
425
- { url = "https://files.pythonhosted.org/packages/8f/b5/853b6757f7347de4e9b37e8cc3289283fb983cba1ab4d2d7144694871d9c/watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:afaeff7696e0ad9f02cbb8f56365ff4686ab205fcf9c4c5b6fdfaaa16549dd04", size = 473577, upload-time = "2025-10-14T15:05:22.306Z" },
426
- { url = "https://files.pythonhosted.org/packages/e1/f7/0a4467be0a56e80447c8529c9fce5b38eab4f513cb3d9bf82e7392a5696b/watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3f7eb7da0eb23aa2ba036d4f616d46906013a68caf61b7fdbe42fc8b25132e77", size = 455425, upload-time = "2025-10-14T15:05:23.348Z" },
427
- { url = "https://files.pythonhosted.org/packages/8e/e0/82583485ea00137ddf69bc84a2db88bd92ab4a6e3c405e5fb878ead8d0e7/watchfiles-1.1.1-cp313-cp313t-musllinux_1_1_aarch64.whl", hash = "sha256:831a62658609f0e5c64178211c942ace999517f5770fe9436be4c2faeba0c0ef", size = 628826, upload-time = "2025-10-14T15:05:24.398Z" },
428
- { url = "https://files.pythonhosted.org/packages/28/9a/a785356fccf9fae84c0cc90570f11702ae9571036fb25932f1242c82191c/watchfiles-1.1.1-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:f9a2ae5c91cecc9edd47e041a930490c31c3afb1f5e6d71de3dc671bfaca02bf", size = 622208, upload-time = "2025-10-14T15:05:25.45Z" },
429
- { url = "https://files.pythonhosted.org/packages/c3/f4/0872229324ef69b2c3edec35e84bd57a1289e7d3fe74588048ed8947a323/watchfiles-1.1.1-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:d1715143123baeeaeadec0528bb7441103979a1d5f6fd0e1f915383fea7ea6d5", size = 404315, upload-time = "2025-10-14T15:05:26.501Z" },
430
- { url = "https://files.pythonhosted.org/packages/7b/22/16d5331eaed1cb107b873f6ae1b69e9ced582fcf0c59a50cd84f403b1c32/watchfiles-1.1.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:39574d6370c4579d7f5d0ad940ce5b20db0e4117444e39b6d8f99db5676c52fd", size = 390869, upload-time = "2025-10-14T15:05:27.649Z" },
431
- { url = "https://files.pythonhosted.org/packages/b2/7e/5643bfff5acb6539b18483128fdc0ef2cccc94a5b8fbda130c823e8ed636/watchfiles-1.1.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7365b92c2e69ee952902e8f70f3ba6360d0d596d9299d55d7d386df84b6941fb", size = 449919, upload-time = "2025-10-14T15:05:28.701Z" },
432
- { url = "https://files.pythonhosted.org/packages/51/2e/c410993ba5025a9f9357c376f48976ef0e1b1aefb73b97a5ae01a5972755/watchfiles-1.1.1-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bfff9740c69c0e4ed32416f013f3c45e2ae42ccedd1167ef2d805c000b6c71a5", size = 460845, upload-time = "2025-10-14T15:05:30.064Z" },
433
- { url = "https://files.pythonhosted.org/packages/8e/a4/2df3b404469122e8680f0fcd06079317e48db58a2da2950fb45020947734/watchfiles-1.1.1-cp314-cp314-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b27cf2eb1dda37b2089e3907d8ea92922b673c0c427886d4edc6b94d8dfe5db3", size = 489027, upload-time = "2025-10-14T15:05:31.064Z" },
434
- { url = "https://files.pythonhosted.org/packages/ea/84/4587ba5b1f267167ee715b7f66e6382cca6938e0a4b870adad93e44747e6/watchfiles-1.1.1-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:526e86aced14a65a5b0ec50827c745597c782ff46b571dbfe46192ab9e0b3c33", size = 595615, upload-time = "2025-10-14T15:05:32.074Z" },
435
- { url = "https://files.pythonhosted.org/packages/6a/0f/c6988c91d06e93cd0bb3d4a808bcf32375ca1904609835c3031799e3ecae/watchfiles-1.1.1-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:04e78dd0b6352db95507fd8cb46f39d185cf8c74e4cf1e4fbad1d3df96faf510", size = 474836, upload-time = "2025-10-14T15:05:33.209Z" },
436
- { url = "https://files.pythonhosted.org/packages/b4/36/ded8aebea91919485b7bbabbd14f5f359326cb5ec218cd67074d1e426d74/watchfiles-1.1.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5c85794a4cfa094714fb9c08d4a218375b2b95b8ed1666e8677c349906246c05", size = 455099, upload-time = "2025-10-14T15:05:34.189Z" },
437
- { url = "https://files.pythonhosted.org/packages/98/e0/8c9bdba88af756a2fce230dd365fab2baf927ba42cd47521ee7498fd5211/watchfiles-1.1.1-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:74d5012b7630714b66be7b7b7a78855ef7ad58e8650c73afc4c076a1f480a8d6", size = 630626, upload-time = "2025-10-14T15:05:35.216Z" },
438
- { url = "https://files.pythonhosted.org/packages/2a/84/a95db05354bf2d19e438520d92a8ca475e578c647f78f53197f5a2f17aaf/watchfiles-1.1.1-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:8fbe85cb3201c7d380d3d0b90e63d520f15d6afe217165d7f98c9c649654db81", size = 622519, upload-time = "2025-10-14T15:05:36.259Z" },
439
- { url = "https://files.pythonhosted.org/packages/1d/ce/d8acdc8de545de995c339be67711e474c77d643555a9bb74a9334252bd55/watchfiles-1.1.1-cp314-cp314-win32.whl", hash = "sha256:3fa0b59c92278b5a7800d3ee7733da9d096d4aabcfabb9a928918bd276ef9b9b", size = 272078, upload-time = "2025-10-14T15:05:37.63Z" },
440
- { url = "https://files.pythonhosted.org/packages/c4/c9/a74487f72d0451524be827e8edec251da0cc1fcf111646a511ae752e1a3d/watchfiles-1.1.1-cp314-cp314-win_amd64.whl", hash = "sha256:c2047d0b6cea13b3316bdbafbfa0c4228ae593d995030fda39089d36e64fc03a", size = 287664, upload-time = "2025-10-14T15:05:38.95Z" },
441
- { url = "https://files.pythonhosted.org/packages/df/b8/8ac000702cdd496cdce998c6f4ee0ca1f15977bba51bdf07d872ebdfc34c/watchfiles-1.1.1-cp314-cp314-win_arm64.whl", hash = "sha256:842178b126593addc05acf6fce960d28bc5fae7afbaa2c6c1b3a7b9460e5be02", size = 277154, upload-time = "2025-10-14T15:05:39.954Z" },
442
- { url = "https://files.pythonhosted.org/packages/47/a8/e3af2184707c29f0f14b1963c0aace6529f9d1b8582d5b99f31bbf42f59e/watchfiles-1.1.1-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:88863fbbc1a7312972f1c511f202eb30866370ebb8493aef2812b9ff28156a21", size = 403820, upload-time = "2025-10-14T15:05:40.932Z" },
443
- { url = "https://files.pythonhosted.org/packages/c0/ec/e47e307c2f4bd75f9f9e8afbe3876679b18e1bcec449beca132a1c5ffb2d/watchfiles-1.1.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:55c7475190662e202c08c6c0f4d9e345a29367438cf8e8037f3155e10a88d5a5", size = 390510, upload-time = "2025-10-14T15:05:41.945Z" },
444
- { url = "https://files.pythonhosted.org/packages/d5/a0/ad235642118090f66e7b2f18fd5c42082418404a79205cdfca50b6309c13/watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3f53fa183d53a1d7a8852277c92b967ae99c2d4dcee2bfacff8868e6e30b15f7", size = 448408, upload-time = "2025-10-14T15:05:43.385Z" },
445
- { url = "https://files.pythonhosted.org/packages/df/85/97fa10fd5ff3332ae17e7e40e20784e419e28521549780869f1413742e9d/watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:6aae418a8b323732fa89721d86f39ec8f092fc2af67f4217a2b07fd3e93c6101", size = 458968, upload-time = "2025-10-14T15:05:44.404Z" },
446
- { url = "https://files.pythonhosted.org/packages/47/c2/9059c2e8966ea5ce678166617a7f75ecba6164375f3b288e50a40dc6d489/watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f096076119da54a6080e8920cbdaac3dbee667eb91dcc5e5b78840b87415bd44", size = 488096, upload-time = "2025-10-14T15:05:45.398Z" },
447
- { url = "https://files.pythonhosted.org/packages/94/44/d90a9ec8ac309bc26db808a13e7bfc0e4e78b6fc051078a554e132e80160/watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:00485f441d183717038ed2e887a7c868154f216877653121068107b227a2f64c", size = 596040, upload-time = "2025-10-14T15:05:46.502Z" },
448
- { url = "https://files.pythonhosted.org/packages/95/68/4e3479b20ca305cfc561db3ed207a8a1c745ee32bf24f2026a129d0ddb6e/watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a55f3e9e493158d7bfdb60a1165035f1cf7d320914e7b7ea83fe22c6023b58fc", size = 473847, upload-time = "2025-10-14T15:05:47.484Z" },
449
- { url = "https://files.pythonhosted.org/packages/4f/55/2af26693fd15165c4ff7857e38330e1b61ab8c37d15dc79118cdba115b7a/watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c91ed27800188c2ae96d16e3149f199d62f86c7af5f5f4d2c61a3ed8cd3666c", size = 455072, upload-time = "2025-10-14T15:05:48.928Z" },
450
- { url = "https://files.pythonhosted.org/packages/66/1d/d0d200b10c9311ec25d2273f8aad8c3ef7cc7ea11808022501811208a750/watchfiles-1.1.1-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:311ff15a0bae3714ffb603e6ba6dbfba4065ab60865d15a6ec544133bdb21099", size = 629104, upload-time = "2025-10-14T15:05:49.908Z" },
451
- { url = "https://files.pythonhosted.org/packages/e3/bd/fa9bb053192491b3867ba07d2343d9f2252e00811567d30ae8d0f78136fe/watchfiles-1.1.1-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:a916a2932da8f8ab582f242c065f5c81bed3462849ca79ee357dd9551b0e9b01", size = 622112, upload-time = "2025-10-14T15:05:50.941Z" },
452
- ]
453
-
454
- [[package]]
455
- name = "websockets"
456
- version = "15.0.1"
457
- source = { registry = "https://pypi.org/simple" }
458
- sdist = { url = "https://files.pythonhosted.org/packages/21/e6/26d09fab466b7ca9c7737474c52be4f76a40301b08362eb2dbc19dcc16c1/websockets-15.0.1.tar.gz", hash = "sha256:82544de02076bafba038ce055ee6412d68da13ab47f0c60cab827346de828dee", size = 177016, upload-time = "2025-03-05T20:03:41.606Z" }
459
  wheels = [
460
- { url = "https://files.pythonhosted.org/packages/cb/9f/51f0cf64471a9d2b4d0fc6c534f323b664e7095640c34562f5182e5a7195/websockets-15.0.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ee443ef070bb3b6ed74514f5efaa37a252af57c90eb33b956d35c8e9c10a1931", size = 175440, upload-time = "2025-03-05T20:02:36.695Z" },
461
- { url = "https://files.pythonhosted.org/packages/8a/05/aa116ec9943c718905997412c5989f7ed671bc0188ee2ba89520e8765d7b/websockets-15.0.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5a939de6b7b4e18ca683218320fc67ea886038265fd1ed30173f5ce3f8e85675", size = 173098, upload-time = "2025-03-05T20:02:37.985Z" },
462
- { url = "https://files.pythonhosted.org/packages/ff/0b/33cef55ff24f2d92924923c99926dcce78e7bd922d649467f0eda8368923/websockets-15.0.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:746ee8dba912cd6fc889a8147168991d50ed70447bf18bcda7039f7d2e3d9151", size = 173329, upload-time = "2025-03-05T20:02:39.298Z" },
463
- { url = "https://files.pythonhosted.org/packages/31/1d/063b25dcc01faa8fada1469bdf769de3768b7044eac9d41f734fd7b6ad6d/websockets-15.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:595b6c3969023ecf9041b2936ac3827e4623bfa3ccf007575f04c5a6aa318c22", size = 183111, upload-time = "2025-03-05T20:02:40.595Z" },
464
- { url = "https://files.pythonhosted.org/packages/93/53/9a87ee494a51bf63e4ec9241c1ccc4f7c2f45fff85d5bde2ff74fcb68b9e/websockets-15.0.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3c714d2fc58b5ca3e285461a4cc0c9a66bd0e24c5da9911e30158286c9b5be7f", size = 182054, upload-time = "2025-03-05T20:02:41.926Z" },
465
- { url = "https://files.pythonhosted.org/packages/ff/b2/83a6ddf56cdcbad4e3d841fcc55d6ba7d19aeb89c50f24dd7e859ec0805f/websockets-15.0.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0f3c1e2ab208db911594ae5b4f79addeb3501604a165019dd221c0bdcabe4db8", size = 182496, upload-time = "2025-03-05T20:02:43.304Z" },
466
- { url = "https://files.pythonhosted.org/packages/98/41/e7038944ed0abf34c45aa4635ba28136f06052e08fc2168520bb8b25149f/websockets-15.0.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:229cf1d3ca6c1804400b0a9790dc66528e08a6a1feec0d5040e8b9eb14422375", size = 182829, upload-time = "2025-03-05T20:02:48.812Z" },
467
- { url = "https://files.pythonhosted.org/packages/e0/17/de15b6158680c7623c6ef0db361da965ab25d813ae54fcfeae2e5b9ef910/websockets-15.0.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:756c56e867a90fb00177d530dca4b097dd753cde348448a1012ed6c5131f8b7d", size = 182217, upload-time = "2025-03-05T20:02:50.14Z" },
468
- { url = "https://files.pythonhosted.org/packages/33/2b/1f168cb6041853eef0362fb9554c3824367c5560cbdaad89ac40f8c2edfc/websockets-15.0.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:558d023b3df0bffe50a04e710bc87742de35060580a293c2a984299ed83bc4e4", size = 182195, upload-time = "2025-03-05T20:02:51.561Z" },
469
- { url = "https://files.pythonhosted.org/packages/86/eb/20b6cdf273913d0ad05a6a14aed4b9a85591c18a987a3d47f20fa13dcc47/websockets-15.0.1-cp313-cp313-win32.whl", hash = "sha256:ba9e56e8ceeeedb2e080147ba85ffcd5cd0711b89576b83784d8605a7df455fa", size = 176393, upload-time = "2025-03-05T20:02:53.814Z" },
470
- { url = "https://files.pythonhosted.org/packages/1b/6c/c65773d6cab416a64d191d6ee8a8b1c68a09970ea6909d16965d26bfed1e/websockets-15.0.1-cp313-cp313-win_amd64.whl", hash = "sha256:e09473f095a819042ecb2ab9465aee615bd9c2028e4ef7d933600a8401c79561", size = 176837, upload-time = "2025-03-05T20:02:55.237Z" },
471
- { url = "https://files.pythonhosted.org/packages/fa/a8/5b41e0da817d64113292ab1f8247140aac61cbf6cfd085d6a0fa77f4984f/websockets-15.0.1-py3-none-any.whl", hash = "sha256:f7a866fbc1e97b5c617ee4116daaa09b722101d4a3c170c787450ba409f9736f", size = 169743, upload-time = "2025-03-05T20:03:39.41Z" },
472
  ]
 
1
  version = 1
2
+ revision = 5
3
+ requires-python = "==3.12.*"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
  [[package]]
6
  name = "backend"
7
  version = "0.1.0"
8
  source = { virtual = "." }
9
  dependencies = [
10
+ { name = "mpmath" },
11
  { name = "numpy" },
12
  { name = "sympy" },
13
+ ]
14
+
15
+ [package.dev-dependencies]
16
+ dev = [
17
+ { name = "pytest" },
18
  ]
19
 
20
  [package.metadata]
21
  requires-dist = [
22
+ { name = "mpmath", specifier = "==1.3.0" },
23
+ { name = "numpy", specifier = "==1.26.4" },
24
+ { name = "sympy", specifier = "==1.12" },
 
25
  ]
26
 
27
+ [package.metadata.requires-dev]
28
+ dev = [{ name = "pytest", specifier = ">=9.2.0" }]
 
 
 
 
 
 
 
 
 
29
 
30
  [[package]]
31
  name = "colorama"
 
37
  ]
38
 
39
  [[package]]
40
+ name = "iniconfig"
41
+ version = "2.3.1"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  source = { registry = "https://pypi.org/simple" }
43
+ sdist = { url = "https://files.pythonhosted.org/packages/01/e1/2069291243c926a2ff1cd706c7f3eeb9b62144bf60f77c9fb9ff2fb26bd3/iniconfig-2.3.1.tar.gz", hash = "sha256:67f4b9c50da0dedf52af349e7749a80a9057a5031199791b906c3bb3ae878960", size = 21209, upload-time = "2026-10-06T22:48:38.076Z" }
44
  wheels = [
45
+ { url = "https://files.pythonhosted.org/packages/56/43/4ca9e49d27a1fcf6bece6f6aec0ea46bb9112489b93d4b688fb415457bdb/iniconfig-2.3.1-py3-none-any.whl", hash = "sha256:9121e2c1fdb355232495be3194c8dfe87ccc2d5dee45947b78e68f499790d7a7", size = 7552, upload-time = "2026-10-06T22:48:36.959Z" },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  ]
47
 
48
  [[package]]
 
56
 
57
  [[package]]
58
  name = "numpy"
59
+ version = "1.26.4"
60
  source = { registry = "https://pypi.org/simple" }
61
+ sdist = { url = "https://files.pythonhosted.org/packages/65/6e/09db70a523a96d25e115e71cc56a6f9031e7b8cd166c1ac8438307c14058/numpy-1.26.4.tar.gz", hash = "sha256:2a02aba9ed12e4ac4eb3ea9421c420301a0c6460d9830d74a9df87efa4912010", size = 15786129, upload-time = "2024-02-06T00:26:44.495Z" }
62
  wheels = [
63
+ { url = "https://files.pythonhosted.org/packages/95/12/8f2020a8e8b8383ac0177dc9570aad031a3beb12e38847f7129bacd96228/numpy-1.26.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:b3ce300f3644fb06443ee2222c2201dd3a89ea6040541412b8fa189341847218", size = 20335901, upload-time = "2024-02-05T23:55:32.801Z" },
64
+ { url = "https://files.pythonhosted.org/packages/75/5b/ca6c8bd14007e5ca171c7c03102d17b4f4e0ceb53957e8c44343a9546dcc/numpy-1.26.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:03a8c78d01d9781b28a6989f6fa1bb2c4f2d51201cf99d3dd875df6fbd96b23b", size = 13685868, upload-time = "2024-02-05T23:55:56.28Z" },
65
+ { url = "https://files.pythonhosted.org/packages/79/f8/97f10e6755e2a7d027ca783f63044d5b1bc1ae7acb12afe6a9b4286eac17/numpy-1.26.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9fad7dcb1aac3c7f0584a5a8133e3a43eeb2fe127f47e3632d43d677c66c102b", size = 13925109, upload-time = "2024-02-05T23:56:20.368Z" },
66
+ { url = "https://files.pythonhosted.org/packages/0f/50/de23fde84e45f5c4fda2488c759b69990fd4512387a8632860f3ac9cd225/numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:675d61ffbfa78604709862923189bad94014bef562cc35cf61d3a07bba02a7ed", size = 17950613, upload-time = "2024-02-05T23:56:56.054Z" },
67
+ { url = "https://files.pythonhosted.org/packages/4c/0c/9c603826b6465e82591e05ca230dfc13376da512b25ccd0894709b054ed0/numpy-1.26.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:ab47dbe5cc8210f55aa58e4805fe224dac469cde56b9f731a4c098b91917159a", size = 13572172, upload-time = "2024-02-05T23:57:21.56Z" },
68
+ { url = "https://files.pythonhosted.org/packages/76/8c/2ba3902e1a0fc1c74962ea9bb33a534bb05984ad7ff9515bf8d07527cadd/numpy-1.26.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:1dda2e7b4ec9dd512f84935c5f126c8bd8b9f2fc001e9f54af255e8c5f16b0e0", size = 17786643, upload-time = "2024-02-05T23:57:56.585Z" },
69
+ { url = "https://files.pythonhosted.org/packages/28/4a/46d9e65106879492374999e76eb85f87b15328e06bd1550668f79f7b18c6/numpy-1.26.4-cp312-cp312-win32.whl", hash = "sha256:50193e430acfc1346175fcbdaa28ffec49947a06918b7b92130744e81e640110", size = 5677803, upload-time = "2024-02-05T23:58:08.963Z" },
70
+ { url = "https://files.pythonhosted.org/packages/16/2e/86f24451c2d530c88daf997cb8d6ac622c1d40d19f5a031ed68a4b73a374/numpy-1.26.4-cp312-cp312-win_amd64.whl", hash = "sha256:08beddf13648eb95f8d867350f6a018a4be2e5ad54c8d8caed89ebca558b2818", size = 15517754, upload-time = "2024-02-05T23:58:36.364Z" },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  ]
72
 
73
  [[package]]
74
+ name = "packaging"
75
+ version = "26.3"
76
  source = { registry = "https://pypi.org/simple" }
77
+ sdist = { url = "https://files.pythonhosted.org/packages/7d/fa/3944b40b07da9ce895c0e6303a5ab7d53da063554f534556b134a54d6093/packaging-26.3.tar.gz", hash = "sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79", size = 313412, upload-time = "2026-08-04T18:15:28.737Z" }
 
 
 
 
 
 
78
  wheels = [
79
+ { url = "https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl", hash = "sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c", size = 129956, upload-time = "2026-08-04T18:15:27.159Z" },
80
  ]
81
 
82
  [[package]]
83
+ name = "pluggy"
84
+ version = "1.7.0"
85
  source = { registry = "https://pypi.org/simple" }
86
+ sdist = { url = "https://files.pythonhosted.org/packages/bf/db/7fc19e6f2dc92a966727031389fc2e08b558f0f25eb7403c1119ad4713cd/pluggy-1.7.0.tar.gz", hash = "sha256:d1eaa46ebb595891b860ab086b4d09c8588af65ebd4361b8e8f4bb8920b90ba8", size = 123304, upload-time = "2026-10-15T09:50:58.343Z" }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  wheels = [
88
+ { url = "https://files.pythonhosted.org/packages/40/9e/2b38731e0fc536806f16490e1a12d7f0dc2a1235aa8cc07bcc75416a7daa/pluggy-1.7.0-py3-none-any.whl", hash = "sha256:7dd7b0d8832ba3cb632c306926ded123429211b83641b35dc5c41ad2d34f9bec", size = 27082, upload-time = "2026-10-15T09:50:56.808Z" },
89
  ]
90
 
91
  [[package]]
92
+ name = "pygments"
93
+ version = "2.21.0"
94
  source = { registry = "https://pypi.org/simple" }
95
+ sdist = { url = "https://files.pythonhosted.org/packages/49/2e/ced460408999b33da6b31b0021b0f37d329e202d4169aeb164493778f25b/pygments-2.21.0.tar.gz", hash = "sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c", size = 5005329, upload-time = "2026-08-17T08:02:48.824Z" }
96
  wheels = [
97
+ { url = "https://files.pythonhosted.org/packages/71/46/17f022dd3e953bf20a04a028a21ec746d942f8d2af30fa0f124fa0e6a684/pygments-2.21.0-py3-none-any.whl", hash = "sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9", size = 1250147, upload-time = "2026-08-17T08:02:44.912Z" },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  ]
99
 
100
  [[package]]
101
+ name = "pytest"
102
+ version = "9.2.0"
103
  source = { registry = "https://pypi.org/simple" }
104
  dependencies = [
105
+ { name = "colorama", marker = "sys_platform == 'win32'" },
106
+ { name = "iniconfig" },
107
+ { name = "packaging" },
108
+ { name = "pluggy" },
109
+ { name = "pygments" },
110
  ]
111
+ sdist = { url = "https://files.pythonhosted.org/packages/79/42/bb4641652e58dedeac2ec51abc1f8cae4fee4ec63899a0999016229a0f2a/pytest-9.2.0.tar.gz", hash = "sha256:97c4f3b1f3c7414aa36465e09b8220f1d03627993bd51b1282e193753c80557b", size = 1797555, upload-time = "2026-10-27T21:30:20.728Z" }
112
  wheels = [
113
+ { url = "https://files.pythonhosted.org/packages/51/39/1f5d8c8877a0fa327db959c19341d4be61660de1ab6b7391f9eb805bcd67/pytest-9.2.0-py3-none-any.whl", hash = "sha256:07acdcf88ec174f907dc01af70bf52d49b014bbab03faeeade31c96b18c2e588", size = 411776, upload-time = "2026-10-27T21:30:19.131Z" },
114
  ]
115
 
116
  [[package]]
117
  name = "sympy"
118
+ version = "1.12"
119
  source = { registry = "https://pypi.org/simple" }
120
  dependencies = [
121
  { name = "mpmath" },
122
  ]
123
+ sdist = { url = "https://files.pythonhosted.org/packages/e5/57/3485a1a3dff51bfd691962768b14310dae452431754bfc091250be50dd29/sympy-1.12.tar.gz", hash = "sha256:ebf595c8dac3e0fdc4152c51878b498396ec7f30e7a914d6071e674d49420fb8", size = 6722203, upload-time = "2023-05-10T18:23:00.378Z" }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  wheels = [
125
+ { url = "https://files.pythonhosted.org/packages/d2/05/e6600db80270777c4a64238a98d442f0fd07cc8915be2a1c16da7f2b9e74/sympy-1.12-py3-none-any.whl", hash = "sha256:c3588cd4295d0c0f603d0f2ae780587e64e2efeedb3521e46b9bb1d08d184fa5", size = 5742435, upload-time = "2023-05-10T18:22:14.76Z" },
 
 
 
 
 
 
 
 
 
 
 
126
  ]
dist/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 ADDED
Binary file (8.36 kB). View file
 
dist/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff ADDED
Binary file (7.2 kB). View file
 
dist/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff ADDED
Binary file (7.21 kB). View file
 
dist/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 ADDED
Binary file (8.46 kB). View file
 
dist/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff ADDED
Binary file (5.82 kB). View file
 
dist/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 ADDED
Binary file (6.91 kB). View file
 
dist/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff ADDED
Binary file (5.77 kB). View file
 
dist/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 ADDED
Binary file (6.97 kB). View file
 
dist/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff ADDED
Binary file (13.1 kB). View file
 
dist/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 ADDED
Binary file (14.7 kB). View file
 
dist/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff ADDED
Binary file (13.2 kB). View file
 
dist/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 ADDED
Binary file (14.9 kB). View file
 
dist/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 ADDED
Binary file (13.3 kB). View file
 
dist/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff ADDED
Binary file (11.8 kB). View file
 
dist/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 ADDED
Binary file (13.4 kB). View file
 
dist/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff ADDED
Binary file (11.8 kB). View file
 
dist/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 ADDED
Binary file (5.87 kB). View file
 
dist/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff ADDED
Binary file (5.62 kB). View file
 
dist/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff ADDED
Binary file (5.62 kB). View file
 
dist/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 ADDED
Binary file (6.04 kB). View file
 
dist/assets/{index-D36_PHax.js → index-B28BwTux.js} RENAMED
The diff for this file is too large to render. See raw diff
 
dist/assets/index-BO7EriOM.css ADDED
@@ -0,0 +1 @@
 
 
1
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}}@layer theme{:root,:host{--font-sans:"Instrument Sans Variable",ui-sans-serif,system-ui,sans-serif;--font-mono:"IBM Plex Mono",ui-monospace,monospace;--color-red-600:oklch(57.7% .245 27.325);--color-orange-400:oklch(75% .183 55.934);--color-blue-600:oklch(54.6% .245 262.881);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-800:oklch(27.9% .041 260.031);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-950:oklch(13% .028 261.692);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-widest:.1em;--leading-loose:2;--radius-md:.375rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-ink:#1b2a4a;--color-ink-muted:#4a5878;--color-marker:#ffe14d;--color-marker-soft:#fff3b0;--color-marker-band:var(--color-marker);--color-paper:#f6f7f3;--color-grid:#e3e7ee;--color-surface:#fff;--color-label:var(--color-gray-700);--color-line:var(--color-gray-300);--color-danger:var(--color-red-600)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}body{background-color:var(--color-paper);color:var(--color-ink)}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-full{top:100%}.left-0{left:calc(var(--spacing)*0)}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.col-span-2{grid-column:span 2/span 2}.m-0{margin:calc(var(--spacing)*0)}.m-auto{margin:auto}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-12{margin-top:calc(var(--spacing)*12)}.mr-auto{margin-right:auto}.-mb-\[1\.5px\]{margin-bottom:-1.5px}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.table{display:table}.size-3{width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-6{width:calc(var(--spacing)*6);height:calc(var(--spacing)*6)}.size-7{width:calc(var(--spacing)*7);height:calc(var(--spacing)*7)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.size-11{width:calc(var(--spacing)*11);height:calc(var(--spacing)*11)}.size-16{width:calc(var(--spacing)*16);height:calc(var(--spacing)*16)}.h-1{height:calc(var(--spacing)*1)}.h-5{height:calc(var(--spacing)*5)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-11{height:calc(var(--spacing)*11)}.h-16{height:calc(var(--spacing)*16)}.h-40{height:calc(var(--spacing)*40)}.h-px{height:1px}.max-h-60{max-height:calc(var(--spacing)*60)}.max-h-\[65dvh\]{max-height:65dvh}.max-h-\[85dvh\]{max-height:85dvh}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-9{min-height:calc(var(--spacing)*9)}.min-h-15{min-height:calc(var(--spacing)*15)}.min-h-\[320px\]{min-height:320px}.w-11{width:calc(var(--spacing)*11)}.w-14{width:calc(var(--spacing)*14)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-24{width:calc(var(--spacing)*24)}.w-28{width:calc(var(--spacing)*28)}.w-40{width:calc(var(--spacing)*40)}.w-48{width:calc(var(--spacing)*48)}.w-\[min\(48rem\,calc\(100vw-2rem\)\)\]{width:min(48rem,100vw - 2rem)}.w-\[min\(72rem\,calc\(100vw-2rem\)\)\]{width:min(72rem,100vw - 2rem)}.w-full{width:100%}.w-max{width:max-content}.max-w-prose{max-width:65ch}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-fit{min-width:fit-content}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.list-decimal{list-style-type:decimal}.appearance-none{appearance:none}.auto-cols-fr{grid-auto-columns:minmax(0,1fr)}.grid-flow-col{grid-auto-flow:column}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-5{gap:calc(var(--spacing)*5)}.gap-6{gap:calc(var(--spacing)*6)}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}.gap-x-2{column-gap:calc(var(--spacing)*2)}.gap-x-4{column-gap:calc(var(--spacing)*4)}.gap-y-1{row-gap:calc(var(--spacing)*1)}.gap-y-2{row-gap:calc(var(--spacing)*2)}.self-center{align-self:center}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-x-auto{overflow-x:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-md{border-radius:var(--radius-md)}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-4{border-style:var(--tw-border-style);border-width:4px}.border-\[1\.5px\]{border-style:var(--tw-border-style);border-width:1.5px}.border-\[6px\]{border-style:var(--tw-border-style);border-width:6px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-\[1\.5px\]{border-top-style:var(--tw-border-style);border-top-width:1.5px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-b-\[1\.5px\]{border-bottom-style:var(--tw-border-style);border-bottom-width:1.5px}.border-danger{border-color:var(--color-danger)}.border-gray-200{border-color:var(--color-gray-200)}.border-grid{border-color:var(--color-grid)}.border-ink{border-color:var(--color-ink)}.border-ink\/15{border-color:#1b2a4a26}@supports (color:color-mix(in lab,red,red)){.border-ink\/15{border-color:color-mix(in oklab,var(--color-ink)15%,transparent)}}.border-line{border-color:var(--color-line)}.border-orange-400{border-color:var(--color-orange-400)}.border-slate-200{border-color:var(--color-slate-200)}.border-surface{border-color:var(--color-surface)}.border-transparent{border-color:#0000}.border-t-blue-600{border-top-color:var(--color-blue-600)}.border-t-ink\/80{border-top-color:#1b2a4acc}@supports (color:color-mix(in lab,red,red)){.border-t-ink\/80{border-top-color:color-mix(in oklab,var(--color-ink)80%,transparent)}}.border-b-surface{border-bottom-color:var(--color-surface)}.border-b-transparent{border-bottom-color:#0000}.bg-grid{background-color:var(--color-grid)}.bg-ink{background-color:var(--color-ink)}.bg-marker-soft{background-color:var(--color-marker-soft)}.bg-paper{background-color:var(--color-paper)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-surface{background-color:var(--color-surface)}.bg-surface\/40{background-color:#fff6}@supports (color:color-mix(in lab,red,red)){.bg-surface\/40{background-color:color-mix(in oklab,var(--color-surface)40%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-\[linear-gradient\(transparent_58\%\,var\(--color-marker-band\)_58\%\,var\(--color-marker-band\)_92\%\,transparent_92\%\)\]{background-image:linear-gradient(transparent 58%,var(--color-marker-band)58%,var(--color-marker-band)92%,transparent 92%)}.p-0{padding:calc(var(--spacing)*0)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.px-0{padding-inline:calc(var(--spacing)*0)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-3\.5{padding-inline:calc(var(--spacing)*3.5)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-3\.5{padding-top:calc(var(--spacing)*3.5)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-1\.5{padding-right:calc(var(--spacing)*1.5)}.pr-2{padding-right:calc(var(--spacing)*2)}.pb-0\.5{padding-bottom:calc(var(--spacing)*.5)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pl-1{padding-left:calc(var(--spacing)*1)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-3{padding-left:calc(var(--spacing)*3)}.pl-5{padding-left:calc(var(--spacing)*5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-bottom{vertical-align:bottom}.align-top{vertical-align:top}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[11px\]{font-size:11px}.leading-6{--tw-leading:calc(var(--spacing)*6);line-height:calc(var(--spacing)*6)}.leading-loose{--tw-leading:var(--leading-loose);line-height:var(--leading-loose)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.text-danger{color:var(--color-danger)}.text-gray-700{color:var(--color-gray-700)}.text-gray-950{color:var(--color-gray-950)}.text-ink{color:var(--color-ink)}.text-ink-muted{color:var(--color-ink-muted)}.text-ink-muted\/60{color:#4a587899}@supports (color:color-mix(in lab,red,red)){.text-ink-muted\/60{color:color-mix(in oklab,var(--color-ink-muted)60%,transparent)}}.text-label{color:var(--color-label)}.text-orange-400{color:var(--color-orange-400)}.text-slate-800{color:var(--color-slate-800)}.text-surface{color:var(--color-surface)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.accent-ink{accent-color:var(--color-ink)}.opacity-50{opacity:.5}.shadow-\[3px_3px_0_var\(--color-marker\)\]{--tw-shadow:3px 3px 0 var(--tw-shadow-color,var(--color-marker));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-\[1\.5px\]{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1.5px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-\[3px\]{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-grid{--tw-ring-color:var(--color-grid)}.ring-ink{--tw-ring-color:var(--color-ink)}.outline-danger{outline-color:var(--color-danger)}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.peer-checked\:ring-\[3px\]:is(:where(.peer):checked~*){--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.peer-checked\:ring-ink:is(:where(.peer):checked~*){--tw-ring-color:var(--color-ink)}.peer-focus-visible\:outline-2:is(:where(.peer):focus-visible~*){outline-style:var(--tw-outline-style);outline-width:2px}.peer-focus-visible\:outline-offset-4:is(:where(.peer):focus-visible~*){outline-offset:4px}.peer-focus-visible\:outline-ink:is(:where(.peer):focus-visible~*){outline-color:var(--color-ink)}.placeholder\:text-ink::placeholder{color:var(--color-ink)}.backdrop\:bg-ink\/40::backdrop{background-color:#1b2a4a66}@supports (color:color-mix(in lab,red,red)){.backdrop\:bg-ink\/40::backdrop{background-color:color-mix(in oklab,var(--color-ink)40%,transparent)}}.first\:mt-4:first-child{margin-top:calc(var(--spacing)*4)}.last\:mb-0:last-child{margin-bottom:calc(var(--spacing)*0)}.focus-within\:outline-2:focus-within{outline-style:var(--tw-outline-style);outline-width:2px}.focus-within\:outline-danger:focus-within{outline-color:var(--color-danger)}.focus-within\:outline-ink:focus-within{outline-color:var(--color-ink)}@media(hover:hover){.hover\:border-line:hover{border-color:var(--color-line)}.hover\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\:bg-paper:hover{background-color:var(--color-paper)}}.focus\:border-ink:focus{border-color:var(--color-ink)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus\:placeholder\:text-ink-muted:focus::placeholder{color:var(--color-ink-muted)}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\:outline-ink:focus-visible{outline-color:var(--color-ink)}.enabled\:cursor-pointer:enabled{cursor:pointer}@media(hover:hover){.enabled\:hover\:bg-marker-soft:enabled:hover{background-color:var(--color-marker-soft)}.enabled\:hover\:bg-paper:enabled:hover{background-color:var(--color-paper)}}.enabled\:active\:translate-x-px:enabled:active{--tw-translate-x:1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.enabled\:active\:translate-y-px:enabled:active{--tw-translate-y:1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.enabled\:active\:shadow-\[2px_2px_0_var\(--color-marker\)\]:enabled:active{--tw-shadow:2px 2px 0 var(--tw-shadow-color,var(--color-marker));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-25:disabled{opacity:.25}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:64rem){.lg\:h-dvh{height:100dvh}.lg\:min-h-0{min-height:calc(var(--spacing)*0)}.lg\:max-w-\[calc\(100dvh-44px\+24rem\)\]{max-width:calc(100dvh - 44px + 24rem)}.lg\:grid-cols-\[16rem_minmax\(0\,1fr\)\]{grid-template-columns:16rem minmax(0,1fr)}.lg\:grid-cols-\[minmax\(0\,1fr\)_24rem\]{grid-template-columns:minmax(0,1fr) 24rem}.lg\:p-7{padding:calc(var(--spacing)*7)}.lg\:text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}}.dark\:bg-surface:where([data-theme=dark],[data-theme=dark] *){background-color:var(--color-surface)}.dark\:text-ink:where([data-theme=dark],[data-theme=dark] *){color:var(--color-ink)}.dark\:backdrop\:bg-black\/60:where([data-theme=dark],[data-theme=dark] *)::backdrop{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.dark\:backdrop\:bg-black\/60:where([data-theme=dark],[data-theme=dark] *)::backdrop{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.\[\&\:\:-moz-range-thumb\]\:size-4::-moz-range-thumb{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&\:\:-moz-range-thumb\]\:cursor-grab::-moz-range-thumb{cursor:grab}.\[\&\:\:-moz-range-thumb\]\:rounded-full::-moz-range-thumb{border-radius:3.40282e38px}.\[\&\:\:-moz-range-thumb\]\:border-2::-moz-range-thumb{border-style:var(--tw-border-style);border-width:2px}.\[\&\:\:-moz-range-thumb\]\:border-surface::-moz-range-thumb{border-color:var(--color-surface)}.\[\&\:\:-moz-range-thumb\]\:bg-ink::-moz-range-thumb{background-color:var(--color-ink)}.\[\&\:\:-webkit-slider-thumb\]\:size-4::-webkit-slider-thumb{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&\:\:-webkit-slider-thumb\]\:cursor-grab::-webkit-slider-thumb{cursor:grab}.\[\&\:\:-webkit-slider-thumb\]\:appearance-none::-webkit-slider-thumb{appearance:none}.\[\&\:\:-webkit-slider-thumb\]\:rounded-full::-webkit-slider-thumb{border-radius:3.40282e38px}.\[\&\:\:-webkit-slider-thumb\]\:border-2::-webkit-slider-thumb{border-style:var(--tw-border-style);border-width:2px}.\[\&\:\:-webkit-slider-thumb\]\:border-surface::-webkit-slider-thumb{border-color:var(--color-surface)}.\[\&\:\:-webkit-slider-thumb\]\:bg-ink::-webkit-slider-thumb{background-color:var(--color-ink)}}@font-face{font-family:Instrument Sans Variable;font-style:normal;font-display:swap;font-weight:400 700;src:url(/assets/instrument-sans-latin-ext-wght-normal-B5bTHO_g.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Instrument Sans Variable;font-style:normal;font-display:swap;font-weight:400 700;src:url(/assets/instrument-sans-latin-wght-normal-BbzFLZTg.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2)format("woff2"),url(/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff)format("woff");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2)format("woff2"),url(/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff)format("woff");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2)format("woff2"),url(/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff)format("woff");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2)format("woff2"),url(/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2)format("woff2"),url(/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2)format("woff2"),url(/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff)format("woff");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2)format("woff2"),url(/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff)format("woff");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2)format("woff2"),url(/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff)format("woff");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2)format("woff2"),url(/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2)format("woff2"),url(/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}:root[data-theme=dark]{color-scheme:dark;--color-ink:#e4e9f2;--color-ink-muted:#a3aec4;--color-marker-soft:#3d3a22;--color-marker-band:#8f7600;--color-paper:#0f1626;--color-grid:#2c3852;--color-surface:#172036;--color-label:#c4ccda;--color-line:#3a4766;--color-danger:#f87171}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}}
dist/assets/index-DSUxBIVD.css DELETED
@@ -1 +0,0 @@
1
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-700:oklch(50.5% .213 27.518);--color-orange-200:oklch(90.1% .076 70.697);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-400:oklch(75% .183 55.934);--color-blue-600:oklch(54.6% .245 262.881);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-800:oklch(27.9% .041 260.031);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-950:oklch(13% .028 261.692);--color-stone-50:oklch(98.5% .001 106.423);--color-stone-100:oklch(97% .001 106.424);--color-stone-200:oklch(92.3% .003 48.717);--color-stone-300:oklch(86.9% .005 56.366);--color-stone-400:oklch(70.9% .01 56.259);--color-stone-500:oklch(55.3% .013 58.071);--color-stone-600:oklch(44.4% .011 73.639);--color-stone-700:oklch(37.4% .01 67.558);--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--animate-spin:spin 1s linear infinite;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.z-50{z-index:50}.m-4{margin:calc(var(--spacing)*4)}.-mt-2{margin-top:calc(var(--spacing)*-2)}.-mt-5{margin-top:calc(var(--spacing)*-5)}.-mt-6{margin-top:calc(var(--spacing)*-6)}.mt-0{margin-top:calc(var(--spacing)*0)}.-mb-2{margin-bottom:calc(var(--spacing)*-2)}.mb-0{margin-bottom:calc(var(--spacing)*0)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-3{height:calc(var(--spacing)*3)}.h-8{height:calc(var(--spacing)*8)}.h-10{height:calc(var(--spacing)*10)}.h-16{height:calc(var(--spacing)*16)}.h-64{height:calc(var(--spacing)*64)}.h-full{height:100%}.h-px{height:1px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-64{min-height:calc(var(--spacing)*64)}.min-h-\[320px\]{min-height:320px}.min-h-\[420px\]{min-height:420px}.w-1\/2{width:50%}.w-3{width:calc(var(--spacing)*3)}.w-16{width:calc(var(--spacing)*16)}.w-fit{width:fit-content}.w-full{width:100%}.min-w-0{min-width:calc(var(--spacing)*0)}.flex-1{flex:1}.flex-none{flex:none}.shrink-0{flex-shrink:0}.translate-y-4{--tw-translate-y:calc(var(--spacing)*4);translate:var(--tw-translate-x)var(--tw-translate-y)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[1fr_12fr_1fr\]{grid-template-columns:1fr 12fr 1fr}.grid-cols-\[6rem_minmax\(0\,1fr\)\]{grid-template-columns:6rem minmax(0,1fr)}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-12{gap:calc(var(--spacing)*12)}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}.justify-self-end{justify-self:flex-end}.overflow-auto{overflow:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.border{border-style:var(--tw-border-style);border-width:1px}.border-4{border-style:var(--tw-border-style);border-width:4px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-orange-400{border-color:var(--color-orange-400)}.border-slate-200{border-color:var(--color-slate-200)}.border-stone-200{border-color:var(--color-stone-200)}.border-stone-300{border-color:var(--color-stone-300)}.border-t-blue-600{border-top-color:var(--color-blue-600)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-orange-200{background-color:var(--color-orange-200)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-300{background-color:var(--color-slate-300)}.bg-stone-50{background-color:var(--color-stone-50)}.bg-stone-100{background-color:var(--color-stone-100)}.bg-white{background-color:var(--color-white)}.p-2{padding:calc(var(--spacing)*2)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-5{padding-inline:calc(var(--spacing)*5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.pr-0\.25{padding-right:calc(var(--spacing)*.25)}.pl-4{padding-left:calc(var(--spacing)*4)}.text-center{text-align:center}.text-right{text-align:right}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-6{--tw-leading:calc(var(--spacing)*6);line-height:calc(var(--spacing)*6)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.whitespace-nowrap{white-space:nowrap}.text-gray-700{color:var(--color-gray-700)}.text-gray-950{color:var(--color-gray-950)}.text-orange-400{color:var(--color-orange-400)}.text-red-700{color:var(--color-red-700)}.text-slate-600{color:var(--color-slate-600)}.text-slate-800{color:var(--color-slate-800)}.text-stone-500{color:var(--color-stone-500)}.text-stone-600{color:var(--color-stone-600)}.text-stone-700{color:var(--color-stone-700)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.last\:mb-0:last-child{margin-bottom:calc(var(--spacing)*0)}@media(hover:hover){.hover\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\:bg-orange-300:hover{background-color:var(--color-orange-300)}.hover\:bg-stone-200:hover{background-color:var(--color-stone-200)}}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-stone-400:focus{--tw-ring-color:var(--color-stone-400)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:64rem){.lg\:flex{display:flex}.lg\:h-dvh{height:100dvh}.lg\:grid-cols-\[2fr_1fr\]{grid-template-columns:2fr 1fr}.lg\:gap-12{gap:calc(var(--spacing)*12)}}.\[\&_p\]\:mb-0 p{margin-bottom:calc(var(--spacing)*0)}.\[\&\>div\]\:w-full>div{width:100%}.\[\&\>div\>button\]\:w-1\/4>div>button{width:25%}.\[\&\>div\>button\]\:px-1>div>button{padding-inline:calc(var(--spacing)*1)}}.title{font-size:32px;font-weight:700}.status{color:var(--ink-soft);border:1px solid var(--line);background:#ffffffbf;border-radius:999px;flex:none;align-items:center;gap:8px;padding:8px 12px;font-size:12px;display:flex}.status span{background:#d69b25;border-radius:50%;width:8px;height:8px;box-shadow:0 0 0 4px #f8ebca}.status.ready span{background:#2c9b68;box-shadow:0 0 0 4px #d9f0e5}.status.error span{background:#c74848;box-shadow:0 0 0 4px #f5dddd}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}
 
 
dist/assets/instrument-sans-latin-ext-wght-normal-B5bTHO_g.woff2 ADDED
Binary file (11.1 kB). View file
 
dist/assets/instrument-sans-latin-wght-normal-BbzFLZTg.woff2 ADDED
Binary file (30.1 kB). View file
 
dist/assets/pyodide.worker-B-lwJug5.js ADDED
@@ -0,0 +1,442 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function(){"use strict";const A=Symbol("Comlink.proxy"),M=Symbol("Comlink.endpoint"),D=Symbol("Comlink.releaseProxy"),x=Symbol("Comlink.finalizer"),v=Symbol("Comlink.thrown"),S=e=>typeof e=="object"&&e!==null||typeof e=="function",L={canHandle:e=>S(e)&&e[A],serialize(e){const{port1:n,port2:t}=new MessageChannel;return E(e,n),[t,[t]]},deserialize(e){return e.start(),U(e)}},C={canHandle:e=>S(e)&&v in e,serialize({value:e}){let n;return e instanceof Error?n={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:n={isError:!1,value:e},[n,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},R=new Map([["proxy",L],["throw",C]]);function V(e,n){for(const t of e)if(n===t||t==="*"||t instanceof RegExp&&t.test(n))return!0;return!1}function E(e,n=globalThis,t=["*"]){n.addEventListener("message",function u(i){if(!i||!i.data)return;if(!V(t,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}const{id:a,type:d,path:f}=Object.assign({path:[]},i.data),o=(i.data.argumentList||[]).map(c);let r;try{const s=f.slice(0,-1).reduce((p,g)=>p[g],e),l=f.reduce((p,g)=>p[g],e);switch(d){case"GET":r=l;break;case"SET":s[f.slice(-1)[0]]=c(i.data.value),r=!0;break;case"APPLY":r=l.apply(s,o);break;case"CONSTRUCT":{const p=new l(...o);r=W(p)}break;case"ENDPOINT":{const{port1:p,port2:g}=new MessageChannel;E(e,g),r=F(p,[p])}break;case"RELEASE":r=void 0;break;default:return}}catch(s){r={value:s,[v]:0}}Promise.resolve(r).catch(s=>({value:s,[v]:0})).then(s=>{const[l,p]=_(s);n.postMessage(Object.assign(Object.assign({},l),{id:a}),p),d==="RELEASE"&&(n.removeEventListener("message",u),j(n),x in e&&typeof e[x]=="function"&&e[x]())}).catch(s=>{const[l,p]=_({value:new TypeError("Unserializable return value"),[v]:0});n.postMessage(Object.assign(Object.assign({},l),{id:a}),p)})}),n.start&&n.start()}function H(e){return e.constructor.name==="MessagePort"}function j(e){H(e)&&e.close()}function U(e,n){const t=new Map;return e.addEventListener("message",function(i){const{data:a}=i;if(!a||!a.id)return;const d=t.get(a.id);if(d)try{d(a)}finally{t.delete(a.id)}}),w(e,t,[],n)}function b(e){if(e)throw new Error("Proxy has been released and is not useable")}function I(e){return m(e,new Map,{type:"RELEASE"}).then(()=>{j(e)})}const y=new WeakMap,h="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const n=(y.get(e)||0)-1;y.set(e,n),n===0&&I(e)});function q(e,n){const t=(y.get(n)||0)+1;y.set(n,t),h&&h.register(e,n,e)}function z(e){h&&h.unregister(e)}function w(e,n,t=[],u=function(){}){let i=!1;const a=new Proxy(u,{get(d,f){if(b(i),f===D)return()=>{z(a),I(e),n.clear(),i=!0};if(f==="then"){if(t.length===0)return{then:()=>a};const o=m(e,n,{type:"GET",path:t.map(r=>r.toString())}).then(c);return o.then.bind(o)}return w(e,n,[...t,f])},set(d,f,o){b(i);const[r,s]=_(o);return m(e,n,{type:"SET",path:[...t,f].map(l=>l.toString()),value:r},s).then(c)},apply(d,f,o){b(i);const r=t[t.length-1];if(r===M)return m(e,n,{type:"ENDPOINT"}).then(c);if(r==="bind")return w(e,n,t.slice(0,-1));const[s,l]=O(o);return m(e,n,{type:"APPLY",path:t.map(p=>p.toString()),argumentList:s},l).then(c)},construct(d,f){b(i);const[o,r]=O(f);return m(e,n,{type:"CONSTRUCT",path:t.map(s=>s.toString()),argumentList:o},r).then(c)}});return q(a,e),a}function G(e){return Array.prototype.concat.apply([],e)}function O(e){const n=e.map(_);return[n.map(t=>t[0]),G(n.map(t=>t[1]))]}const T=new WeakMap;function F(e,n){return T.set(e,n),e}function W(e){return Object.assign(e,{[A]:!0})}function _(e){for(const[n,t]of R)if(t.canHandle(e)){const[u,i]=t.serialize(e);return[{type:"HANDLER",name:n,value:u},i]}return[{type:"RAW",value:e},T.get(e)||[]]}function c(e){switch(e.type){case"HANDLER":return R.get(e.name).deserialize(e.value);case"RAW":return e.value}}function m(e,n,t,u){return new Promise(i=>{const a=B();n.set(a,i),e.start&&e.start(),e.postMessage(Object.assign({id:a},t),u)})}function B(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const P="https://cdn.jsdelivr.net/pyodide/v0.26.1/full/";function $(e){let n,t=null;function u(){return t??(t=(async()=>{const{loadPyodide:a}=await import(`${P}pyodide.mjs`);n=await a({indexURL:P}),await n.loadPackage(e.packages);for(const[o,r]of Object.entries(e.files))n.FS.writeFile(o,r instanceof URL?await X(r):r);const{module:d,className:f}=e.manager??{module:"manager",className:"Manager"};return n.pyimport(d)[f]()})()),t}E({async init(){await u()},async call(a,d){let f;try{f=await u()}catch(l){return k(`Python failed to load: ${N(l)}`)}let o,r,s;try{return o=f[a],typeof o!="function"?k(`Manager has no method "${a}"`):(r=d===void 0?void 0:n.toPy(d),s=r===void 0?o():o(r),{ok:!0,data:(s?.toJs?s.toJs({dict_converter:Object.fromEntries}):s)??null})}catch(l){return l.type==="UserError"?{ok:!1,error:{kind:"user",message:J(N(l))}}:(console.error(l),k(N(l)))}finally{o?.destroy?.(),r?.destroy?.(),s?.destroy?.()}}})}async function X(e){const n=await fetch(e);if(!n.ok)throw new Error(`Could not fetch ${e}: ${n.status}`);return new Uint8Array(await n.arrayBuffer())}function k(e){return{ok:!1,error:{kind:"internal",message:e}}}function N(e){return e instanceof Error?e.message:String(e)}function J(e){const n="UserError: ",t=e.lastIndexOf(n);return t===-1?e:e.slice(t+n.length).trim()}var Y=`import json
2
+ from pathlib import Path
3
+
4
+ import numpy as np
5
+
6
+ from logic import OPTIMISERS, Objective, Run, parse_function
7
+
8
+ ALGORITHMS = {
9
+ spec["id"]: spec
10
+ for spec in json.loads((Path(__file__).parent / "algorithms.json").read_text())["algorithms"]
11
+ }
12
+
13
+ # Iterations a run can take before stepping stops
14
+ MAX_ITERATIONS = 1000
15
+ LIMIT_REACHED = f"Reached the {MAX_ITERATIONS}-iteration limit."
16
+ # Sample points for the plotted curve (one variable) or surface (two, per side)
17
+ CURVE_POINTS = 401
18
+ GRID_POINTS = 101
19
+ # Gradient arrows per side
20
+ ARROW_POINTS = 15
21
+
22
+
23
+ class UserError(Exception):
24
+ """A mistake the student can fix; its message is shown in the UI."""
25
+
26
+
27
+ def _json_values(values: np.ndarray) -> list:
28
+ """Values as JSON numbers, with null where f has no finite value."""
29
+ return [float(v) if np.isfinite(v) else None for v in values]
30
+
31
+
32
+ class Manager:
33
+ def __init__(self):
34
+ self._objective: Objective | None = None
35
+ self._runs: list[Run] = []
36
+
37
+ def handle_set_function(self, args: dict) -> None:
38
+ """{variables: 1 | 2, expression}; clears the runs."""
39
+ self._objective = None
40
+ self._runs = []
41
+ n = int(args["variables"])
42
+ try:
43
+ expr = parse_function(str(args["expression"]), n)
44
+ except ValueError as e:
45
+ raise UserError(str(e))
46
+ try:
47
+ objective = Objective(expr, n)
48
+ # Evaluate everything once, so a failure shows here rather than mid-run.
49
+ # Values may be inf or nan (outside the domain); only errors count.
50
+ p = np.full(n, 0.5)
51
+ with np.errstate(all="ignore"):
52
+ objective.value(p), objective.gradient(p), objective.hessian(p)
53
+ except Exception:
54
+ raise UserError("This function can't be evaluated or differentiated. Try writing it another way.")
55
+ self._objective = objective
56
+
57
+ def handle_function_values(self, args: dict) -> dict | None:
58
+ """f sampled over the plot's {x_range, y_range}; None with no function."""
59
+ f = self._objective
60
+ if f is None:
61
+ return None
62
+ with np.errstate(all="ignore"):
63
+ if f.n == 1:
64
+ x = np.linspace(*args["x_range"], CURVE_POINTS)
65
+ return {"x": x.tolist(), "f": _json_values(f.values_on(x))}
66
+
67
+ x = np.linspace(*args["x_range"], GRID_POINTS)
68
+ y = np.linspace(*args["y_range"], GRID_POINTS)
69
+ z = f.values_on(*np.meshgrid(x, y))
70
+ ax, ay = np.meshgrid(np.linspace(*args["x_range"], ARROW_POINTS), np.linspace(*args["y_range"], ARROW_POINTS))
71
+ u, v = f.gradient_on(ax, ay)
72
+ return {
73
+ "x": x.tolist(),
74
+ "y": y.tolist(),
75
+ # Rows follow y, columns follow x
76
+ "f": [_json_values(row) for row in z],
77
+ "arrows": {
78
+ "x": ax.ravel().tolist(),
79
+ "y": ay.ravel().tolist(),
80
+ "u": _json_values(u.ravel()),
81
+ "v": _json_values(v.ravel()),
82
+ },
83
+ }
84
+
85
+ def handle_set_runs(self, args: dict) -> None:
86
+ """{runs: [{algorithm, start, params}]}: the optimisers to step together."""
87
+ self._runs = []
88
+ f = self._objective
89
+ if f is None:
90
+ raise ValueError("Function not set")
91
+ runs = []
92
+ for run in args["runs"]:
93
+ spec = ALGORITHMS[run["algorithm"]]
94
+ given = dict(run.get("params", {}))
95
+ params = {p["name"]: float(given.get(p["name"], p["default"])) for p in spec["params"]}
96
+ start = np.array(run["start"], dtype=float)
97
+ if start.shape != (f.n,):
98
+ raise ValueError(f"Start point needs {f.n} coordinates, got {start.tolist()}")
99
+ with np.errstate(all="ignore"):
100
+ if not np.isfinite(f.value(start)):
101
+ point = ", ".join(f"{c:g}" for c in start)
102
+ raise UserError(f"The function has no finite value at the initial point ({point}).")
103
+ runs.append(Run(f, OPTIMISERS[spec["id"]](f, **params), start))
104
+ self._runs = runs
105
+
106
+ def handle_state(self, args: dict) -> dict | None:
107
+ """Every run after {iteration} iterations; None once all have stopped.
108
+
109
+ "stopped" says why a run ended, at its last point and after it (where
110
+ point is None). It is None while the run carries on.
111
+ """
112
+ k = int(args["iteration"])
113
+ if not self._runs or k > MAX_ITERATIONS:
114
+ return None
115
+ points = [run.point(k) for run in self._runs]
116
+ if all(p is None for p in points):
117
+ return None
118
+ # Look one iteration ahead to know whether this is a run's last point
119
+ ended = [p is None or run.point(k + 1) is None for run, p in zip(self._runs, points)]
120
+ return {
121
+ "runs": [
122
+ {"point": p, "stopped": run.stopped if end else (LIMIT_REACHED if k == MAX_ITERATIONS else None)}
123
+ for run, p, end in zip(self._runs, points, ended)
124
+ ]
125
+ }
126
+ `,Z=`"""Objective functions and optimisers, in one or two variables.
127
+
128
+ Positions, gradients and Hessians are NumPy arrays of length 1 or 2, so each
129
+ optimiser is written once for both.
130
+ """
131
+
132
+ import re
133
+
134
+ import numpy as np
135
+ from sympy import Abs, DiracDelta, Expr, Float, Integer, Rational, Symbol, acos, asin, atan, cos, exp, lambdify, log, pi, sin, sqrt, symbols, tan
136
+ from sympy.parsing.sympy_parser import (
137
+ convert_xor,
138
+ implicit_multiplication_application,
139
+ parse_expr,
140
+ standard_transformations,
141
+ )
142
+
143
+ # Real, so that e.g. d/dx |x| is sign(x)
144
+ VARIABLES = symbols("x y", real=True)
145
+
146
+ ALLOWED_NAMES = {
147
+ "sin": sin, "cos": cos, "tan": tan, "asin": asin, "acos": acos, "atan": atan,
148
+ "log": log, "ln": log, "sqrt": sqrt, "abs": Abs, "exp": exp,
149
+ "e": exp(1), "pi": pi, "π": pi,
150
+ }
151
+ # The parser's own helpers for numbers and names, and nothing else: no other
152
+ # sympy functions and no Python builtins
153
+ PARSER_NAMES = {"Integer": Integer, "Float": Float, "Rational": Rational, "Symbol": Symbol, "__builtins__": {}}
154
+ FUNCTION_NAMES = "sin, cos, tan, asin, acos, atan, exp, log, sqrt, abs, e and pi"
155
+
156
+
157
+ def _unknown_names(expression: str, variables: list[str]) -> list[str]:
158
+ """Words that aren't a variable, a run of variables (xy is x·y) or an allowed name."""
159
+ words = re.findall(r"[A-Za-z_]\\w*", expression)
160
+ return sorted({w for w in words if w not in ALLOWED_NAMES and not set(w) <= set(variables)})
161
+
162
+
163
+ def parse_function(expression: str, n_variables: int) -> Expr:
164
+ """Parse e.g. "x^2 + 3y^2"; raises ValueError with a message for students."""
165
+ if not expression.strip():
166
+ raise ValueError("Enter a function.")
167
+ variables = VARIABLES[:n_variables]
168
+ allowed = " and ".join(str(v) for v in variables)
169
+ unknown = _unknown_names(expression, [str(v) for v in variables])
170
+ if unknown:
171
+ raise ValueError(f"Unknown name {', '.join(unknown)}: functions can use {allowed}, and {FUNCTION_NAMES}.")
172
+ names = {str(v): v for v in VARIABLES} | ALLOWED_NAMES
173
+ try:
174
+ expr = parse_expr(
175
+ expression,
176
+ local_dict=names,
177
+ global_dict=PARSER_NAMES,
178
+ transformations=standard_transformations + (implicit_multiplication_application, convert_xor),
179
+ )
180
+ except Exception:
181
+ raise ValueError("This isn't a function sympy can read. Check the brackets and operators.")
182
+ if not isinstance(expr, Expr):
183
+ raise ValueError("This isn't a function sympy can read. Check the brackets and operators.")
184
+ unknown = expr.free_symbols - set(variables)
185
+ if unknown:
186
+ raise ValueError(f"Unknown name {', '.join(sorted(map(str, unknown)))}: functions can use {allowed}, and {FUNCTION_NAMES}.")
187
+ return expr
188
+
189
+
190
+ def derivative(expr: Expr, *variables) -> Expr:
191
+ """∂expr/∂variables, with kinks treated as PyTorch's autograd does: d|x|/dx is
192
+ sign(x) (0 at x = 0) and sign has no curvature, so the Dirac delta sympy
193
+ gives for d²|x|/dx² becomes 0. NumPy has no Dirac delta to evaluate anyway."""
194
+ return expr.diff(*variables).replace(DiracDelta, lambda *args: 0)
195
+
196
+
197
+ class Objective:
198
+ """f with its gradient and Hessian, evaluated at a point or on a grid."""
199
+
200
+ def __init__(self, expr: Expr, n_variables: int):
201
+ variables = VARIABLES[:n_variables]
202
+ self.n = n_variables
203
+ self._f = lambdify(variables, expr, modules="numpy")
204
+ self._gradient = [lambdify(variables, derivative(expr, v), modules="numpy") for v in variables]
205
+ self._hessian = [[lambdify(variables, derivative(expr, a, b), modules="numpy") for b in variables] for a in variables]
206
+
207
+ def value(self, p: np.ndarray) -> float:
208
+ return float(self._f(*p))
209
+
210
+ def gradient(self, p: np.ndarray) -> np.ndarray:
211
+ return np.array([float(g(*p)) for g in self._gradient])
212
+
213
+ def hessian(self, p: np.ndarray) -> np.ndarray:
214
+ return np.array([[float(h(*p)) for h in row] for row in self._hessian])
215
+
216
+ def values_on(self, *grid: np.ndarray) -> np.ndarray:
217
+ # Constant expressions give a scalar; spread it over the grid
218
+ return np.broadcast_to(np.asarray(self._f(*grid), dtype=float), grid[0].shape)
219
+
220
+ def gradient_on(self, *grid: np.ndarray) -> list[np.ndarray]:
221
+ return [np.broadcast_to(np.asarray(g(*grid), dtype=float), grid[0].shape) for g in self._gradient]
222
+
223
+
224
+ class SingularHessian(Exception):
225
+ pass
226
+
227
+
228
+ # Each optimiser keeps its own state between steps; step(p) returns the next position.
229
+
230
+ class GradientDescent:
231
+ """Heavy-ball momentum: v ← μv − η∇f(x), x ← x + v."""
232
+
233
+ def __init__(self, objective: Objective, learning_rate: float, momentum: float):
234
+ self.f, self.lr, self.momentum = objective, learning_rate, momentum
235
+ self.v = 0.0
236
+
237
+ def step(self, p: np.ndarray) -> np.ndarray:
238
+ self.v = self.momentum * self.v - self.lr * self.f.gradient(p)
239
+ return p + self.v
240
+
241
+
242
+ class Nesterov:
243
+ """Gradient taken at the look-ahead point x + μv."""
244
+
245
+ def __init__(self, objective: Objective, learning_rate: float, momentum: float):
246
+ self.f, self.lr, self.momentum = objective, learning_rate, momentum
247
+ self.v = 0.0
248
+
249
+ def step(self, p: np.ndarray) -> np.ndarray:
250
+ self.v = self.momentum * self.v - self.lr * self.f.gradient(p + self.momentum * self.v)
251
+ return p + self.v
252
+
253
+
254
+ class Newton:
255
+ """x ← x − H⁻¹∇f(x)."""
256
+
257
+ def __init__(self, objective: Objective):
258
+ self.f = objective
259
+
260
+ def step(self, p: np.ndarray) -> np.ndarray:
261
+ h, g = self.f.hessian(p), self.f.gradient(p)
262
+ try:
263
+ delta = np.linalg.solve(h, g)
264
+ except np.linalg.LinAlgError:
265
+ raise SingularHessian()
266
+ # Pyodide's NumPy can't see floating-point errors, so solve returns inf or nan instead of raising
267
+ if np.all(np.isfinite(h)) and np.all(np.isfinite(g)) and not np.all(np.isfinite(delta)):
268
+ raise SingularHessian()
269
+ return p - delta
270
+
271
+
272
+ class Adagrad:
273
+ def __init__(self, objective: Objective, learning_rate: float, epsilon: float):
274
+ self.f, self.lr, self.eps = objective, learning_rate, epsilon
275
+ self.v = 0.0 # sum of squared gradients
276
+
277
+ def step(self, p: np.ndarray) -> np.ndarray:
278
+ g = self.f.gradient(p)
279
+ self.v = self.v + g**2
280
+ # ε outside the square root, as PyTorch does
281
+ return p - self.lr / (np.sqrt(self.v) + self.eps) * g
282
+
283
+
284
+ class RMSProp:
285
+ def __init__(self, objective: Objective, learning_rate: float, beta: float, epsilon: float):
286
+ self.f, self.lr, self.beta, self.eps = objective, learning_rate, beta, epsilon
287
+ self.v = 0.0 # moving average of squared gradients
288
+
289
+ def step(self, p: np.ndarray) -> np.ndarray:
290
+ g = self.f.gradient(p)
291
+ self.v = self.beta * self.v + (1 - self.beta) * g**2
292
+ # ε outside the square root, as PyTorch does
293
+ return p - self.lr / (np.sqrt(self.v) + self.eps) * g
294
+
295
+
296
+ class Adadelta:
297
+ def __init__(self, objective: Objective, beta: float, epsilon: float):
298
+ self.f, self.beta, self.eps = objective, beta, epsilon
299
+ self.v = 0.0 # moving average of squared gradients
300
+ self.s = 0.0 # moving average of squared updates
301
+
302
+ def step(self, p: np.ndarray) -> np.ndarray:
303
+ g = self.f.gradient(p)
304
+ self.v = self.beta * self.v + (1 - self.beta) * g**2
305
+ delta = -np.sqrt(self.s + self.eps) / np.sqrt(self.v + self.eps) * g
306
+ self.s = self.beta * self.s + (1 - self.beta) * delta**2
307
+ return p + delta
308
+
309
+
310
+ class Adam:
311
+ def __init__(self, objective: Objective, learning_rate: float, beta1: float, beta2: float, epsilon: float):
312
+ self.f, self.lr, self.beta1, self.beta2, self.eps = objective, learning_rate, beta1, beta2, epsilon
313
+ self.m = 0.0 # first moment
314
+ self.v = 0.0 # second moment
315
+ self.t = 0
316
+
317
+ def step(self, p: np.ndarray) -> np.ndarray:
318
+ g = self.f.gradient(p)
319
+ self.t += 1
320
+ self.m = self.beta1 * self.m + (1 - self.beta1) * g
321
+ self.v = self.beta2 * self.v + (1 - self.beta2) * g**2
322
+ m_hat = self.m / (1 - self.beta1**self.t)
323
+ v_hat = self.v / (1 - self.beta2**self.t)
324
+ return p - self.lr / (np.sqrt(v_hat) + self.eps) * m_hat
325
+
326
+
327
+ # Ids match backend/src/algorithms.json
328
+ OPTIMISERS = {
329
+ "gradient_descent": GradientDescent,
330
+ "nesterov": Nesterov,
331
+ "newton": Newton,
332
+ "adam": Adam,
333
+ "adagrad": Adagrad,
334
+ "rmsprop": RMSProp,
335
+ "adadelta": Adadelta,
336
+ }
337
+
338
+ # A run that gets further than this from the origin has diverged
339
+ DIVERGENCE_LIMIT = 1e6
340
+
341
+ DIVERGED = "The next point has no finite value or is beyond 1,000,000: the run diverged or left the function's domain."
342
+ SINGULAR = "The Hessian is singular here, so Newton's method can't take a step."
343
+
344
+
345
+ class Run:
346
+ """One optimiser's trajectory, computed as far as it has been asked for."""
347
+
348
+ def __init__(self, objective: Objective, optimiser, start: np.ndarray):
349
+ self.f = objective
350
+ self.optimiser = optimiser
351
+ self.points = [self._describe(start)]
352
+ self.position = start
353
+ # Why the run ended, once it has
354
+ self.stopped: str | None = None
355
+
356
+ def point(self, k: int) -> dict | None:
357
+ """The point after k iterations, or None if the run stopped before then."""
358
+ with np.errstate(all="ignore"):
359
+ while len(self.points) <= k and self.stopped is None:
360
+ self._advance()
361
+ return self.points[k] if k < len(self.points) else None
362
+
363
+ def _advance(self) -> None:
364
+ try:
365
+ p = self.optimiser.step(self.position)
366
+ except SingularHessian:
367
+ self.stopped = SINGULAR
368
+ return
369
+ if not np.all(np.abs(p) <= DIVERGENCE_LIMIT) or not np.isfinite(self.f.value(p)):
370
+ self.stopped = DIVERGED
371
+ return
372
+ self.position = p
373
+ self.points.append(self._describe(p))
374
+
375
+ def _describe(self, p: np.ndarray) -> dict:
376
+ return {
377
+ "position": p.tolist(),
378
+ "value": self.f.value(p),
379
+ "gradient": self.f.gradient(p).tolist(),
380
+ "hessian": self.f.hessian(p).tolist(),
381
+ }
382
+ `,K=`{
383
+ "algorithms": [
384
+ {
385
+ "id": "gradient_descent",
386
+ "label": "Gradient descent",
387
+ "params": [
388
+ { "name": "learning_rate", "label": "Learning rate η", "symbol": "η", "kind": "number", "min": 0, "minExclusive": true, "default": 0.1, "description": "How far each step moves along the negative gradient." },
389
+ { "name": "momentum", "label": "Momentum μ", "symbol": "μ", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.0, "description": "How much of the previous step carries over into the next one." }
390
+ ]
391
+ },
392
+ {
393
+ "id": "nesterov",
394
+ "label": "Nesterov momentum",
395
+ "params": [
396
+ { "name": "learning_rate", "label": "Learning rate η", "symbol": "η", "kind": "number", "min": 0, "minExclusive": true, "default": 0.1, "description": "How far each step moves along the negative gradient." },
397
+ { "name": "momentum", "label": "Momentum μ", "symbol": "μ", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.1, "description": "How much of the previous step carries over; the gradient is taken at the look-ahead point." }
398
+ ]
399
+ },
400
+ {
401
+ "id": "newton",
402
+ "label": "Newton's method",
403
+ "params": []
404
+ },
405
+ {
406
+ "id": "adam",
407
+ "label": "Adam",
408
+ "params": [
409
+ { "name": "learning_rate", "label": "Learning rate η", "symbol": "η", "kind": "number", "min": 0, "minExclusive": true, "default": 0.1, "description": "The largest step size, roughly." },
410
+ { "name": "beta1", "label": "Decay β₁", "symbol": "β₁", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.9, "description": "Decay rate of the moving average of gradients (first moment)." },
411
+ { "name": "beta2", "label": "Decay β₂", "symbol": "β₂", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.999, "description": "Decay rate of the moving average of squared gradients (second moment)." },
412
+ { "name": "epsilon", "label": "Epsilon ε", "symbol": "ε", "kind": "number", "min": 0, "minExclusive": true, "default": 1e-8, "description": "Added to √v in the denominator, η / (√v + ε), to avoid dividing by zero." }
413
+ ]
414
+ },
415
+ {
416
+ "id": "adagrad",
417
+ "label": "Adagrad",
418
+ "params": [
419
+ { "name": "learning_rate", "label": "Learning rate η", "symbol": "η", "kind": "number", "min": 0, "minExclusive": true, "default": 0.1, "description": "Divided by the root of the summed squared gradients." },
420
+ { "name": "epsilon", "label": "Epsilon ε", "symbol": "ε", "kind": "number", "min": 0, "minExclusive": true, "default": 1e-8, "description": "Added to √v in the denominator, η / (√v + ε), to avoid dividing by zero." }
421
+ ]
422
+ },
423
+ {
424
+ "id": "rmsprop",
425
+ "label": "RMSProp",
426
+ "params": [
427
+ { "name": "learning_rate", "label": "Learning rate η", "symbol": "η", "kind": "number", "min": 0, "minExclusive": true, "default": 0.1, "description": "Divided by the root of the moving average of squared gradients." },
428
+ { "name": "beta", "label": "Decay β", "symbol": "β", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.9, "description": "Decay rate of the moving average of squared gradients." },
429
+ { "name": "epsilon", "label": "Epsilon ε", "symbol": "ε", "kind": "number", "min": 0, "minExclusive": true, "default": 1e-8, "description": "Added to √v in the denominator, η / (√v + ε), to avoid dividing by zero." }
430
+ ]
431
+ },
432
+ {
433
+ "id": "adadelta",
434
+ "label": "Adadelta",
435
+ "params": [
436
+ { "name": "beta", "label": "Decay β", "symbol": "β", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.9, "description": "Decay rate of the moving averages of squared gradients and squared updates." },
437
+ { "name": "epsilon", "label": "Epsilon ε", "symbol": "ε", "kind": "number", "min": 0, "minExclusive": true, "default": 0.001, "description": "Sets the first step size, and avoids dividing by zero." }
438
+ ]
439
+ }
440
+ ]
441
+ }
442
+ `;$({packages:["numpy","sympy"],files:{"manager.py":Y,"logic.py":Z,"algorithms.json":K}})})();
dist/assets/pyodide.worker-Cq5E6qzM.js DELETED
@@ -1,1020 +0,0 @@
1
- (function(){"use strict";var y=`import numpy as np
2
- from sympy import (
3
- lambdify,
4
- symbols,
5
- sin,
6
- cos,
7
- tan,
8
- asin,
9
- acos,
10
- atan,
11
- exp,
12
- log,
13
- sqrt,
14
- pi,
15
- Abs,
16
- )
17
-
18
- from sympy.parsing.sympy_parser import (
19
- standard_transformations,
20
- implicit_multiplication_application,
21
- convert_xor,
22
- parse_expr,
23
- )
24
-
25
- from optimization_logic import *
26
-
27
-
28
- class OptimizationManager:
29
- def __init__(self):
30
- self.function_values = {"x": [], "y": []}
31
- self.trajectory_values = {"x": [], "y": []}
32
- self.settings = {}
33
-
34
- def handle_update_settings(self, new_settings) -> dict[str, dict] | None:
35
- if new_settings == self.settings:
36
- return None
37
-
38
- non_relayout_settings = (new_settings.keys() | self.settings.keys()) - {"xlim", "ylim"}
39
- non_relayout_settings_changed = any(
40
- new_settings.get(k) != self.settings.get(k)
41
- for k in non_relayout_settings
42
- )
43
-
44
- self.settings = new_settings
45
-
46
- function = new_settings.get("functionExpr", "").strip()
47
- mode = new_settings.get("mode", "").lower().strip()
48
- xlim = new_settings.get("xlim", [])
49
- ylim = new_settings.get("ylim", [])
50
-
51
- if not self._is_valid_function(function, mode, xlim, ylim):
52
- return {
53
- "trajectoryValues": {"x": [], "y": []},
54
- "functionValues": {"x": [], "y": []},
55
- }
56
-
57
- if non_relayout_settings_changed:
58
- self._reset_trajectory()
59
-
60
- if not self._function_changed(function, mode):
61
- return {
62
- "trajectoryValues": self.trajectory_values,
63
- }
64
-
65
- try:
66
- self._compute_function_values(function, mode, xlim, ylim)
67
- except Exception as e:
68
- self.function_values = {"x": [], "y": []}
69
- self.trajectory_values = {"x": [], "y": []}
70
-
71
- return {
72
- "functionValues": self.function_values,
73
- "trajectoryValues": self.trajectory_values,
74
- }
75
-
76
- def handle_reset(self) -> dict[str, list]:
77
- self._reset_trajectory()
78
- return {
79
- "trajectoryValues": self.trajectory_values,
80
- }
81
-
82
- def handle_next_step(self) -> dict[str, list]:
83
- current_steps = len(self.trajectory_values["x"])
84
- self._compute_trajectory_values(self.settings, current_steps + 1)
85
- return {
86
- "trajectoryValues": self.trajectory_values,
87
- }
88
-
89
- def handle_prev_step(self) -> dict[str, list]:
90
- current_steps = len(self.trajectory_values["x"])
91
- if current_steps > 1:
92
- self._compute_trajectory_values(self.settings, current_steps - 1)
93
- return {
94
- "trajectoryValues": self.trajectory_values,
95
- }
96
-
97
- def handle_play(self) -> dict[str, list]:
98
- pass
99
-
100
- def handle_pause(self) -> dict[str, list]:
101
- pass
102
-
103
- def _is_valid_function(
104
- self, function: str, mode: str, xlim: list, ylim: list
105
- ) -> bool:
106
- # axis limit checks
107
- if len(xlim) != 2 or len(ylim) != 2:
108
- return False
109
- if xlim[0] >= xlim[1] or ylim[0] >= ylim[1]:
110
- return False
111
-
112
- # function expression check
113
- try:
114
- expr = self._parse_function(function)
115
- except Exception as e:
116
- return False
117
-
118
- if mode == "univariate" and symbols("y") in expr.free_symbols:
119
- return False
120
-
121
- return True
122
-
123
- def _function_changed(self, function: str, mode: str) -> bool:
124
- function = function.strip()
125
- previous_function = self.settings.get("function", "").strip()
126
- previous_mode = self.settings.get("mode", "")
127
- return function != previous_function or mode != previous_mode
128
-
129
- def _reset_trajectory(self) -> None:
130
- try:
131
- self._compute_trajectory_values(self.settings, steps=1)
132
- except Exception as e:
133
- self.trajectory_values = {"x": [], "y": []}
134
-
135
- def _parse_function(self, function: str) -> Expr:
136
- if not function.strip():
137
- raise ValueError("Function expression cannot be empty")
138
-
139
- x, y = symbols("x y")
140
- allowed_locals = {
141
- 'x': x,
142
- 'y': y,
143
- 'sin': sin,
144
- 'cos': cos,
145
- 'tan': tan,
146
- 'asin': asin,
147
- 'acos': acos,
148
- 'atan': atan,
149
- 'log': log,
150
- 'ln': log,
151
- 'sqrt': sqrt,
152
- 'abs': Abs,
153
- 'exp': exp,
154
- 'e': exp(1),
155
- 'pi': pi,
156
- 'π': pi,
157
- }
158
-
159
- try:
160
- parsed_function = parse_expr(
161
- function,
162
- local_dict=allowed_locals,
163
- transformations=standard_transformations + (
164
- implicit_multiplication_application,
165
- convert_xor,
166
- ),
167
- evaluate=True,
168
- )
169
- except Exception as e:
170
- raise ValueError(f"Invalid function expression: {e}")
171
-
172
- unknown_symbols = parsed_function.free_symbols - {x, y}
173
- if unknown_symbols:
174
- unknown_names = ", ".join(sorted(str(s) for s in unknown_symbols))
175
- raise ValueError(f"Unknown variable(s): {unknown_names}. Allowed: x, y")
176
-
177
- return parsed_function
178
-
179
- def _compute_function_values(self, function: str, mode: str, xlim: list, ylim: list) -> None:
180
- expr = self._parse_function(function)
181
-
182
- if mode == "univariate":
183
- x = np.linspace(xlim[0], xlim[1], 101)
184
- f = lambdify('x', expr, modules=['numpy'])
185
- y = f(x)
186
-
187
- if not isinstance(y, np.ndarray):
188
- y = np.full_like(x, y)
189
-
190
- self.function_values = {
191
- "x": x.tolist(),
192
- "y": y.tolist(),
193
- }
194
-
195
- elif mode == "bivariate":
196
- x = np.linspace(xlim[0], xlim[1], 101)
197
- y = np.linspace(ylim[0], ylim[1], 101)
198
- X, Y = np.meshgrid(x, y)
199
- f = lambdify(('x', 'y'), expr, modules=['numpy'])
200
- gradient_x = lambdify(('x', 'y'), expr.diff('x'), modules=['numpy'])
201
- gradient_y = lambdify(('x', 'y'), expr.diff('y'), modules=['numpy'])
202
- Z = f(X, Y)
203
- gradient_x_values = gradient_x(X, Y)
204
- gradient_y_values = gradient_y(X, Y)
205
-
206
- if not isinstance(Z, np.ndarray):
207
- Z = np.full_like(X, Z)
208
- if not isinstance(gradient_x_values, np.ndarray):
209
- gradient_x_values = np.full_like(X, gradient_x_values)
210
- if not isinstance(gradient_y_values, np.ndarray):
211
- gradient_y_values = np.full_like(Y, gradient_y_values)
212
-
213
- self.function_values = {
214
- "x": x.tolist(),
215
- "y": y.tolist(),
216
- "z": Z.tolist(),
217
- "gradientX": gradient_x_values.tolist(),
218
- "gradientY": gradient_y_values.tolist(),
219
- }
220
-
221
- else:
222
- raise ValueError("Unsupported mode")
223
-
224
- def _compute_trajectory_values(self, settings: dict, steps: int) -> None:
225
- mode = settings.get("mode", "").lower().strip()
226
- algorithm = settings.get("algorithm", "").lower().strip().replace(" ", "_")
227
- function = self._parse_function(settings.get("functionExpr", "").strip())
228
-
229
- if mode == "univariate":
230
- if algorithm == "gradient_descent":
231
- self.trajectory_values = gd_univariate(
232
- function,
233
- float(settings["x0"]),
234
- float(settings["learningRate"]),
235
- float(settings["momentum"]),
236
- steps,
237
- )
238
- elif algorithm == "nesterov":
239
- self.trajectory_values = nesterov_univariate(
240
- function,
241
- float(settings["x0"]),
242
- float(settings["learningRate"]),
243
- float(settings["momentum"]),
244
- steps,
245
- )
246
- elif algorithm == "adam":
247
- self.trajectory_values = adam_univariate(
248
- function,
249
- float(settings["x0"]),
250
- float(settings["learningRate"]),
251
- float(settings["beta1"]),
252
- float(settings["beta2"]),
253
- float(settings["epsilon"]),
254
- steps,
255
- )
256
- elif algorithm == "adagrad":
257
- self.trajectory_values = adagrad_univariate(
258
- function,
259
- float(settings["x0"]),
260
- float(settings["learningRate"]),
261
- float(settings["epsilon"]),
262
- steps,
263
- )
264
- elif algorithm == "rmsprop":
265
- self.trajectory_values = rmsprop_univariate(
266
- function,
267
- float(settings["x0"]),
268
- float(settings["learningRate"]),
269
- float(settings["beta"]),
270
- float(settings["epsilon"]),
271
- steps,
272
- )
273
- elif algorithm == "adadelta":
274
- self.trajectory_values = adadelta_univariate(
275
- function,
276
- float(settings["x0"]),
277
- float(settings["beta"]),
278
- float(settings["epsilon"]),
279
- steps,
280
- )
281
- elif algorithm == "newton":
282
- self.trajectory_values = newton_univariate(
283
- function,
284
- float(settings["x0"]),
285
- steps,
286
- )
287
- else:
288
- raise ValueError("Unsupported algorithm for univariate mode")
289
-
290
- elif mode == "bivariate":
291
- if algorithm == "gradient_descent":
292
- self.trajectory_values = gd_bivariate(
293
- function,
294
- float(settings["x0"]),
295
- float(settings["y0"]),
296
- float(settings["learningRate"]),
297
- float(settings["momentum"]),
298
- steps,
299
- )
300
- elif algorithm == "nesterov":
301
- self.trajectory_values = nesterov_bivariate(
302
- function,
303
- float(settings["x0"]),
304
- float(settings["y0"]),
305
- float(settings["learningRate"]),
306
- float(settings["momentum"]),
307
- steps,
308
- )
309
- elif algorithm == "adam":
310
- self.trajectory_values = adam_bivariate(
311
- function,
312
- float(settings["x0"]),
313
- float(settings["y0"]),
314
- float(settings["learningRate"]),
315
- float(settings["beta1"]),
316
- float(settings["beta2"]),
317
- float(settings["epsilon"]),
318
- steps,
319
- )
320
- elif algorithm == "adagrad":
321
- self.trajectory_values = adagrad_bivariate(
322
- function,
323
- float(settings["x0"]),
324
- float(settings["y0"]),
325
- float(settings["learningRate"]),
326
- float(settings["epsilon"]),
327
- steps,
328
- )
329
- elif algorithm == "rmsprop":
330
- self.trajectory_values = rmsprop_bivariate(
331
- function,
332
- float(settings["x0"]),
333
- float(settings["y0"]),
334
- float(settings["learningRate"]),
335
- float(settings["beta"]),
336
- float(settings["epsilon"]),
337
- steps,
338
- )
339
- elif algorithm == "adadelta":
340
- self.trajectory_values = adadelta_bivariate(
341
- function,
342
- float(settings["x0"]),
343
- float(settings["y0"]),
344
- float(settings["beta"]),
345
- float(settings["epsilon"]),
346
- steps,
347
- )
348
- elif algorithm == "newton":
349
- self.trajectory_values = newton_bivariate(
350
- function,
351
- float(settings["x0"]),
352
- float(settings["y0"]),
353
- steps,
354
- )
355
- else:
356
- raise ValueError("Unsupported algorithm for bivariate mode")
357
- `,u=`import numpy as np
358
- from sympy import lambdify, Expr
359
-
360
-
361
- def _gradient_values(fx, fy, x: float, y: float) -> list:
362
- return [float(fx(x, y)), float(fy(x, y))]
363
-
364
-
365
- def _hessian_values(fxx, fxy, fyy, x: float, y: float) -> list:
366
- return [
367
- [float(fxx(x, y)), float(fxy(x, y))],
368
- [float(fxy(x, y)), float(fyy(x, y))],
369
- ]
370
-
371
-
372
- def gd_univariate(
373
- function: Expr,
374
- x0: float,
375
- learning_rate: float,
376
- momentum: float,
377
- steps: int,
378
- ) -> dict:
379
- """
380
- Perform gradient descent on a univariate function.
381
-
382
- Assumes function is valid and in terms of x
383
- """
384
- f = lambdify('x', function, modules=['numpy'])
385
- f_prime = lambdify('x', function.diff('x'), modules=['numpy'])
386
- f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy'])
387
-
388
- x_values = [x0]
389
- y_values = [f(x0)]
390
- derivative_values = [f_prime(x0)]
391
- second_derivative_values = [f_prime_prime(x0)]
392
-
393
- x = x0
394
- for i in range(steps - 1):
395
- if i == 0:
396
- m = 0
397
- else:
398
- m = momentum * (x_values[-1] - x_values[-2])
399
-
400
- x = x - learning_rate * f_prime(x) + m
401
- x_values.append(x)
402
- y_values.append(f(x))
403
- derivative_values.append(f_prime(x))
404
- second_derivative_values.append(f_prime_prime(x))
405
-
406
- return {
407
- "x": x_values,
408
- "y": y_values,
409
- "derivative": derivative_values,
410
- "secondDerivative": second_derivative_values,
411
- }
412
-
413
-
414
- def gd_bivariate(
415
- function: Expr,
416
- x0: float,
417
- y0: float,
418
- learning_rate: float,
419
- momentum: float,
420
- steps: int,
421
- ) -> dict:
422
- f = lambdify(('x', 'y'), function, modules=['numpy'])
423
- fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy'])
424
- fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy'])
425
- fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy'])
426
- fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy'])
427
- fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy'])
428
-
429
- x_values = [x0]
430
- y_values = [y0]
431
- z_values = [f(x0, y0)]
432
- gradient_values = [_gradient_values(fx, fy, x0, y0)]
433
- hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)]
434
-
435
- x = x0
436
- y = y0
437
- for i in range(steps - 1):
438
- if i == 0:
439
- mx = 0
440
- my = 0
441
- else:
442
- mx = momentum * (x_values[-1] - x_values[-2])
443
- my = momentum * (y_values[-1] - y_values[-2])
444
-
445
- x_new = x - learning_rate * fx(x, y) + mx
446
- y_new = y - learning_rate * fy(x, y) + my
447
- x = x_new
448
- y = y_new
449
- x_values.append(x)
450
- y_values.append(y)
451
- z_values.append(f(x, y))
452
- gradient_values.append(_gradient_values(fx, fy, x, y))
453
- hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y))
454
-
455
- return {
456
- "x": x_values,
457
- "y": y_values,
458
- "z": z_values,
459
- "gradient": gradient_values,
460
- "hessian": hessian_values,
461
- }
462
-
463
-
464
- def nesterov_univariate(
465
- function: Expr,
466
- x0: float,
467
- learning_rate: float,
468
- momentum: float,
469
- steps: int,
470
- ) -> dict:
471
- f = lambdify('x', function, modules=['numpy'])
472
- f_prime = lambdify('x', function.diff('x'), modules=['numpy'])
473
- f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy'])
474
-
475
- x_values = [x0]
476
- y_values = [f(x0)]
477
- derivative_values = [f_prime(x0)]
478
- second_derivative_values = [f_prime_prime(x0)]
479
-
480
- x = x0
481
- for i in range(steps - 1):
482
- if i == 0:
483
- m = 0
484
- else:
485
- m = momentum * (x_values[-1] - x_values[-2])
486
-
487
- x_lookahead = x + m
488
- x = x_lookahead - learning_rate * f_prime(x_lookahead)
489
-
490
- x_values.append(x)
491
- y_values.append(f(x))
492
- derivative_values.append(f_prime(x))
493
- second_derivative_values.append(f_prime_prime(x))
494
-
495
- return {
496
- "x": x_values,
497
- "y": y_values,
498
- "derivative": derivative_values,
499
- "secondDerivative": second_derivative_values,
500
- }
501
-
502
-
503
- def nesterov_bivariate(
504
- function: Expr,
505
- x0: float,
506
- y0: float,
507
- learning_rate: float,
508
- momentum: float,
509
- steps: int,
510
- ) -> dict:
511
- f = lambdify(('x', 'y'), function, modules=['numpy'])
512
- fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy'])
513
- fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy'])
514
- fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy'])
515
- fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy'])
516
- fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy'])
517
-
518
- x_values = [x0]
519
- y_values = [y0]
520
- z_values = [f(x0, y0)]
521
- gradient_values = [_gradient_values(fx, fy, x0, y0)]
522
- hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)]
523
-
524
- x = x0
525
- y = y0
526
- for i in range(steps - 1):
527
- if i == 0:
528
- mx = 0
529
- my = 0
530
- else:
531
- mx = momentum * (x_values[-1] - x_values[-2])
532
- my = momentum * (y_values[-1] - y_values[-2])
533
-
534
- x_lookahead = x + mx
535
- y_lookahead = y + my
536
-
537
- x = x_lookahead - learning_rate * fx(x_lookahead, y_lookahead)
538
- y = y_lookahead - learning_rate * fy(x_lookahead, y_lookahead)
539
-
540
- x_values.append(x)
541
- y_values.append(y)
542
- z_values.append(f(x, y))
543
- gradient_values.append(_gradient_values(fx, fy, x, y))
544
- hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y))
545
-
546
- return {
547
- "x": x_values,
548
- "y": y_values,
549
- "z": z_values,
550
- "gradient": gradient_values,
551
- "hessian": hessian_values,
552
- }
553
-
554
-
555
- def newton_univariate(
556
- function: Expr,
557
- x0: float,
558
- steps: int,
559
- ) -> dict:
560
- f = lambdify('x', function, modules=['numpy'])
561
- f_prime = lambdify('x', function.diff('x'), modules=['numpy'])
562
- f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy'])
563
-
564
- x_values = [x0]
565
- y_values = [f(x0)]
566
- derivative_values = [f_prime(x0)]
567
- second_derivative_values = [f_prime_prime(x0)]
568
-
569
- x = x0
570
- for i in range(steps - 1):
571
- x = x - f_prime(x) / f_prime_prime(x)
572
- x_values.append(x)
573
- y_values.append(f(x))
574
- derivative_values.append(f_prime(x))
575
- second_derivative_values.append(f_prime_prime(x))
576
-
577
- return {
578
- "x": x_values,
579
- "y": y_values,
580
- "derivative": derivative_values,
581
- "secondDerivative": second_derivative_values,
582
- }
583
-
584
-
585
- def newton_bivariate(
586
- function: Expr,
587
- x0: float,
588
- y0: float,
589
- steps: int,
590
- ) -> dict:
591
- f = lambdify(('x', 'y'), function, modules=['numpy'])
592
- fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy'])
593
- fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy'])
594
- fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy'])
595
- fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy'])
596
- fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy'])
597
-
598
- x_values = [x0]
599
- y_values = [y0]
600
- z_values = [f(x0, y0)]
601
- gradient_values = [_gradient_values(fx, fy, x0, y0)]
602
- hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)]
603
-
604
- x = x0
605
- y = y0
606
- for i in range(steps - 1):
607
- hessian = np.array(
608
- [
609
- [fxx(x, y), fxy(x, y)],
610
- [fxy(x, y), fyy(x, y)],
611
- ],
612
- )
613
- grad = np.array([fx(x, y), fy(x, y)])
614
-
615
- try:
616
- # delta = hessian^-1 * grad
617
- delta = np.linalg.solve(hessian, grad)
618
- except np.linalg.LinAlgError:
619
- # singular hessian - cannot proceed
620
- break
621
-
622
- x = x - delta[0]
623
- y = y - delta[1]
624
-
625
- x_values.append(x)
626
- y_values.append(y)
627
- z_values.append(f(x, y))
628
- gradient_values.append(_gradient_values(fx, fy, x, y))
629
- hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y))
630
-
631
- return {
632
- "x": x_values,
633
- "y": y_values,
634
- "z": z_values,
635
- "gradient": gradient_values,
636
- "hessian": hessian_values,
637
- }
638
-
639
-
640
- def adagrad_univariate(
641
- function: Expr,
642
- x0: float,
643
- learning_rate: float,
644
- epsilon: float,
645
- steps: int,
646
- ) -> dict:
647
- f = lambdify('x', function, modules=['numpy'])
648
- f_prime = lambdify('x', function.diff('x'), modules=['numpy'])
649
- f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy'])
650
-
651
- x_values = [x0]
652
- y_values = [f(x0)]
653
- derivative_values = [f_prime(x0)]
654
- second_derivative_values = [f_prime_prime(x0)]
655
-
656
- x = x0
657
- v = 0 # accumulated squared gradients
658
- for i in range(steps - 1):
659
- g = f_prime(x)
660
- v += g ** 2
661
- x = x - (learning_rate / (np.sqrt(v + epsilon))) * g
662
-
663
- x_values.append(x)
664
- y_values.append(f(x))
665
- derivative_values.append(f_prime(x))
666
- second_derivative_values.append(f_prime_prime(x))
667
-
668
- return {
669
- "x": x_values,
670
- "y": y_values,
671
- "derivative": derivative_values,
672
- "secondDerivative": second_derivative_values,
673
- }
674
-
675
-
676
- def adagrad_bivariate(
677
- function: Expr,
678
- x0: float,
679
- y0: float,
680
- learning_rate: float,
681
- epsilon: float,
682
- steps: int,
683
- ) -> dict:
684
- f = lambdify(('x', 'y'), function, modules=['numpy'])
685
- fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy'])
686
- fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy'])
687
- fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy'])
688
- fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy'])
689
- fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy'])
690
-
691
- x_values = [x0]
692
- y_values = [y0]
693
- z_values = [f(x0, y0)]
694
- gradient_values = [_gradient_values(fx, fy, x0, y0)]
695
- hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)]
696
-
697
- x = x0
698
- y = y0
699
- # accumulated squared gradients
700
- vx = 0
701
- vy = 0
702
- for i in range(steps - 1):
703
- gx = fx(x, y)
704
- gy = fy(x, y)
705
- vx += gx ** 2
706
- vy += gy ** 2
707
-
708
- x = x - (learning_rate / (np.sqrt(vx + epsilon))) * gx
709
- y = y - (learning_rate / (np.sqrt(vy + epsilon))) * gy
710
-
711
- x_values.append(x)
712
- y_values.append(y)
713
- z_values.append(f(x, y))
714
- gradient_values.append(_gradient_values(fx, fy, x, y))
715
- hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y))
716
-
717
- return {
718
- "x": x_values,
719
- "y": y_values,
720
- "z": z_values,
721
- "gradient": gradient_values,
722
- "hessian": hessian_values,
723
- }
724
-
725
-
726
- def rmsprop_univariate(
727
- function: Expr,
728
- x0: float,
729
- learning_rate: float,
730
- beta: float,
731
- epsilon: float,
732
- steps: int,
733
- ) -> dict:
734
- f = lambdify('x', function, modules=['numpy'])
735
- f_prime = lambdify('x', function.diff('x'), modules=['numpy'])
736
- f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy'])
737
-
738
- x_values = [x0]
739
- y_values = [f(x0)]
740
- derivative_values = [f_prime(x0)]
741
- second_derivative_values = [f_prime_prime(x0)]
742
-
743
- x = x0
744
- v = 0 # exponentially weighted average of squared gradients
745
- for i in range(steps - 1):
746
- g = f_prime(x)
747
- v = beta * v + (1 - beta) * g ** 2
748
- x = x - (learning_rate / (np.sqrt(v + epsilon))) * g
749
-
750
- x_values.append(x)
751
- y_values.append(f(x))
752
- derivative_values.append(f_prime(x))
753
- second_derivative_values.append(f_prime_prime(x))
754
-
755
- return {
756
- "x": x_values,
757
- "y": y_values,
758
- "derivative": derivative_values,
759
- "secondDerivative": second_derivative_values,
760
- }
761
-
762
-
763
- def rmsprop_bivariate(
764
- function: Expr,
765
- x0: float,
766
- y0: float,
767
- learning_rate: float,
768
- beta: float,
769
- epsilon: float,
770
- steps: int,
771
- ) -> dict:
772
- f = lambdify(('x', 'y'), function, modules=['numpy'])
773
- fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy'])
774
- fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy'])
775
- fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy'])
776
- fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy'])
777
- fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy'])
778
-
779
- x_values = [x0]
780
- y_values = [y0]
781
- z_values = [f(x0, y0)]
782
- gradient_values = [_gradient_values(fx, fy, x0, y0)]
783
- hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)]
784
-
785
- x = x0
786
- y = y0
787
- # exponentially weighted average of squared gradients
788
- vx = 0
789
- vy = 0
790
- for i in range(steps - 1):
791
- gx = fx(x, y)
792
- gy = fy(x, y)
793
- vx = beta * vx + (1 - beta) * gx ** 2
794
- vy = beta * vy + (1 - beta) * gy ** 2
795
-
796
- x = x - (learning_rate / (np.sqrt(vx + epsilon))) * gx
797
- y = y - (learning_rate / (np.sqrt(vy + epsilon))) * gy
798
-
799
- x_values.append(x)
800
- y_values.append(y)
801
- z_values.append(f(x, y))
802
- gradient_values.append(_gradient_values(fx, fy, x, y))
803
- hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y))
804
-
805
- return {
806
- "x": x_values,
807
- "y": y_values,
808
- "z": z_values,
809
- "gradient": gradient_values,
810
- "hessian": hessian_values,
811
- }
812
-
813
-
814
- def adadelta_univariate(
815
- function: Expr,
816
- x0: float,
817
- beta: float,
818
- epsilon: float,
819
- steps: int,
820
- ) -> dict:
821
- f = lambdify('x', function, modules=['numpy'])
822
- f_prime = lambdify('x', function.diff('x'), modules=['numpy'])
823
- f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy'])
824
-
825
- x_values = [x0]
826
- y_values = [f(x0)]
827
- derivative_values = [f_prime(x0)]
828
- second_derivative_values = [f_prime_prime(x0)]
829
-
830
- x = x0
831
- v = 0 # exponentially weighted average of squared gradients
832
- s = 0 # exponentially weighted average of squared updates
833
- for i in range(steps - 1):
834
- g = f_prime(x)
835
- v = beta * v + (1 - beta) * g ** 2
836
- delta_x = - (np.sqrt(s + epsilon) / np.sqrt(v + epsilon)) * g
837
- x = x + delta_x
838
-
839
- s = beta * s + (1 - beta) * delta_x ** 2
840
-
841
- x_values.append(x)
842
- y_values.append(f(x))
843
- derivative_values.append(f_prime(x))
844
- second_derivative_values.append(f_prime_prime(x))
845
-
846
- return {
847
- "x": x_values,
848
- "y": y_values,
849
- "derivative": derivative_values,
850
- "secondDerivative": second_derivative_values,
851
- }
852
-
853
-
854
- def adadelta_bivariate(
855
- function: Expr,
856
- x0: float,
857
- y0: float,
858
- beta: float,
859
- epsilon: float,
860
- steps: int,
861
- ) -> dict:
862
- f = lambdify(('x', 'y'), function, modules=['numpy'])
863
- fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy'])
864
- fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy'])
865
- fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy'])
866
- fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy'])
867
- fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy'])
868
-
869
- x_values = [x0]
870
- y_values = [y0]
871
- z_values = [f(x0, y0)]
872
- gradient_values = [_gradient_values(fx, fy, x0, y0)]
873
- hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)]
874
-
875
- x = x0
876
- y = y0
877
- # exponentially weighted average of squared gradients
878
- vx = 0
879
- vy = 0
880
- # exponentially weighted average of squared updates
881
- sx = 0
882
- sy = 0
883
- for i in range(steps - 1):
884
- gx = fx(x, y)
885
- gy = fy(x, y)
886
- vx = beta * vx + (1 - beta) * gx ** 2
887
- vy = beta * vy + (1 - beta) * gy ** 2
888
-
889
- delta_x = - (np.sqrt(sx + epsilon) / np.sqrt(vx + epsilon)) * gx
890
- delta_y = - (np.sqrt(sy + epsilon) / np.sqrt(vy + epsilon)) * gy
891
-
892
- x = x + delta_x
893
- y = y + delta_y
894
-
895
- sx = beta * sx + (1 - beta) * delta_x ** 2
896
- sy = beta * sy + (1 - beta) * delta_y ** 2
897
-
898
- x_values.append(x)
899
- y_values.append(y)
900
- z_values.append(f(x, y))
901
- gradient_values.append(_gradient_values(fx, fy, x, y))
902
- hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y))
903
-
904
- return {
905
- "x": x_values,
906
- "y": y_values,
907
- "z": z_values,
908
- "gradient": gradient_values,
909
- "hessian": hessian_values,
910
- }
911
-
912
-
913
- def adam_univariate(
914
- function: Expr,
915
- x0: float,
916
- learning_rate: float,
917
- beta1: float,
918
- beta2: float,
919
- epsilon: float,
920
- steps: int,
921
- ) -> dict:
922
- f = lambdify('x', function, modules=['numpy'])
923
- f_prime = lambdify('x', function.diff('x'), modules=['numpy'])
924
- f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy'])
925
-
926
- x_values = [x0]
927
- y_values = [f(x0)]
928
- derivative_values = [f_prime(x0)]
929
- second_derivative_values = [f_prime_prime(x0)]
930
-
931
- x = x0
932
- m = 0 # first moment
933
- v = 0 # second moment
934
- for i in range(steps - 1):
935
- g = f_prime(x)
936
- m = beta1 * m + (1 - beta1) * g
937
- v = beta2 * v + (1 - beta2) * g ** 2
938
-
939
- m_hat = m / (1 - beta1 ** (i + 1))
940
- v_hat = v / (1 - beta2 ** (i + 1))
941
-
942
- x = x - (learning_rate / (np.sqrt(v_hat) + epsilon)) * m_hat
943
-
944
- x_values.append(x)
945
- y_values.append(f(x))
946
- derivative_values.append(f_prime(x))
947
- second_derivative_values.append(f_prime_prime(x))
948
-
949
- return {
950
- "x": x_values,
951
- "y": y_values,
952
- "derivative": derivative_values,
953
- "secondDerivative": second_derivative_values,
954
- }
955
-
956
-
957
- def adam_bivariate(
958
- function: Expr,
959
- x0: float,
960
- y0: float,
961
- learning_rate: float,
962
- beta1: float,
963
- beta2: float,
964
- epsilon: float,
965
- steps: int,
966
- ) -> dict:
967
- f = lambdify(('x', 'y'), function, modules=['numpy'])
968
- fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy'])
969
- fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy'])
970
- fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy'])
971
- fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy'])
972
- fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy'])
973
-
974
- x_values = [x0]
975
- y_values = [y0]
976
- z_values = [f(x0, y0)]
977
- gradient_values = [_gradient_values(fx, fy, x0, y0)]
978
- hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)]
979
-
980
- x = x0
981
- y = y0
982
- # first moments
983
- mx = 0
984
- my = 0
985
- # second moments
986
- vx = 0
987
- vy = 0
988
- for i in range(steps - 1):
989
- gx = fx(x, y)
990
- gy = fy(x, y)
991
-
992
- mx = beta1 * mx + (1 - beta1) * gx
993
- my = beta1 * my + (1 - beta1) * gy
994
-
995
- vx = beta2 * vx + (1 - beta2) * gx ** 2
996
- vy = beta2 * vy + (1 - beta2) * gy ** 2
997
-
998
- mx_hat = mx / (1 - beta1 ** (i + 1))
999
- my_hat = my / (1 - beta1 ** (i + 1))
1000
-
1001
- vx_hat = vx / (1 - beta2 ** (i + 1))
1002
- vy_hat = vy / (1 - beta2 ** (i + 1))
1003
-
1004
- x = x - (learning_rate / (np.sqrt(vx_hat) + epsilon)) * mx_hat
1005
- y = y - (learning_rate / (np.sqrt(vy_hat) + epsilon)) * my_hat
1006
-
1007
- x_values.append(x)
1008
- y_values.append(y)
1009
- z_values.append(f(x, y))
1010
- gradient_values.append(_gradient_values(fx, fy, x, y))
1011
- hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y))
1012
-
1013
- return {
1014
- "x": x_values,
1015
- "y": y_values,
1016
- "z": z_values,
1017
- "gradient": gradient_values,
1018
- "hessian": hessian_values,
1019
- }
1020
- `;const x="https://cdn.jsdelivr.net/pyodide/v0.26.1/full/pyodide.mjs";let e=null,t=null;async function d(){const{loadPyodide:a}=await import(x);e=await a({indexURL:"https://cdn.jsdelivr.net/pyodide/v0.26.1/full/"}),await e.loadPackage(["numpy","sympy"]),e.FS.writeFile("optimization_logic.py",u),e.FS.writeFile("optimization_manager.py",y),e.runPython("from optimization_manager import OptimizationManager; manager = OptimizationManager();"),t=e.globals.get("manager"),t||console.error("Failed to initialize optimization manager"),self.postMessage({type:"READY"})}function s(a){if(!a)return null;try{const n=a.toJs({dict_converter:Object.fromEntries});a.destroy&&a.destroy(),self.postMessage({type:"RESULT",data:n})}catch(n){console.error("Error handling Python result:",n)}}self.onmessage=async a=>{const n=a.data;if(!t){console.warn("Pyodide is not ready yet");return}switch(n.type){case"COMPARE":{const p=n.settings.map((m,r)=>{const o=e.globals.get("OptimizationManager"),i=o();o.destroy();const f=e.toPy(m);try{i.handle_update_settings(f)?.destroy(),i._compute_trajectory_values(f,n.iteration+1);const l=i.trajectory_values;try{return{id:n.ids[r],values:l.toJs({dict_converter:Object.fromEntries})}}finally{l.destroy()}}catch(l){return{id:n.ids[r],values:{x:[],y:[]},error:String(l)}}finally{f.destroy(),i.destroy()}});self.postMessage({type:"COMPARISON_RESULT",requestId:n.requestId,trajectories:p});break}case"INIT":const _=e.toPy(n.settings);s(t.handle_update_settings(_));break;case"NEXT_STEP":s(t.handle_next_step());break;case"PREV_STEP":s(t.handle_prev_step());break;case"RESET":s(t.handle_reset());break;default:console.error("Unknown message type:",n);break}},d()})();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dist/index.html CHANGED
@@ -4,9 +4,9 @@
4
  <meta charset="UTF-8" />
5
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Optimization</title>
8
- <script type="module" crossorigin src="/assets/index-D36_PHax.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-DSUxBIVD.css">
10
  </head>
11
  <body>
12
  <div id="root"></div>
 
4
  <meta charset="UTF-8" />
5
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Optimisation</title>
8
+ <script type="module" crossorigin src="/assets/index-B28BwTux.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-BO7EriOM.css">
10
  </head>
11
  <body>
12
  <div id="root"></div>
frontends/react/.vite/deps/_metadata.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "hash": "4e23559c",
3
- "configHash": "ed310ce2",
4
- "lockfileHash": "e3b0c442",
5
- "browserHash": "6ecb434a",
6
- "optimized": {},
7
- "chunks": {}
8
- }
 
 
 
 
 
 
 
 
 
frontends/react/.vite/deps/package.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }