Re: [sympy] Should symbolic integration fail gracefully?

2019-08-22 Thread Oscar Gustafsson
The bug was fixed in https://github.com/sympy/sympy/pull/17343 but is not
merged (yet).

Hopefully it happens soon.

BR Oscar


Den ons 21 aug. 2019 20:33Aaron Meurer  skrev:

> On Wed, Aug 21, 2019 at 3:10 AM David Bailey  wrote:
> >
> > On 20/08/2019 23:35, Oscar Benjamin wrote:
> >
> > Hi David,
> >
> > Can you open an issue on Github please. That's a bug that should be
> fixed.
> >
> > The problem is, I tried to join Github a while back, and then needed a
> password reset. It said it had sent me an email to reset my password, but
> it never appeared (and I looked in junk). After that happened several
> times, I gave up.
> >
> > However, if that problem is already solved, that's fine, I was really
> just reporting it - I suspect the integral doesn't have a closed form for
> variable n. Do you release beta tests of the next version of sympy?
>
> We don't do builds, but you can clone the git version of SymPy and try
> it. If you run Python from within the repo directory, it will import
> the git version. Since SymPy is pure Python there are no builds
> required.
>
> Aaron Meurer
>
> >
> > Or did you mean 'should' in the sense of 'needs to be'?
> >
> > David
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "sympy" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to sympy+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/1e134532-2e6a-6f55-f5da-19d73cc978bf%40dbailey.co.uk
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAKgW%3D6Lc%2BZ%2Bd-8dawVzH3h8NwpZvFvyothm1p01vSZidL%3DQbxA%40mail.gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAFjzj-KcoOMKeaz-8p_d1G%3DT0Fhg9nYdRJrpsJaikdFsz0dzoQ%40mail.gmail.com.


Re: [sympy] Should symbolic integration fail gracefully?

2019-08-21 Thread Aaron Meurer
On Wed, Aug 21, 2019 at 3:10 AM David Bailey  wrote:
>
> On 20/08/2019 23:35, Oscar Benjamin wrote:
>
> Hi David,
>
> Can you open an issue on Github please. That's a bug that should be fixed.
>
> The problem is, I tried to join Github a while back, and then needed a 
> password reset. It said it had sent me an email to reset my password, but it 
> never appeared (and I looked in junk). After that happened several times, I 
> gave up.
>
> However, if that problem is already solved, that's fine, I was really just 
> reporting it - I suspect the integral doesn't have a closed form for variable 
> n. Do you release beta tests of the next version of sympy?

We don't do builds, but you can clone the git version of SymPy and try
it. If you run Python from within the repo directory, it will import
the git version. Since SymPy is pure Python there are no builds
required.

Aaron Meurer

>
> Or did you mean 'should' in the sense of 'needs to be'?
>
> David
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/1e134532-2e6a-6f55-f5da-19d73cc978bf%40dbailey.co.uk.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6Lc%2BZ%2Bd-8dawVzH3h8NwpZvFvyothm1p01vSZidL%3DQbxA%40mail.gmail.com.


Re: [sympy] Should symbolic integration fail gracefully?

2019-08-21 Thread Oscar Benjamin
I've opened an issue:
https://github.com/sympy/sympy/issues/17473

On Wed, 21 Aug 2019 at 12:11, Oscar Benjamin  wrote:
>
> On Wed, 21 Aug 2019 at 11:50, David Bailey  wrote:
> >
> > On 20/08/2019 21:10, Aaron Meurer wrote:
> >
> > "TypeError: cannot determine truth value of Relational" generally
> > indicates a bug in SymPy. And yes, integrate() should always return
> > unevaluated when it can't compute the integral.
> >
> > I imagine that symbolic integration may be littered by tricky problems of 
> > this sort, and I wonder if the integrate code should be wrapped in some 
> > sort of exception handler so that it exits and returns unevaluated.
>
> I think that would hide all kinds of bugs. It's better to see the
> exception and fix the code. Maybe after that check (if it didn't
> raise) something more useful could be done than return unevaluated.
>
> Oscar

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAHVvXxSd%2BqshV%2BYPmd0yXbi58rrMNg0Dsrwzwn44T_has4vUEQ%40mail.gmail.com.


Re: [sympy] Should symbolic integration fail gracefully?

2019-08-21 Thread Oscar Benjamin
On Wed, 21 Aug 2019 at 11:50, David Bailey  wrote:
>
> On 20/08/2019 21:10, Aaron Meurer wrote:
>
> "TypeError: cannot determine truth value of Relational" generally
> indicates a bug in SymPy. And yes, integrate() should always return
> unevaluated when it can't compute the integral.
>
> I imagine that symbolic integration may be littered by tricky problems of 
> this sort, and I wonder if the integrate code should be wrapped in some sort 
> of exception handler so that it exits and returns unevaluated.

I think that would hide all kinds of bugs. It's better to see the
exception and fix the code. Maybe after that check (if it didn't
raise) something more useful could be done than return unevaluated.

Oscar

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAHVvXxTn1Qm0kOO%3DAbO3mFPPb-GgWG%3D0Zr6pk2tenf21jJsy7w%40mail.gmail.com.


Re: [sympy] Should symbolic integration fail gracefully?

2019-08-21 Thread David Bailey

