Re: [sympy] Interest in adding timeout argument to potentially long running calls (potential implementation included)?

2014-10-24 Thread Joachim Durchholz
I have thought a bit more, and it *would* open up using SymPy inside other applications (GUIs, as part of an array of problem solvers, whatever). Can't name any concrete killer app, but making a piece of software more generally useful and seeing what people make of it is always a good idea. I

Re: [sympy] Interest in adding timeout argument to potentially long running calls (potential implementation included)?

2014-10-24 Thread Joachim Durchholz
Am 23.10.2014 um 22:06 schrieb James Crist: What's "composable" in this context? Easy to write without intruding too much into the actual function. OK That would not affect SymPy itself, as it is not multithreaded. No, but it would affect anything that tried to run sympy functions th

Re: [sympy] Interest in adding timeout argument to potentially long running calls (potential implementation included)?

2014-10-23 Thread James Crist
A second proof of concept PR, this time using a context manager. I actually like this more, but it has its own issues as well. https://github.com/sympy/sympy/pull/8297 On Thursday, October 23, 2014 4:14:27 PM UTC-5, James Crist wrote: > > Proof of concept PR here

Re: [sympy] Interest in adding timeout argument to potentially long running calls (potential implementation included)?

2014-10-23 Thread James Crist
Proof of concept PR here . Adding a timeout for each function took not that much code, but it seems the functions in `fu` are slowed down more by `expand` than anything. Continuing to propogate timeout throughout the codebase could work, but I don't fee

Re: [sympy] Interest in adding timeout argument to potentially long running calls (potential implementation included)?

2014-10-23 Thread James Crist
> > What's "composable" in this context? > Easy to write without intruding too much into the actual function. That would not affect SymPy itself, as it is not multithreaded. No, but it would affect anything that tried to run sympy functions that use this in a separate thread. > It shoul

Re: [sympy] Interest in adding timeout argument to potentially long running calls (potential implementation included)?

2014-10-23 Thread Joachim Durchholz
Am 23.10.2014 um 20:23 schrieb James Crist: However, this isn't the easiest thing to do in Python. The best *composable* option What's "composable" in this context? > is to use signal.alarm, which is only available on *NIX systems. This can also cause problems with threaded applications. Th

[sympy] Interest in adding timeout argument to potentially long running calls (potential implementation included)?

2014-10-23 Thread James Crist
For the large expressions that we see in `mechanics`, calls to `simplify` can take an extremely long time. However, for simple expressions, simplification is desirable. Currently we don't simplify by default inside any of our library code, as it's impossible to tell whether the expression can b