Coverage for docs/source/examples/tight_constraintsets.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.4.0, created at 2024-01-07 22:13 -0500

1"Example Tight ConstraintSet usage" 

2from gpkit import Variable, Model 

3from gpkit.constraints.tight import Tight 

4 

5Tight.reltol = 1e-2 # set the global tolerance of Tight 

6x = Variable('x') 

7x_min = Variable('x_{min}', 2) 

8m = Model(x, [Tight([x >= 1], reltol=1e-3), # set the specific tolerance 

9 x >= x_min]) 

10m.solve(verbosity=0) # prints warning