Author: bugman Date: Sun Jun 10 13:50:44 2012 New Revision: 16811 URL: http://svn.gna.org/viewcvs/relax?rev=16811&view=rev Log: Improved the robustness of the bmrb.write user function for missing data. This is in the generic_fns.diffusion_tensor.bmrb_write() function, and is for missing atomic information required for the Tensor_list saveframe. Modified: branches/uf_redesign/generic_fns/diffusion_tensor.py Modified: branches/uf_redesign/generic_fns/diffusion_tensor.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/generic_fns/diffusion_tensor.py?rev=16811&r1=16810&r2=16811&view=diff ============================================================================== --- branches/uf_redesign/generic_fns/diffusion_tensor.py (original) +++ branches/uf_redesign/generic_fns/diffusion_tensor.py Sun Jun 10 13:50:44 2012 @@ -187,10 +187,17 @@ # The attached atom info. if hasattr(spin, 'attached_atom'): attached_atom_name_list.append(str(spin.attached_atom)) + elif hasattr(spin, 'attached_proton'): + attached_atom_name_list.append(str(spin.attached_proton)) else: - attached_atom_name_list.append(str(spin.attached_proton)) - attached_element_list.append(element_from_isotope(spin.proton_type)) - attached_isotope_list.append(str(number_from_isotope(spin.proton_type))) + attached_atom_name_list.append(None) + + if hasattr(spin, 'proton_type'): + attached_element_list.append(element_from_isotope(spin.proton_type)) + attached_isotope_list.append(str(number_from_isotope(spin.proton_type))) + else: + attached_element_list.append(None) + attached_isotope_list.append(None) # Other info. isotope_list.append(int(string.strip(spin.heteronuc_type, string.ascii_letters)))