On 20/08/2019 21:10, Aaron Meurer wrote:

"TypeError: cannot determine truth value of Relational" generally
indicates a bug in SymPy. And yes, integrate() should always return
unevaluated when it can't compute the integral.

I imagine that symbolic integration may be littered by tricky problems 
of this sort, and I wonder if the integrate code should be wrapped in 
some sort of exception handler so that it exits and returns unevaluated.


David

--
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/05f60edd-ef02-030b-b14e-fb7afcd45945%40dbailey.co.uk.


Re: [sympy] Should symbolic integration fail gracefully?

2019-08-21 Thread David Bailey

On 20/08/2019 23:35, Oscar Benjamin wrote:

Hi David,

Can you open an issue on Github please. That's a bug that should be fixed.

The problem is, I tried to join Github a while back, and then needed a 
password reset. It said it had sent me an email to reset my password, 
but it never appeared (and I looked in junk). After that happened 
several times, I gave up.


However, if that problem is already solved, that's fine, I was really 
just reporting it - I suspect the integral doesn't have a closed form 
for variable n. Do you release beta tests of the next version of sympy?


Or did you mean 'should' in the sense of 'needs to be'?

David

--
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/1e134532-2e6a-6f55-f5da-19d73cc978bf%40dbailey.co.uk.


Re: [sympy] Should symbolic integration fail gracefully?

2019-08-20 Thread Oscar Benjamin
Hi David,

Can you open an issue on Github please. That's a bug that should be fixed.

Oscar

On Tue, 20 Aug 2019 at 21:08, David Bailey  wrote:
>
> It seems as though the symbolic integration process fails when it can't find 
> a solution:
>
>  integrate(sin(x**n),x)
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "C:\SymPyWorkbook\lib\site-packages\sympy\integrals\integrals.py", 
> line 1477, in integrate
> return integral.doit(**doit_flags)
>   File "C:\SymPyWorkbook\lib\site-packages\sympy\integrals\integrals.py", 
> line 541, in doit
> function, xab[0], **eval_kwargs)
>   File "C:\SymPyWorkbook\lib\site-packages\sympy\integrals\integrals.py", 
> line 1012, in _eval_integral
> h = meijerint_indefinite(g, x)
>   File "C:\SymPyWorkbook\lib\site-packages\sympy\integrals\meijerint.py", 
> line 1621, in meijerint_indefinite
> res = _meijerint_indefinite_1(f.subs(x, x + a), x)
>   File "C:\SymPyWorkbook\lib\site-packages\sympy\integrals\meijerint.py", 
> line 1684, in _meijerint_indefinite_1
> if b < 0 or f.subs(x, 0).has(nan, zoo):
>   File "C:\SymPyWorkbook\lib\site-packages\sympy\core\relational.py", line 
> 304, in __nonzero__
> raise TypeError("cannot determine truth value of Relational")
> TypeError: cannot determine truth value of Relational
>
> I suppose I expected it to return an unevaluated integral -  
> integral(sin(x**n),x)
>
> David
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/b15c771c-5051-225d-bd0d-a655b6952de0%40dbailey.co.uk.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAHVvXxTQHmn3WgR5UdaXaR7Cv5aedv_rUS8J6ecBk0YxbvsYCw%40mail.gmail.com.


Re: [sympy] Should symbolic integration fail gracefully?

2019-08-20 Thread Aaron Meurer
"TypeError: cannot determine truth value of Relational" generally
indicates a bug in SymPy. And yes, integrate() should always return
unevaluated when it can't compute the integral.

Aaron Meurer

On Tue, Aug 20, 2019 at 2:08 PM David Bailey  wrote:
>
> It seems as though the symbolic integration process fails when it can't find 
> a solution:
>
>  integrate(sin(x**n),x)
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "C:\SymPyWorkbook\lib\site-packages\sympy\integrals\integrals.py", 
> line 1477, in integrate
> return integral.doit(**doit_flags)
>   File "C:\SymPyWorkbook\lib\site-packages\sympy\integrals\integrals.py", 
> line 541, in doit
> function, xab[0], **eval_kwargs)
>   File "C:\SymPyWorkbook\lib\site-packages\sympy\integrals\integrals.py", 
> line 1012, in _eval_integral
> h = meijerint_indefinite(g, x)
>   File "C:\SymPyWorkbook\lib\site-packages\sympy\integrals\meijerint.py", 
> line 1621, in meijerint_indefinite
> res = _meijerint_indefinite_1(f.subs(x, x + a), x)
>   File "C:\SymPyWorkbook\lib\site-packages\sympy\integrals\meijerint.py", 
> line 1684, in _meijerint_indefinite_1
> if b < 0 or f.subs(x, 0).has(nan, zoo):
>   File "C:\SymPyWorkbook\lib\site-packages\sympy\core\relational.py", line 
> 304, in __nonzero__
> raise TypeError("cannot determine truth value of Relational")
> TypeError: cannot determine truth value of Relational
>
> I suppose I expected it to return an unevaluated integral -  
> integral(sin(x**n),x)
>
> David
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/b15c771c-5051-225d-bd0d-a655b6952de0%40dbailey.co.uk.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6LG7f_-wCdUF1kvdo5VvoiyDGciGbcQ9RfzC7j6%2BQz4GA%40mail.gmail.com.