Skip to content

Commit

Permalink
remove extra parens
Browse files Browse the repository at this point in the history
  • Loading branch information
whoburg committed Jan 8, 2024
1 parent f405051 commit 2da6324
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/source/examples/gettingstarted.py
Expand Up @@ -46,7 +46,7 @@
y = Variable("y", "m")
z = Variable("z", "m")
S = Variable("S", 1.0, "m^2")
c = (2*x*y + 2*x*z + 2*y*z <= S)
c = 2*x*y + 2*x*z + 2*y*z <= S
assert isinstance(c, PosynomialInequality)

### Example Formulating a Model
Expand All @@ -66,7 +66,7 @@
print(sol.table())

### Printing Results 2
print("The optimal value is %.4g." % sol["cost"])
print("The optimal value is {sol[cost]:.4g}.")

### Example variable sensitivity usage
x = Variable("x")
Expand Down
6 changes: 3 additions & 3 deletions docs/source/examples/vectorization.py
Expand Up @@ -7,6 +7,6 @@
x = VectorVariable(2, "x")
z = VectorVariable(7, "z")

assert(y.shape == (5, 3))
assert(x.shape == (2, 5, 3))
assert(z.shape == (7, 3))
assert y.shape == (5, 3)
assert x.shape == (2, 5, 3)
assert z.shape == (7, 3)
2 changes: 1 addition & 1 deletion docs/source/examples/water_tank.py
Expand Up @@ -8,7 +8,7 @@
d = VectorVariable(3, "d", "m", "Dimension Vector")

# because its units are incorrect the line below will print a warning
bad_monomial_equality = (M == V)
bad_monomial_equality = M == V

constraints = (A >= 2*(d[0]*d[1] + d[0]*d[2] + d[1]*d[2]),
V == d[0]*d[1]*d[2],
Expand Down

0 comments on commit 2da6324

Please sign in to comment.