Test: separate expression build and showing it
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Bertrand Benjamin 2020-08-21 19:07:34 +02:00
parent 0cadc6734e
commit 7f8939eab2

View File

@ -136,9 +136,11 @@ class Expression(object):
:returns: TODO :returns: TODO
:example: :example:
>>> Expression.random("{a}/{a*k}") # doctest: +SKIP >>> e = Expression.random("{a}/{a*k}")
>>> e # doctest: +SKIP
<Exp: -3 / -15> <Exp: -3 / -15>
>>> Expression.random("{a}/{a*k} - 3*{b}", variables_scope={'a':{'min_max':(10, 30)}}) # doctest: +SKIP >>> e = Expression.random("{a}/{a*k} - 3*{b}", variables_scope={'a':{'min_max':(10, 30)}})
>>> e # doctest: +SKIP
<Exp: 18 / 108 - 3 * 9> <Exp: 18 / 108 - 3 * 9>
>>> e = Expression.random("{a}*x + {b}*x + 3", ["a>b"], rejected=[0, 1]) >>> e = Expression.random("{a}*x + {b}*x + 3", ["a>b"], rejected=[0, 1])
>>> ee = e.simplify() >>> ee = e.simplify()