[obspy-users] Suppressing warning from obspy.signal

Hearne, Mike mhearne at usgs.gov
Mon Apr 14 18:48:00 CEST 2014


Tobias - Thank you for your response.  However, I am writing this code
for others to use, and it is disconcerting for non-Python developers
to see warnings pop up, and then annoying when they feel compelled to
report it back to me.

For this same reason, it is impractical to delete the offending line
in the oldnumeric init script, as I cannot expect my users to do that,
nor am I able to do it for all of them.

I am confused about what is making this warning pop up, because I
could find no explicit calls to oldnumeric in the obspy code, although
I did find imports of modules that *do* make explicit calls to
oldnumeric (fft, linear_algebra, etc.)

Also, if I import obspy.signal.filter, I get the error, but if I
import all of the packages that filter imports, I do NOT get the
warning.  Also, if I import numpy.oldnumeric directly, I do not get
the warning.

I'll post my question on the numpy mailing list and see if anyone
there has any tips.

Thanks,

Mike

On Mon, Apr 14, 2014 at 9:04 AM, Tobias Megies
<megies at geophysik.uni-muenchen.de> wrote:
> You can just ignore this warning (unless you explicitely use the oldnumeric,
> obviously).
>
> Simplest is to open the numpy file as indicated
> (/Users/mhearne/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/oldnumeric/__init__.py)
> and delete line 11 which raises the warning.
>
> best,
> Tobias
>
>
> On 13/04/14 21:14, Hearne, Mike wrote:
>>
>> If I import any module in obspy.signal, I get a numpy warning about
>> oldnumeric:
>>
>>
>> /Users/mhearne/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/oldnumeric/__init__.py:11:
>> ModuleDeprecationWarning: The oldnumeric module will be dropped in
>> Numpy 1.9
>>    warnings.warn(_msg, ModuleDeprecationWarning)
>>
>> I looked around for tips on how to suppress warnings, but none of the
>> suggestions I found seem to work.  At the end of the email is what I
>> thought would work.
>>
>> I have two questions:
>> 1) What is causing this warning?
>> 2) How can I suppress this warning?
>>
>> My system information:
>> OS: Mac 10.7.5
>> Python version: 2.7.6 (from Enthought)
>> Numpy version: 1.8.1
>> Obspy version: 0.9.0
>>
>> #!/usr/bin/env python
>>
>> import warnings
>> warnings.filterwarnings("ignore")
>> import obspy.signal
>>
>> if __name__ == '__main__':
>>      pass
>> _______________________________________________
>> obspy-users mailing list
>> obspy-users at lists.swapbytes.de
>> http://lists.swapbytes.de/mailman/listinfo/obspy-users
>>
>
> --
> Dipl.-Geophys. Tobias Megies
>
> Geophysikalisches Observatorium
> Ludwigshöhe 8
> 82256 Fürstenfeldbruck
>
> Ludwig-Maximilians-Universität
> Department für Geo- und Umweltwissenschaften
> Sektion Geophysik
> Theresienstrasse 41/IV
> 80333 München
>
> Tel: +49 (0) 89 2180-73981
>      +49 (0) 89 2180-4326
> Mail: tobias.megies at geophysik.uni-muenchen.de
> _______________________________________________
> obspy-users mailing list
> obspy-users at lists.swapbytes.de
> http://lists.swapbytes.de/mailman/listinfo/obspy-users


More information about the obspy-users mailing list