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

9 statements  

« prev     ^ index     » next       coverage.py v6.4.2, created at 2022-07-28 12:37 -0400

1"Example Vectorize usage, from gpkit/tests/t_vars.py" 

2from gpkit import Variable, Vectorize, VectorVariable 

3 

4with Vectorize(3): 

5 with Vectorize(5): 

6 y = Variable("y") 

7 x = VectorVariable(2, "x") 

8 z = VectorVariable(7, "z") 

9 

10assert(y.shape == (5, 3)) 

11assert(x.shape == (2, 5, 3)) 

12assert(z.shape == (7, 3))