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

9 statements  

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

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)