Commit 80befacb by Peter Baratta

Seperate out parsing from calc.py

calc.py:
-Create a method called `parse_algebra`. It takes a string of math and returns with a `pyparsing.ParseResults` object representing it.
-`evaluator` takes this tree and applies the old "parse actions" to it to get the same number as it used to.
-Change a few things in the parse actions (i.e. rename them to eval actions)
-Add `atom_parse_action`
-Add `find_vars_funcs` to aggregate used functions and vars in the tree
-Change strategy of `check_variables` to instead take the set difference of `find_vars_funcs` with the allowed ones
-Create `add_defaults` to take user defined lists of vars and funcs and return a combined list
-Change `x.setResultsName(...)` to `x(...)` for brevity

In test_calc.py:
-Fix a bad test (which expected something to pass that shouldn't)
-Fix indentation
parent 0f9d7230
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment