Coverage for docs/source/examples/substitutions.py: 100%
6 statements
« prev ^ index » next coverage.py v6.4.2, created at 2022-07-28 11:50 -0400
« prev ^ index » next coverage.py v6.4.2, created at 2022-07-28 11:50 -0400
1"Example substitution; adapted from t_sub.py/t_NomialSubs /test_Basic"
2from gpkit import Variable
3x = Variable("x")
4p = x**2
5assert p.sub({x: 3}) == 9
6assert p.sub({x.key: 3}) == 9
7assert p.sub({"x": 3}) == 9