aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2024-03-18 21:39:06 +0100
committerNao Pross <np@0hm.ch>2024-03-18 21:39:06 +0100
commit2c0f98afe5ddaea85f8126254f6a163e8d6458d7 (patch)
treee7bdf09284c20bd08e19e625ba1f67b19c9626fa /examples
parentFix regressions from refractor (diff)
downloadmdpoly-2c0f98afe5ddaea85f8126254f6a163e8d6458d7.tar.gz
mdpoly-2c0f98afe5ddaea85f8126254f6a163e8d6458d7.zip
Remove use of replace from example
Diffstat (limited to 'examples')
-rw-r--r--examples/readme.py7
1 files changed, 1 insertions, 6 deletions
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