Re: Failing system tests and the Python 2.5 fatality.

2014-11-11 Thread Edward d'Auvergne
Hi Troels,

I've fixed the Python 3 compatibility for relax which had reverted to
quite a poor state.  The trunk should now be in a reasonable state to
run on all Python versions between 2.5 and 3.4 (excluding the dead
3.0).  To write code that is both Python 2 and 3 compatible in the
future, please note the following:

- Always use range() rather than xrange().  The only real reason for
xrange() would be a massive iteration over hundreds of millions or
more items.  The lib.compat module aliases range() to xrange() in
Python 3, but this should not be relied upon, especially in the relax
library whereby the lib.compat module may not always be imported.


- To create a list of numbers using range(126, 130, 2), for example,
wrap it in the list function as list(range(126, 130, 2)).  In Python
3, range() returns an iterator object rather than a list, just like
xrange() does in Python 2.  Actually, many functions now return
iterators and these can simply be wrapped in the list() function call
to obtain the correct object.


- dict.iteritems() can never be used, as it no longer exists in Python
3.  This was introduced into many parts of relax:

$ grep -r iteritems . --exclude-dir=.svn
./test_suite/shared_data/dispersion/Kjaergaard_et_al_2013/5_clustered_analyses.py:for
key, value in cdp.clustering.iteritems():
./test_suite/system_tests/relax_fit.py:for s_id, time in
cdp.relax_times.iteritems():
./test_suite/system_tests/relax_disp.py:for param,
param_conv in par_dic.iteritems():
./auto_analyses/relax_disp_repeat_cpmg.py:for setting, value
in self.settings.iteritems():
./auto_analyses/relax_fit.py:for s_id, time in
cdp.relax_times.iteritems():

As a standard alternative that will work on all Python versions, try:

for item in settings:
print(item, settings[item])

I have converted all your code to use this construct.


- The same for dict.items() and dict.values(), though this can be used
as list(dict.items()) or list(dict.values()).  However it might be
better to use the above simple construct to obtain the key and then
directly reference the dict[key] value in the code.


- At all costs, avoid map, lambda, filter, and reduce.  These will
probably one day be eliminated from Python, as the creator of Python
does not like them
(http://www.artima.com/weblogs/viewpost.jsp?thread=98196).  Although
this is compact, it only takes a few lines of Python to do the same
thing.  The 2to3 conversion script is good for eliminating most, but
not all of these things.


- In general, using simple coding techniques rather than 'advanced'
language helper functions will result in more portable and
future-proof code.


Cheers,

Edward


On 10 November 2014 19:29, Edward d'Auvergne edw...@nmr-relax.com wrote:
 Hi Troels,

 Thank you for fixing those!  Once I sort out a few other issues, I'll
 release relax 3.3.2.

 Cheers,

 Edward




 On 10 November 2014 13:46, Edward d'Auvergne edw...@nmr-relax.com wrote:
 Hi Troels,

 I was wondering what your plans are for your recently introduced
 system tests which currently fail?  These are:

 F 1.06 s for Relax_disp.test_cpmg_synthetic_dx_map_points
 F57.81 s for Relax_disp.test_dx_map_clustered_create_par_file

 The last test also takes far more time than it requires.  I would like
 to soon release a new relax 3.3.2 release with all the recent bug
 fixes, but the test suite needs to be passing on all systems before I
 can do anything.  There is also the 'with' statement in the system
 test problem which is fatal for Python 2.5 and which must be resolved
 (https://gna.org/bugs/?22801,
 http://thread.gmane.org/gmane.science.nmr.relax.scm/24011/focus=7229).
 The new release is required as the Mac OS X binary release is
 currently non-functional due to the bundled matplotlib package being
 broken (https://gna.org/bugs/?22821).

 Cheers,

 Edward

___
relax (http://www.nmr-relax.com)

This is the relax-devel mailing list
relax-devel@gna.org

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel


[bug #22801] Failure of the relax test suite on Python 2.5.

2014-11-11 Thread Edward d Auvergne
Update of bug #22801 (project relax):

  Status: In Progress = Fixed  
 Open/Closed:Open = Closed 


___

Reply to this item at:

  http://gna.org/bugs/?22801

___
  Message sent via/by Gna!
  http://gna.org/


___
relax (http://www.nmr-relax.com)

This is the relax-devel mailing list
relax-devel@gna.org

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel


[bug #22730] Model-free auto-analysis - relax stops and quits at the polate step.

2014-11-11 Thread Edward d Auvergne
Update of bug #22730 (project relax):

  Status:   Need Info = Works For Me   
 Open/Closed:Open = Closed 

___

Follow-up Comment #21:

Closing this bug as the original problem of relax terminating prior to the end
of the analysis cannot be reproduced.

___

Reply to this item at:

  http://gna.org/bugs/?22730

___
  Message sent via/by Gna!
  http://gna.org/


___
relax (http://www.nmr-relax.com)

This is the relax-devel mailing list
relax-devel@gna.org

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel


[bug #22540] The Relax Controller does not follow output when doing Monte-Carlo simulations.

2014-11-11 Thread Edward d Auvergne
Update of bug #22540 (project relax):

  Status:None = Fixed  
 Assigned to:None = bugman 
 Open/Closed:Open = Closed 

___

Follow-up Comment #2:

Closing this bug as the relax controller should now be fixed.

___

Reply to this item at:

  http://gna.org/bugs/?22540

___
  Message sent via/by Gna!
  http://gna.org/


___
relax (http://www.nmr-relax.com)

This is the relax-devel mailing list
relax-devel@gna.org

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel


[bug #21599] allow import of nmr data from ccpn projects (optionally also export)

2014-11-11 Thread Edward d Auvergne
Update of bug #21599 (project relax):

  Status:None = Postponed  

___

Follow-up Comment #2:

This task, rather than bug, has been postponed until a future date (see the
mention of v3 of CCPN at
http://thread.gmane.org/gmane.science.nmr.relax.devel/4957/focus=5139).

___

Reply to this item at:

  http://gna.org/bugs/?21599

___
  Message sent via/by Gna!
  http://gna.org/


___
relax (http://www.nmr-relax.com)

This is the relax-devel mailing list
relax-devel@gna.org

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel