ProjetPP / PPP-CAS

Computer Algebra System module for the Projet Pensées Profondes
MIT License
2 stars 3 forks source link

ValueError: as_base_exp() missing 1 required positional argument: 'self' #12

Closed progval closed 9 years ago

progval commented 9 years ago

Request \frac{\log{\frac{1}{2}}{2^2}\log{\log{n}} makes the CAS crash:

INFO:router:Request: <PPP node "sentence" {'value': '\\frac{\\log{\\frac{1}{2}}{2^2}\\log{\\log{n}}'}>
ERROR:root:Unknown exception: 
Traceback (most recent call last):
  File "/home/ppp/.local/lib/python3.4/site-packages/ppp_libmodule/http.py", line 97, in on_post
    return self.process_request(request)
  File "/home/ppp/.local/lib/python3.4/site-packages/ppp_libmodule/http.py", line 86, in process_request
    answers = self.router_class(request).answer()
  File "/home/ppp/.local/lib/python3.4/site-packages/ppp_cas/requesthandler.py", line 28, in answer
    outputString, outputLatex=evaluate(self.tree.value)
  File "/home/ppp/.local/lib/python3.4/site-packages/ppp_cas/evaluator.py", line 25, in evaluate
    expr, latex = process(eval_input, inputFormula, timeout=Config().timeout, heap_size=Config().max_heap)
  File "/home/ppp/.local/lib/python3.4/site-packages/ppp_cas/supyprocess.py", line 83, in process
    raise v
ValueError: as_base_exp() missing 1 required positional argument: 'self'
marc-chevalier commented 9 years ago

On which version do you have this error? Le 20/01/2015 10:03, Valentin Lorentz a écrit :

Request |\frac{\log{\frac{1}{2}}{2^2}\log{\log{n}}| makes the CAS crash:

INFO:router:Request: <PPP node "sentence" {'value': '\frac{\log{\frac{1}{2}}{2^2}\log{\log{n}}'}> ERROR:root:Unknown exception: Traceback (most recent call last): File "/home/ppp/.local/lib/python3.4/site-packages/ppp_libmodule/http.py", line 97, in on_post return self.process_request(request) File "/home/ppp/.local/lib/python3.4/site-packages/ppp_libmodule/http.py", line 86, in process_request answers = self.router_class(request).answer() File "/home/ppp/.local/lib/python3.4/site-packages/ppp_cas/requesthandler.py", line 28, in answer outputString, outputLatex=evaluate(self.tree.value) File "/home/ppp/.local/lib/python3.4/site-packages/ppp_cas/evaluator.py", line 25, in evaluate expr, latex = process(eval_input, inputFormula, timeout=Config().timeout, heap_size=Config().max_heap) File "/home/ppp/.local/lib/python3.4/site-packages/ppp_cas/supyprocess.py", line 83, in process raise v ValueError: as_base_exp() missing 1 required positional argument: 'self'

— Reply to this email directly or view it on GitHub https://github.com/ProjetPP/PPP-CAS/issues/12.

Marc Chevalier

ENS de Lyon Site Monod M1 Informatique Fondamentale

progval commented 9 years ago

The last release

On 20/01/2015 10:11, Marc Chevalier wrote:

On which version do you have this error? Le 20/01/2015 10:03, Valentin Lorentz a écrit :

Request |\frac{\log{\frac{1}{2}}{2^2}\log{\log{n}}| makes the CAS crash:

INFO:router:Request: <PPP node "sentence" {'value': '\frac{\log{\frac{1}{2}}{2^2}\log{\log{n}}'}> ERROR:root:Unknown exception: Traceback (most recent call last): File "/home/ppp/.local/lib/python3.4/site-packages/ppp_libmodule/http.py", line 97, in on_post return self.process_request(request) File "/home/ppp/.local/lib/python3.4/site-packages/ppp_libmodule/http.py", line 86, in process_request answers = self.router_class(request).answer() File "/home/ppp/.local/lib/python3.4/site-packages/ppp_cas/requesthandler.py", line 28, in answer outputString, outputLatex=evaluate(self.tree.value) File "/home/ppp/.local/lib/python3.4/site-packages/ppp_cas/evaluator.py", line 25, in evaluate expr, latex = process(eval_input, inputFormula, timeout=Config().timeout, heap_size=Config().max_heap) File "/home/ppp/.local/lib/python3.4/site-packages/ppp_cas/supyprocess.py", line 83, in process raise v ValueError: as_base_exp() missing 1 required positional argument: 'self'

— Reply to this email directly or view it on GitHub https://github.com/ProjetPP/PPP-CAS/issues/12.

Marc Chevalier

ENS de Lyon Site Monod M1 Informatique Fondamentale


Reply to this email directly or view it on GitHub: https://github.com/ProjetPP/PPP-CAS/issues/12#issuecomment-70624176

marc-chevalier commented 9 years ago

I remember you that the last release don't handle LaTeX. So Sympy does not understand it and raise a ValueError. The module catch them now (in a unreleased version) and... ignore them because this kind of error happens when the user write anything with a syntax error or when the module try to eval whereas the entry is not a math formula or... So, there will always be this kind of error. Each time no parser work and the entry is directly sent to Sympy and fail.

Moreover, I hope you know your formula has no meaning: ! File ended while scanning use of \frac . Le 20/01/2015 10:18, Valentin Lorentz a écrit :

The last release

On 20/01/2015 10:11, Marc Chevalier wrote:

On which version do you have this error? Le 20/01/2015 10:03, Valentin Lorentz a écrit :

Request |\frac{\log{\frac{1}{2}}{2^2}\log{\log{n}}| makes the CAS crash:

INFO:router:Request: <PPP node "sentence" {'value': '\frac{\log{\frac{1}{2}}{2^2}\log{\log{n}}'}> ERROR:root:Unknown exception: Traceback (most recent call last): File "/home/ppp/.local/lib/python3.4/site-packages/ppp_libmodule/http.py", line 97, in on_post return self.process_request(request) File "/home/ppp/.local/lib/python3.4/site-packages/ppp_libmodule/http.py", line 86, in process_request answers = self.router_class(request).answer() File "/home/ppp/.local/lib/python3.4/site-packages/ppp_cas/requesthandler.py", line 28, in answer outputString, outputLatex=evaluate(self.tree.value) File "/home/ppp/.local/lib/python3.4/site-packages/ppp_cas/evaluator.py", line 25, in evaluate expr, latex = process(eval_input, inputFormula, timeout=Config().timeout, heap_size=Config().max_heap) File "/home/ppp/.local/lib/python3.4/site-packages/ppp_cas/supyprocess.py", line 83, in process raise v ValueError: as_base_exp() missing 1 required positional argument: 'self'

— Reply to this email directly or view it on GitHub https://github.com/ProjetPP/PPP-CAS/issues/12.

Marc Chevalier

ENS de Lyon Site Monod M1 Informatique Fondamentale


Reply to this email directly or view it on GitHub: https://github.com/ProjetPP/PPP-CAS/issues/12#issuecomment-70624176

— Reply to this email directly or view it on GitHub https://github.com/ProjetPP/PPP-CAS/issues/12#issuecomment-70625022.

Marc Chevalier

ENS de Lyon Site Monod M1 Informatique Fondamentale