Re: [Numpy-discussion] Trying to turn warning to errors

2011-05-17 Thread Ondrej Marsalek
On Fri, May 13, 2011 at 21:15, Ondrej Marsalek wrote: > On Fri, May 13, 2011 at 18:54, Pauli Virtanen wrote: >> Fri, 13 May 2011 17:39:26 +0200, Ondrej Marsalek wrote: >> [clip] >>> while this does not (i.e. still produces just a warning): >>> >>> $ python -W error -c 'import numpy; x=numpy.ones(

Re: [Numpy-discussion] Trying to turn warning to errors

2011-05-13 Thread Ondrej Marsalek
On Fri, May 13, 2011 at 18:54, Pauli Virtanen wrote: > Fri, 13 May 2011 17:39:26 +0200, Ondrej Marsalek wrote: > [clip] >> while this does not (i.e. still produces just a warning): >> >> $ python -W error -c 'import numpy; x=numpy.ones(2); x+=1j' >> numpy.core.numeric.ComplexWarning: Casting compl

Re: [Numpy-discussion] Trying to turn warning to errors

2011-05-13 Thread Pauli Virtanen
Fri, 13 May 2011 17:39:26 +0200, Ondrej Marsalek wrote: [clip] > while this does not (i.e. still produces just a warning): > > $ python -W error -c 'import numpy; x=numpy.ones(2); x+=1j' > numpy.core.numeric.ComplexWarning: Casting complex values to real > discards the imaginary part > > This is

[Numpy-discussion] Trying to turn warning to errors

2011-05-13 Thread Ondrej Marsalek
Dear all, I am trying to turn Python warnings to errors, but it does not work as expected with numpy. The following two piece of code work: $ python -W error -c 'import warnings; import numpy; warnings.warn("test", numpy.core.numeric.ComplexWarning)' Traceback (most recent call last): File "",