Coverage for docs/source/examples/substitutions.py: 100%
6 statements
« prev ^ index » next coverage.py v7.4.0, created at 2024-01-03 16:49 -0500
« prev ^ index » next coverage.py v7.4.0, created at 2024-01-03 16:49 -0500
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