From 2c0f98afe5ddaea85f8126254f6a163e8d6458d7 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Mon, 18 Mar 2024 21:39:06 +0100 Subject: Remove use of replace from example --- examples/readme.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'examples') diff --git a/examples/readme.py b/examples/readme.py index 82a27d8..8cf626c 100644 --- a/examples/readme.py +++ b/examples/readme.py @@ -14,12 +14,7 @@ x, y = Variable.from_names("x, y") # or just Variable("x") k = Parameter("k") p = (x + 2 * y) ** 3 + y ** 2 + k -print(f"{p = }") - -# Expressions can be easily reparametrized -w = Parameter("w") -q = p.replace(y, w).replace(k, k ** 2) -print(f"{q = }") +print(f"{str(p) = }") # Make a concrete representation state = State(parameters={k: 3.14}) # try to replace with empty dict -- cgit v1.2.1