From a1608a20d12baadcb1c70a35897328adacd0a14f Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Tue, 15 Dec 2020 14:36:39 +0100 Subject: [PATCH] Feat: add test on what doesn't work! --- mapytex/calculus/API/__init__.py | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/mapytex/calculus/API/__init__.py b/mapytex/calculus/API/__init__.py index 5539a3f..361cb7b 100644 --- a/mapytex/calculus/API/__init__.py +++ b/mapytex/calculus/API/__init__.py @@ -108,13 +108,12 @@ x^7 (6 + 6) * x + 4x^2 + 9 4x^2 + 12x + 9 ->>> e = Expression.from_str("(2x+3)(-x+1)") +>>> e = Expression.from_str("(2x-3)(-x+2)") >>> e_simplified = e.simplify() >>> e_simplified - + >>> for s in e_simplified.explain(): ... print(s) - """ from .expression import Expression @@ -155,19 +154,12 @@ def set_render(render): if __name__ == "__main__": - e = Expression.from_str("1+2/3/4/5") - et = e._typing() - print("typing") - print(e._tree) - e = et._order() - print("order") - print(e._tree) - e = e._optimize() - print("then optimize") - print(e._tree) - e = et._optimize() - print("optimize without order") - print(e._tree) + e = Expression.from_str("(2x-3)(-x+2)") + e_simplified = e.simplify() + e_simplified + for s in e_simplified.explain(): + print(s._tree.map_on_leaf(lambda x: type(x))) + print(s) # ----------------------------- # Reglages pour 'vim'