r21949 - in /trunk: lib/spectrum/sparky.py test_suite/system_tests/peak_lists.py

2013-12-12 Thread tlinnet
Author: tlinnet
Date: Thu Dec 12 11:02:00 2013
New Revision: 21949

URL: http://svn.gna.org/viewcvs/relax?rev=21949view=rev
Log:
Implemented to read spins from a SPARKY list, when no intensity column is 
present.

Addition to Support Request #3044, (https://gna.org/support/index.php?3044) - 
Load spins from SPARKY list.

Modified:
trunk/lib/spectrum/sparky.py
trunk/test_suite/system_tests/peak_lists.py

Modified: trunk/lib/spectrum/sparky.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/spectrum/sparky.py?rev=21949r1=21948r2=21949view=diff
==
--- trunk/lib/spectrum/sparky.py (original)
+++ trunk/lib/spectrum/sparky.py Thu Dec 12 11:02:00 2013
@@ -204,15 +204,29 @@
 except ValueError:
 raise RelaxError(The peak intensity value from the line %s is 
invalid. % line)
 
-# Add the assignment to the peak list object.
-if dim == 1:
-peak_list.add(res_nums=[res_num1], res_names=[res_name1], 
spin_names=[name1], shifts=[w1], intensity=intensity)
-elif dim == 2:
-peak_list.add(res_nums=[res_num1, res_num2], res_names=[res_name1, 
res_name2], spin_names=[name1, name2], shifts=[w1, w2], intensity=intensity)
-elif dim == 3:
-peak_list.add(res_nums=[res_num1, res_num2, res_num1], 
res_names=[res_name1, res_name2, res_name1], spin_names=[name1, name2, name3], 
shifts=[w1, w2, w3], intensity=intensity)
-elif dim == 4:
-peak_list.add(res_nums=[res_num1, res_num2, res_num1, res_num1], 
res_names=[res_name1, res_name2, res_name1, res_name1], spin_names=[name1, 
name2, name3, name4], shifts=[w1, w2, w3, w4], intensity=intensity)
+# Add the assignment to the peak list object.
+if dim == 1:
+peak_list.add(res_nums=[res_num1], res_names=[res_name1], 
spin_names=[name1], shifts=[w1], intensity=intensity)
+elif dim == 2:
+peak_list.add(res_nums=[res_num1, res_num2], 
res_names=[res_name1, res_name2], spin_names=[name1, name2], shifts=[w1, w2], 
intensity=intensity)
+elif dim == 3:
+peak_list.add(res_nums=[res_num1, res_num2, res_num1], 
res_names=[res_name1, res_name2, res_name1], spin_names=[name1, name2, name3], 
shifts=[w1, w2, w3], intensity=intensity)
+elif dim == 4:
+peak_list.add(res_nums=[res_num1, res_num2, res_num1, 
res_num1], res_names=[res_name1, res_name2, res_name1, res_name1], 
spin_names=[name1, name2, name3, name4], shifts=[w1, w2, w3, w4], 
intensity=intensity)
+
+# If no intensity column, for example when reading spins from a 
spectrum list.
+elif int_col == None:
+warn(RelaxWarning((The peak intensity value from the line %s is 
invalid. The return value will be without intensity. % line)))
+
+# Add the assignment to the peak list object.
+if dim == 1:
+peak_list.add(res_nums=[res_num1], res_names=[res_name1], 
spin_names=[name1], shifts=[w1])
+elif dim == 2:
+peak_list.add(res_nums=[res_num1, res_num2], 
res_names=[res_name1, res_name2], spin_names=[name1, name2], shifts=[w1, w2])
+elif dim == 3:
+peak_list.add(res_nums=[res_num1, res_num2, res_num1], 
res_names=[res_name1, res_name2, res_name1], spin_names=[name1, name2, name3], 
shifts=[w1, w2, w3])
+elif dim == 4:
+peak_list.add(res_nums=[res_num1, res_num2, res_num1, 
res_num1], res_names=[res_name1, res_name2, res_name1, res_name1], 
spin_names=[name1, name2, name3, name4], shifts=[w1, w2, w3, w4])
 
 
 def write_list(file_prefix=None, dir=None, res_names=None, res_nums=None, 
atom1_names=None, atom2_names=None, w1=None, w2=None, data_height=None, 
force=True):

Modified: trunk/test_suite/system_tests/peak_lists.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/peak_lists.py?rev=21949r1=21948r2=21949view=diff
==
--- trunk/test_suite/system_tests/peak_lists.py (original)
+++ trunk/test_suite/system_tests/peak_lists.py Thu Dec 12 11:02:00 2013
@@ -456,6 +456,76 @@
 # Read the spins from peak list.
 self.interpreter.spectrum.read_spins(file=sparky2dim.list, 
dir=status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'peak_lists', 
dim=1)
 self.interpreter.spectrum.read_spins(file=sparky2dim.list, 
dir=status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'peak_lists', 
dim=2)
+
+# Test some of the sequence.
+self.assertEqual(len(cdp.mol), 1)
+self.assertEqual(cdp.mol[0].name, None)
+self.assertEqual(len(cdp.mol[0].res), 7)
+
+# 1st residue.
+self.assertEqual(cdp.mol[0].res[0].num, 62)
+self.assertEqual(cdp.mol[0].res[0].name, 'W')
+self.assertEqual(len(cdp.mol[0].res[0].spin), 2)
+

r21950 - /branches/double_rotor/

2013-12-12 Thread edward
Author: bugman
Date: Thu Dec 12 18:06:57 2013
New Revision: 21950

URL: http://svn.gna.org/viewcvs/relax?rev=21950view=rev
Log:
Creation of a dedicated branch for developing the double rotor model of frame 
order.


Added:
branches/double_rotor/
  - copied from r21949, trunk/


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

This is the relax-commits mailing list
relax-commits@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-commits


r21951 - /branches/double_rotor/

2013-12-12 Thread edward
Author: bugman
Date: Thu Dec 12 18:11:19 2013
New Revision: 21951

URL: http://svn.gna.org/viewcvs/relax?rev=21951view=rev
Log:
Initialized merge tracking via svnmerge with revisions 1-21949 from 
svn+ssh://bug...@svn.gna.org/svn/relax/trunk

Modified:
branches/double_rotor/   (props changed)

Propchange: branches/double_rotor/
--
svnmerge-integrated = /trunk:1-21949


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

This is the relax-commits mailing list
relax-commits@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-commits