implement sympy as plugin (CAS-System) #384
base: master
Are you sure you want to change the base?
Conversation
Whaou, nice ! Some notes :
We need a way to have engine without HTTP request (perhaps sympy parsing is done after all requests and slow down the global response time). |
Another thing : Perhaps add a line break between the results ? |
One more thing : there is no timeout a equation like |
yes, but I don't know how to do it properly (From what I found out, there is no clear way in python to handle timeouts of functions): http://eli.thegreenplace.net/2011/08/22/how-not-to-set-a-timeout-on-a-computation-in-python/ |
ok, I found out using signals would be working for sympy, but we cannot use them in threads: I tried to implement https://stackoverflow.com/questions/323972/is-there-any-way-to-kill-a-thread-in-python, but I didn't got it working. Any other idea? |
I would recommand that you try to do it the hard way : |
any updaye? looks like an awesome idea |
Any chance it will be merged any time soon? |
I'll give this one a bump. I think this would be a nice extra especially for users switching from popular search engines to searx. Is it only the review that is missing or does it actually need extra code? I would certainly try to help, but I'm not very proficient when it comes to threads in python, |
I really wish this could be integrated. Whenever I have to do quick maths I used to type it in the browser bar and any search engine would return the results but now I have to start the good old calculator app (or worse! use my BRAIN! hehehe) Is there any reason it's taking so long to get integrated? Is there anything we could do about it? Having complex calculation support would be great but I don't believe it's needed for a first step towards integrating arithmetic into the engine. |
In order not to end up in a dead end, we should first consider how best to embed such tools into the search syntax. See my comment at PR1146. |
I implemented a Computer Algebra System as plugin, using SymPy.
current Features:
1+2*3/5
,sin(1)
,sqrt(2)
,...15*a+3=30
,sin(3)=x*2
,...integral of sin(x) dx
,integrate e^2*x dx
,...TODO:
Because I have to use MathML for formating, I changed the answere system to work more similare linke the results (to allow different key-value pairs). Now Answers could contain html-code, or simple text. I think we should improve the answere system in the future, to allow things like thumbnails,...