Re: PyNGL & PyNIO version error

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Tue Jul 19 2011 - 16:02:14 MDT

Hi Gary,
This is a known bug that will be fixed in the new release which is coming soon. You can fix it with the following modification to the source:
Change:

v = int(d[0]) * 10000 + int(d[1]) * 100 + int(d[2])

to

v = int(d[0]) * 10000 + int(d[1]) * 100 + int(d[2][0])

Note this line occurs both in Ngl.py for PyNGL and in Nio.py for PyNIO.
Jeff's diagnosis is correct. This fix gets rid of the non-numeric characters. It does assume that the minor release number is a single digit.
 -dave

On Jul 19, 2011, at 3:13 PM, gary.bates@noaa.gov wrote:

> hi,
> I'm getting this msg from both Nio and Ngl today. The Nio error is
> occurring in a cron script I've been running daily for many months.
>
>> batchb> /usr/local/bin/python
>> Python 2.5.5 (r255:77872, Oct 8 2010, 15:05:10)
>> [GCC 4.4.4] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> import Ngl
>> Traceback (most recent call last):
>> File "<stdin>", line 1, in <module>
>> File "/usr/local/lib/python2.5/site-packages/PyNGL/Ngl.py", line 100, in
>> <module>
>> IS_NEW_MA = _get_integer_version(numpy.__version__) > 10004
>> File "/usr/local/lib/python2.5/site-packages/PyNGL/Ngl.py", line 97, in
>> _get_integer_version
>> v = int(d[0]) * 10000 + int(d[1]) * 100 + int(d[2])
>> ValueError: invalid literal for int() with base 10: '1rc3'
>
> I'm getting this error on a linux machine. Can I just comment out this
> line to get around it?
>
> Thanks,
> Gary
>
> From: Jeff Whitaker <Jeffrey.S.Whitaker@noaa.gov>
> Date: July 19, 2011 1:57:48 PM MDT
> To: Gary Bates <gary.bates@noaa.gov>
> Cc: Barry J Mcinnes <Barry.J.Mcinnes@noaa.gov>
> Subject: Re: pygrib on batchb
>
>
> On 7/19/11 1:26 PM, Gary Bates wrote:
>> Jeff,
>> pygrib is fine batchb, but there's something wrong with version # of Ngl:
>>
>> batchb> /usr/local/bin/python
>> Python 2.5.5 (r255:77872, Oct 8 2010, 15:05:10)
>> [GCC 4.4.4] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> import Ngl
>> Traceback (most recent call last):
>> File "<stdin>", line 1, in <module>
>> File "/usr/local/lib/python2.5/site-packages/PyNGL/Ngl.py", line 100, in
>> <module>
>> IS_NEW_MA = _get_integer_version(numpy.__version__) > 10004
>> File "/usr/local/lib/python2.5/site-packages/PyNGL/Ngl.py", line 97, in
>> _get_integer_version
>> v = int(d[0]) * 10000 + int(d[1]) * 100 + int(d[2])
>> ValueError: invalid literal for int() with base 10: '1rc3'
>>
>>
>> My script works with python2.6.6 on the macs. What if we installed that
>> on batchb?
>>
>> -Gary
>
>
> Looks like a bug in PyNGL (it's trying to apply int to a numpy version string with non-numeric chars in it). Perhaps it works on the macs because the numpy version does not have 'rc3' in it?
>
> How about using matplotlib/basemap for plotting (it's installed on batchb)?
>
> -Jeff
>
> --
> Jeffrey S. Whitaker Phone : (303)497-6313
> Meteorologist FAX : (303)497-6449
> NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@noaa.gov
> 325 Broadway Office : Skaggs Research Cntr 1D-113
> Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
>
>
> _______________________________________________
> pyngl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk

_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Tue Jul 19 16:02:21 2011

This archive was generated by hypermail 2.1.8 : Fri Jul 29 2011 - 08:51:37 MDT