Closed ChristopherChudzicki closed 6 years ago
Looks fine to me.
Ah. I've had second thoughts... We shouldn't give this message for vecv/2/pi
...
We don't, but I think I see what you mean. Currently:
from mitxgraders.helpers.calc import evaluator, MathArray
variables = {
'i': MathArray([1, 0]),
'j': MathArray([0, 1]),
}
result = evaluator("i/i*i", variables)[0]
# raises
# Multiplying three or more vectors is ambiguous. Please place parentheses around vector multiplications.
# but should raise
# something above not dividing vectors.
raises an error, but it should just give MathArray([1, 0, 0])
raises the wrong error.
Haha, ok ;-)
Resolves #108
Error message is potentially confusing in large expressions. Would be great if
parse_results
included the original string so we could show students what string caused the error. One day, maybe... !