Author: bugman Date: Mon Feb 27 17:47:36 2012 New Revision: 15381 URL: http://svn.gna.org/viewcvs/relax?rev=15381&view=rev Log: Merged revisions 15380 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/1.3 ........ r15380 | bugman | 2012-02-27 17:46:41 +0100 (Mon, 27 Feb 2012) | 8 lines Fix for the storage of numpy data structures in the relax save files. If special structures are created by the user, these were not correctly stored. The precision was often too low (printed at the numpy default of a precision of 8), and if one dimension had more than 1000 elements, ellipses would be stored instead. The ellipses would cause the save file to be unreadable by relax. ........ Modified: branches/frame_order_testing/ (props changed) branches/frame_order_testing/data/relax_xml.py Propchange: branches/frame_order_testing/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Mon Feb 27 17:47:36 2012 @@ -1,1 +1,1 @@ -/1.3:1-15336 +/1.3:1-15380 Modified: branches/frame_order_testing/data/relax_xml.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/data/relax_xml.py?rev=15381&r1=15380&r2=15381&view=diff ============================================================================== --- branches/frame_order_testing/data/relax_xml.py (original) +++ branches/frame_order_testing/data/relax_xml.py Mon Feb 27 17:47:36 2012 @@ -24,9 +24,12 @@ """Module containing generic fns for creation and parsing of XML representations of python objects.""" # Python module imports. -from numpy import array, float64 +from numpy import set_printoptions, array, float16, float32, float64, float128, inf, nan from re import search from string import strip + +# Modify numpy for better output of numbers and structures. +set_printoptions(precision=15, threshold=nan) # relax module imports. from float import floatAsByteArray, packBytesAsPyFloat @@ -67,7 +70,7 @@ subobj = getattr(object, name) # Store floats as IEEE-754 byte arrays (for full precision storage). - if isinstance(subobj, float) or isinstance(subobj, float64): + if isinstance(subobj, float) or isinstance(subobj, float16) or isinstance(subobj, float32) or isinstance(subobj, float64) or isinstance(subobj, float128): sub_elem.setAttribute('ieee_754_byte_array', repr(floatAsByteArray(subobj))) # Add the text value to the sub element.