Author: bugman Date: Tue Mar 5 16:40:28 2013 New Revision: 18646 URL: http://svn.gna.org/viewcvs/relax?rev=18646&view=rev Log: Updated the float module to handle numpy floats. This makes the floatToBinaryString() function compatible with the numpy.float16 type. Modified: trunk/float.py Modified: trunk/float.py URL: http://svn.gna.org/viewcvs/relax/trunk/float.py?rev=18646&r1=18645&r2=18646&view=diff ============================================================================== --- trunk/float.py (original) +++ trunk/float.py Tue Mar 5 16:40:28 2013 @@ -3,7 +3,7 @@ # Copyright (C) 2006 Gary S Thompson (see https://gna.org/users for contact # # details) # # # -# Copyright (C) 2008-2012 Edward d'Auvergne # +# Copyright (C) 2008-2013 Edward d'Auvergne # # # # This file is part of the program relax (http://www.nmr-relax.com). # # # @@ -88,8 +88,13 @@ - Add example IEEE double. - Check byte/nibble attributions. """ + +# Python module imports. from struct import pack, unpack import sys + +# relax module imports. +from check_types import is_float SIGNBIT = 0x80 @@ -239,7 +244,7 @@ @raise TypeError: If the input object isn't a python float. """ - if not isinstance(obj, float): + if not is_float(obj): raise TypeError('the object recieved wasn\'t a float, type was: %s' % type(obj)) # pack float into binary string