Author: bugman Date: Tue Apr 2 12:26:26 2013 New Revision: 19300 URL: http://svn.gna.org/viewcvs/relax?rev=19300&view=rev Log: Merged revisions 19297 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r19297 | bugman | 2013-04-02 11:44:35 +0200 (Tue, 02 Apr 2013) | 78 lines Manually merged r19291, r19292, r19293, r19294, r19295, r19296 from the 2.2 line to trunk. The command used was: svn merge -r19290:19296 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/2.2 . ..... ------------------------------------------------------------------------ r19296 | bugman | 2013-04-02 11:41:09 +0200 (Tue, 02 Apr 2013) | 5 lines Changed paths: M /branches/2.2/test_suite/system_tests/scripts/bug_20674_jw_mapping.py Fix for the Jw.test_bug_20674_jw_mapping system test. The parameter f_eta is for consistency testing and not J(w) mapping. ------------------------------------------------------------------------ r19295 | bugman | 2013-04-02 11:39:55 +0200 (Tue, 02 Apr 2013) | 5 lines Changed paths: M /branches/2.2/test_suite/system_tests/scripts/bug_20674_jw_mapping.py Converted the bug_20674_jw_mapping.py system test script to use the self._execute_uf() interface. This allows the script to be used in the GUI. ------------------------------------------------------------------------ r19294 | bugman | 2013-04-02 11:33:22 +0200 (Tue, 02 Apr 2013) | 5 lines Changed paths: M /branches/2.2/test_suite/system_tests/scripts/consistency_tests.py M /branches/2.2/test_suite/system_tests/scripts/curve_fitting/bug_19887_curvefit_fail.py M /branches/2.2/test_suite/system_tests/scripts/jw_mapping.py M /branches/2.2/test_suite/system_tests/scripts/model_free/bug_14941_local_tm_global_selection.py System test speed ups - decreased the number of Monte Carlo simulations in many tests. Running 500 simulation optimisations in a system test is a total waste of time! ------------------------------------------------------------------------ r19293 | bugman | 2013-04-02 11:27:32 +0200 (Tue, 02 Apr 2013) | 5 lines Changed paths: M /branches/2.2/specific_analyses/jw_mapping.py Fix for the J(w) mapping analysis matching that of r19284 for the consistency testing. The overfit_deselect() method is now identical to that of the consistency testing analysis. ------------------------------------------------------------------------ ------------------------------------------------------------------------ r19292 | bugman | 2013-04-02 11:23:09 +0200 (Tue, 02 Apr 2013) | 8 lines Changed paths: M /branches/2.2/test_suite/system_tests/jw_mapping.py A /branches/2.2/test_suite/system_tests/scripts/bug_20674_jw_mapping.py (from /branches/2.2/test_suite/system_tests/scripts/bug_20674_ct_analysis_failure.py:19284) Created the Jw.bug_20674_jw_mapping system test. This is a modification of the Ct.test_bug_20674_ct_analysis_failure system test for catching bug #20674 (https://gna.org/bugs/?20674). The test script was duplicated and the small modifications made to convert it into the J(w) mapping analysis. This now reveals the same bug but for the J(w) mapping analysis. ------------------------------------------------------------------------ r19291 | bugman | 2013-04-02 11:11:11 +0200 (Tue, 02 Apr 2013) | 5 lines Changed paths: M /branches/2.2/specific_analyses/model_free/main.py Fix for the model-free analysis specific overfit_deselect() method. The tests for the presence of dipolar relaxation was not correct and was non-functional. ------------------------------------------------------------------------ ..... ........ Added: branches/relax_disp/test_suite/system_tests/scripts/bug_20674_jw_mapping.py - copied unchanged from r19297, trunk/test_suite/system_tests/scripts/bug_20674_jw_mapping.py Modified: branches/relax_disp/ (props changed) branches/relax_disp/specific_analyses/jw_mapping.py branches/relax_disp/specific_analyses/model_free/main.py branches/relax_disp/test_suite/system_tests/jw_mapping.py branches/relax_disp/test_suite/system_tests/scripts/consistency_tests.py branches/relax_disp/test_suite/system_tests/scripts/curve_fitting/bug_19887_curvefit_fail.py branches/relax_disp/test_suite/system_tests/scripts/jw_mapping.py branches/relax_disp/test_suite/system_tests/scripts/model_free/bug_14941_local_tm_global_selection.py Propchange: branches/relax_disp/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Tue Apr 2 12:26:26 2013 @@ -1,1 +1,1 @@ -/trunk:1-19289 +/trunk:1-19298 Modified: branches/relax_disp/specific_analyses/jw_mapping.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/jw_mapping.py?rev=19300&r1=19299&r2=19300&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/jw_mapping.py (original) +++ branches/relax_disp/specific_analyses/jw_mapping.py Tue Apr 2 12:26:26 2013 @@ -274,7 +274,7 @@ def overfit_deselect(self, data_check=True, verbose=True): - """Deselect spins which _have insufficient data to support calculation. + """Deselect spins which have insufficient data to support calculation. @keyword data_check: A flag to signal if the presence of base data is to be checked for. @type data_check: bool @@ -292,32 +292,68 @@ # Loop over spin data. deselect_flag = False + spin_count = 0 for spin, spin_id in spin_loop(return_id=True): # Skip deselected spins. if not spin.select: continue - # Check if data exists. - if not hasattr(spin, 'ri_data'): - warn(RelaxDeselectWarning(spin_id, 'missing relaxation data')) + # The interatomic data. + interatoms = return_interatom_list(spin_id) + + # Loop over the interatomic data. + dipole_relax = False + for i in range(len(interatoms)): + # No dipolar relaxation mechanism. + if not interatoms[i].dipole_pair: + continue + + # The surrounding spins. + if spin_id != interatoms[i].spin_id1: + spin_id2 = interatoms[i].spin_id1 + else: + spin_id2 = interatoms[i].spin_id2 + spin2 = return_spin(spin_id2) + + # Dipolar relaxation flag. + dipole_relax = True + + # No relaxation mechanism. + if not dipole_relax or not hasattr(spin, 'csa') or spin.csa == None: + warn(RelaxDeselectWarning(spin_id, 'an absence of relaxation mechanisms')) spin.select = False deselect_flag = True continue - # Require 3 or more data points. - else: - # Count the points. + # Data checks. + if data_check: + # The number of relaxation data points. data_points = 0 - for id in cdp.ri_ids: - if id in spin.ri_data and spin.ri_data[id] != None: - data_points += 1 - - # Not enough. + if hasattr(cdp, 'ri_ids') and hasattr(spin, 'ri_data'): + for id in cdp.ri_ids: + if id in spin.ri_data and spin.ri_data[id] != None: + data_points += 1 + + # Relaxation data must exist! + if not hasattr(spin, 'ri_data'): + warn(RelaxDeselectWarning(spin_id, 'missing relaxation data')) + spin.select = False + deselect_flag = True + continue + + # Require 3 or more data points. if data_points < 3: warn(RelaxDeselectWarning(spin_id, 'insufficient relaxation data, 3 or more data points are required')) spin.select = False deselect_flag = True continue + + # Increment the spin number. + spin_count += 1 + + # No spins selected, so fail hard to prevent the user from going any further. + if spin_count == 0: + warn(RelaxWarning("No spins are selected therefore the optimisation or calculation cannot proceed.")) # Final printout. if verbose and not deselect_flag: Modified: branches/relax_disp/specific_analyses/model_free/main.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/model_free/main.py?rev=19300&r1=19299&r2=19300&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/model_free/main.py (original) +++ branches/relax_disp/specific_analyses/model_free/main.py Tue Apr 2 12:26:26 2013 @@ -2019,10 +2019,10 @@ spin2 = return_spin(spin_id2) # Dipolar relaxation flag. - dipole_relax = False + dipole_relax = True # No relaxation mechanism. - if not dipole_relax and not hasattr(spin, 'csa') or spin.csa == None: + if not dipole_relax or not hasattr(spin, 'csa') or spin.csa == None: warn(RelaxDeselectWarning(spin_id, 'an absence of relaxation mechanisms')) spin.select = False deselect_flag = True Modified: branches/relax_disp/test_suite/system_tests/jw_mapping.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/test_suite/system_tests/jw_mapping.py?rev=19300&r1=19299&r2=19300&view=diff ============================================================================== --- branches/relax_disp/test_suite/system_tests/jw_mapping.py (original) +++ branches/relax_disp/test_suite/system_tests/jw_mapping.py Tue Apr 2 12:26:26 2013 @@ -40,6 +40,13 @@ # Create the data pipe. self.interpreter.pipe.create('jw', 'jw') + + + def test_bug_20674_jw_mapping(self): + """Catch U{bug #20674<https://gna.org/bugs/?20674>}, but for the J(w) mapping analysis.""" + + # Execute the script. + self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'bug_20674_jw_mapping.py') def test_calc(self): Modified: branches/relax_disp/test_suite/system_tests/scripts/consistency_tests.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/test_suite/system_tests/scripts/consistency_tests.py?rev=19300&r1=19299&r2=19300&view=diff ============================================================================== --- branches/relax_disp/test_suite/system_tests/scripts/consistency_tests.py (original) +++ branches/relax_disp/test_suite/system_tests/scripts/consistency_tests.py Tue Apr 2 12:26:26 2013 @@ -46,7 +46,7 @@ self._execute_uf(uf_name='calc') # Monte Carlo simulations. -self._execute_uf(uf_name='monte_carlo.setup', number=500) +self._execute_uf(uf_name='monte_carlo.setup', number=5) self._execute_uf(uf_name='monte_carlo.create_data') self._execute_uf(uf_name='calc') self._execute_uf(uf_name='monte_carlo.error_analysis') Modified: branches/relax_disp/test_suite/system_tests/scripts/curve_fitting/bug_19887_curvefit_fail.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/test_suite/system_tests/scripts/curve_fitting/bug_19887_curvefit_fail.py?rev=19300&r1=19299&r2=19300&view=diff ============================================================================== --- branches/relax_disp/test_suite/system_tests/scripts/curve_fitting/bug_19887_curvefit_fail.py (original) +++ branches/relax_disp/test_suite/system_tests/scripts/curve_fitting/bug_19887_curvefit_fail.py Tue Apr 2 12:26:26 2013 @@ -68,7 +68,7 @@ minimise('simplex', scaling=False, constraints=False) # Monte Carlo simulations. -monte_carlo.setup(number=500) +monte_carlo.setup(number=5) monte_carlo.create_data() monte_carlo.initial_values() minimise('simplex', scaling=False, constraints=False) Modified: branches/relax_disp/test_suite/system_tests/scripts/jw_mapping.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/test_suite/system_tests/scripts/jw_mapping.py?rev=19300&r1=19299&r2=19300&view=diff ============================================================================== --- branches/relax_disp/test_suite/system_tests/scripts/jw_mapping.py (original) +++ branches/relax_disp/test_suite/system_tests/scripts/jw_mapping.py Tue Apr 2 12:26:26 2013 @@ -40,7 +40,7 @@ self._execute_uf(uf_name='calc') # Monte Carlo simulations. -self._execute_uf(uf_name='monte_carlo.setup', number=500) +self._execute_uf(uf_name='monte_carlo.setup', number=5) self._execute_uf(uf_name='monte_carlo.create_data') self._execute_uf(uf_name='calc') self._execute_uf(uf_name='monte_carlo.error_analysis') Modified: branches/relax_disp/test_suite/system_tests/scripts/model_free/bug_14941_local_tm_global_selection.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/test_suite/system_tests/scripts/model_free/bug_14941_local_tm_global_selection.py?rev=19300&r1=19299&r2=19300&view=diff ============================================================================== --- branches/relax_disp/test_suite/system_tests/scripts/model_free/bug_14941_local_tm_global_selection.py (original) +++ branches/relax_disp/test_suite/system_tests/scripts/model_free/bug_14941_local_tm_global_selection.py Tue Apr 2 12:26:26 2013 @@ -34,7 +34,7 @@ results.write(file='devnull', dir=None, compress_type=1, force=True) # Monte Carlo simulation setup. -monte_carlo.setup(number=200) +monte_carlo.setup(number=5) monte_carlo.create_data(method='back_calc') monte_carlo.initial_values()