Author: bugman Date: Sun Jun 10 13:36:20 2012 New Revision: 16809 URL: http://svn.gna.org/viewcvs/relax?rev=16809&view=rev Log: Improved the robustness of the bmrb.write user function for missing data. This is in the generic_fns.relax_data.bmrb_write() function, and is for missing atomic information related to relaxation data. Modified: branches/uf_redesign/generic_fns/relax_data.py Modified: branches/uf_redesign/generic_fns/relax_data.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/generic_fns/relax_data.py?rev=16809&r1=16808&r2=16809&view=diff ============================================================================== --- branches/uf_redesign/generic_fns/relax_data.py (original) +++ branches/uf_redesign/generic_fns/relax_data.py Sun Jun 10 13:36:20 2012 @@ -271,10 +271,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) # The relaxation data. used_index = -ones(len(cdp.ri_ids))