Package test_suite :: Package gui_tests :: Module model_free
[hide private]
[frames] | no frames]

Source Code for Module test_suite.gui_tests.model_free

  1  ############################################################################### 
  2  #                                                                             # 
  3  # Copyright (C) 2006-2014 Edward d'Auvergne                                   # 
  4  #                                                                             # 
  5  # This file is part of the program relax (http://www.nmr-relax.com).          # 
  6  #                                                                             # 
  7  # This program is free software: you can redistribute it and/or modify        # 
  8  # it under the terms of the GNU General Public License as published by        # 
  9  # the Free Software Foundation, either version 3 of the License, or           # 
 10  # (at your option) any later version.                                         # 
 11  #                                                                             # 
 12  # This program is distributed in the hope that it will be useful,             # 
 13  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
 14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
 15  # GNU General Public License for more details.                                # 
 16  #                                                                             # 
 17  # You should have received a copy of the GNU General Public License           # 
 18  # along with this program.  If not, see <http://www.gnu.org/licenses/>.       # 
 19  #                                                                             # 
 20  ############################################################################### 
 21   
 22  # Python module imports. 
 23  from os import sep 
 24  import wx 
 25   
 26  # relax module imports. 
 27  from data_store import Relax_data_store; ds = Relax_data_store() 
 28  from pipe_control.interatomic import interatomic_loop 
 29  from pipe_control.mol_res_spin import spin_loop 
 30  from status import Status; status = Status() 
 31  from test_suite.gui_tests.base_classes import GuiTestCase 
 32   
 33  # relax GUI imports. 
 34  from gui.analyses import auto_model_free 
 35  from gui.interpreter import Interpreter; interpreter = Interpreter() 
 36  from gui.string_conv import str_to_gui 
 37  from gui.uf_objects import Uf_storage; uf_store = Uf_storage() 
 38   
 39   
40 -class Mf(GuiTestCase):
41 """Class for testing various aspects specific to the model-free auto-analysis.""" 42
44 """Catch U{bug #20479<https://web.archive.org/web/https://gna.org/bugs/?20479>}, the failure to load a relax state in the GUI. 45 46 This was reported by U{Stanislava Panova<https://web.archive.org/web/https://gna.org/users/stacy>}. 47 """ 48 49 # Simulate the new analysis wizard. 50 self.app.gui.analysis.menu_new(None) 51 page = self.app.gui.analysis.new_wizard.wizard.get_page(0) 52 page.select_mf(None) 53 page.analysis_name.SetValue(str_to_gui("Model-free test")) 54 self.app.gui.analysis.new_wizard.wizard._go_next(None) 55 page = self.app.gui.analysis.new_wizard.wizard.get_page(1) 56 self.app.gui.analysis.new_wizard.wizard._go_next(None) 57 58 # Get the data. 59 analysis_type, analysis_name, pipe_name, pipe_bundle, uf_exec = self.app.gui.analysis.new_wizard.get_data() 60 61 # Set up the analysis. 62 self.app.gui.analysis.new_analysis(analysis_type=analysis_type, analysis_name=analysis_name, pipe_name=pipe_name, pipe_bundle=pipe_bundle) 63 64 # Alias the analysis. 65 analysis = self.app.gui.analysis.get_page_from_name("Model-free test") 66 67 # Change the results directory. 68 analysis.field_results_dir.SetValue(str_to_gui(ds.tmpdir)) 69 70 # The data path. 71 data_path = status.install_path + sep + 'test_suite' + sep + 'shared_data' + sep + 'model_free' + sep + 'bug_20479_gui_final_pipe' + sep 72 73 # Launch the spin viewer window. 74 self.app.gui.show_tree() 75 76 # Spin loading wizard: Initialisation. 77 self.app.gui.spin_viewer.load_spins_wizard() 78 79 # Spin loading wizard: The NOE data file. 80 page = self.app.gui.spin_viewer.wizard.get_page(0) 81 page.selection = 'sequence' 82 self.app.gui.spin_viewer.wizard._go_next() 83 page = self.app.gui.spin_viewer.wizard.get_page(self.app.gui.spin_viewer.wizard._current_page) 84 page.uf_args['file'].SetValue(str_to_gui(data_path + 'NoeRelN')) 85 self.app.gui.spin_viewer.wizard._go_next() 86 interpreter.flush() # Required because of the asynchronous uf call. 87 88 # Spin loading wizard: The spin loading. 89 self.app.gui.spin_viewer.wizard._go_next() 90 interpreter.flush() # Required because of the asynchronous uf call. 91 92 # Close the spin viewer window. 93 self.app.gui.spin_viewer.handler_close() 94 95 # Flush the interpreter in preparation for the synchronous user functions of the peak list wizard. 96 interpreter.flush() 97 98 # Set the element type. 99 self._execute_uf(uf_name='spin.element', element='N') 100 101 # Load the relaxation data. 102 data = [ 103 ['NoeRelN', 'noe_800', 'NOE', 800000031.0], 104 ['R1850', 'r1_800', 'R1', 800000031.0], 105 ['R2863', 'r2_800', 'R2', 800000031.0], 106 ['R2604', 'r2_600', 'R2', 599999000.0] 107 ] 108 for i in range(len(data)): 109 self._execute_uf(uf_name='relax_data.read', file=data_path+data[i][0], ri_id=data[i][1], ri_type=data[i][2], frq=data[i][3], mol_name_col=1, res_num_col=2, res_name_col=3, spin_num_col=4, spin_name_col=5, data_col=6, error_col=7) 110 111 # Attach the protons. 112 self._execute_uf(uf_name='sequence.attach_protons') 113 114 # Dipole-dipole interaction wizard. 115 analysis.setup_dipole_pair() # Initialisation. 116 analysis.dipole_wizard._skip() # Skip the structure.read_pdb user function. 117 analysis.dipole_wizard._skip() # Skip the structure.get_pos user function. 118 analysis.dipole_wizard._go_next() # The interatom.define user function. 119 interpreter.flush() # Required because of the asynchronous uf call. 120 analysis.dipole_wizard._go_next() # The interatom.set_dist user function. 121 interpreter.flush() # Required because of the asynchronous uf call. 122 analysis.dipole_wizard._skip() # Skip the interatom.unit_vectors user function. 123 124 # Set up the CSA interaction. 125 analysis.value_set_csa() 126 uf_store['value.set'].wizard._go_next() 127 interpreter.flush() # Required because of the asynchronous uf call. 128 129 # Set up the nuclear isotopes. 130 analysis.spin_isotope_heteronuc() 131 uf_store['spin.isotope'].wizard._go_next() 132 interpreter.flush() # Required because of the asynchronous uf call. 133 analysis.spin_isotope_proton() 134 uf_store['spin.isotope'].wizard._go_next() 135 interpreter.flush() # Required because of the asynchronous uf call. 136 137 # Select only the tm0 and tm1 local tm models. 138 analysis.local_tm_model_field.select = [True, True, False, False, False, False, False, False, False, False] 139 analysis.local_tm_model_field.modify() 140 141 # Select only the m1 and m2 model-free models. 142 analysis.mf_model_field.select = [False, True, True, False, False, False, False, False, False, False] 143 analysis.mf_model_field.modify() 144 145 # Change the grid increments. 146 analysis.grid_inc.SetValue(3) 147 analysis.data.diff_tensor_grid_inc = {'sphere': 5, 'prolate': 5, 'oblate': 5, 'ellipsoid': 3} 148 149 # Set the number of Monte Carlo simulations. 150 analysis.mc_sim_num.SetValue(2) 151 152 # Set the maximum number of iterations (changing the allowed values). 153 analysis.max_iter.control.SetRange(0, 100) 154 analysis.max_iter.SetValue(1) 155 156 # Modify some of the class variables to speed up optimisation. 157 auto_model_free.dauvergne_protocol.dAuvergne_protocol.opt_func_tol = 1e-5 158 auto_model_free.dauvergne_protocol.dAuvergne_protocol.opt_max_iterations = 1000 159 160 # Execute the 'local_tm', 'sphere' and 'final' protocol stages sequentially. 161 for protocol in ['local_tm', 'sphere', 'final']: 162 # Print out. 163 text = "Sequential global model optimisation: %s" % protocol 164 char = "%" 165 print("\n\n\n\n%s\n%s %s %s\n%s\n\n\n" % (char*(len(text)+4), char, text, char, char*(len(text)+4))) 166 167 # Set the protocol mode. 168 if protocol == 'local_tm': 169 analysis.mode_win.select_local_tm() 170 elif protocol == 'sphere': 171 analysis.mode_win.select_sphere() 172 else: 173 analysis.mode_win.select_final() 174 analysis.mode_dialog() 175 176 # Execute relax. 177 state = analysis.execute(wx.CommandEvent(wx.wxEVT_COMMAND_BUTTON_CLICKED, analysis.button_exec_relax.GetId())) 178 179 # Wait for execution to complete. 180 if hasattr(analysis, 'thread'): 181 analysis.thread.join() 182 183 # Flush all wx events. 184 wx.Yield() 185 186 # Exceptions in the thread. 187 self.check_exceptions()
188 189
191 """Catch U{bug #21615<https://web.archive.org/web/https://gna.org/bugs/?21615>}, the failure of showing the missing data dialog when executing the analysis with an incomplete setup. 192 193 This was reported by Ivan Leung. 194 """ 195 196 # Simulate the new analysis wizard. 197 self.app.gui.analysis.menu_new(None) 198 page = self.app.gui.analysis.new_wizard.wizard.get_page(0) 199 page.select_mf(None) 200 page.analysis_name.SetValue(str_to_gui("Model-free incomplete setup failure")) 201 self.app.gui.analysis.new_wizard.wizard._go_next(None) 202 page = self.app.gui.analysis.new_wizard.wizard.get_page(1) 203 self.app.gui.analysis.new_wizard.wizard._go_next(None) 204 205 # Get the data. 206 analysis_type, analysis_name, pipe_name, pipe_bundle, uf_exec = self.app.gui.analysis.new_wizard.get_data() 207 208 # Set up the analysis. 209 self.app.gui.analysis.new_analysis(analysis_type=analysis_type, analysis_name=analysis_name, pipe_name=pipe_name, pipe_bundle=pipe_bundle) 210 211 # Alias the analysis. 212 analysis = self.app.gui.analysis.get_page_from_name("Model-free incomplete setup failure") 213 214 # Change the results directory. 215 analysis.field_results_dir.SetValue(str_to_gui(ds.tmpdir)) 216 217 # The data path. 218 data_path = status.install_path + sep + 'test_suite' + sep + 'shared_data' + sep + 'model_free' + sep + 'bug_21615_incomplete_setup_failure' + sep 219 220 # Launch the spin viewer window. 221 self.app.gui.show_tree() 222 223 # Spin loading wizard: Initialisation. 224 self.app.gui.spin_viewer.load_spins_wizard() 225 226 # Spin loading wizard: The PDB file. 227 page = self.app.gui.spin_viewer.wizard.get_page(0) 228 page.selection = 'new pdb' 229 self.app.gui.spin_viewer.wizard._go_next() 230 page = self.app.gui.spin_viewer.wizard.get_page(self.app.gui.spin_viewer.wizard._current_page) 231 page.uf_args['file'].SetValue(str_to_gui(data_path + 'Truncated_ForBugReport.pdb')) 232 self.app.gui.spin_viewer.wizard._go_next() 233 interpreter.flush() # Required because of the asynchronous uf call. 234 235 # Spin loading wizard: The spin loading. 236 page = self.app.gui.spin_viewer.wizard.get_page(self.app.gui.spin_viewer.wizard._current_page) 237 page.uf_args['spin_id'].SetValue(str_to_gui('@N')) 238 self.app.gui.spin_viewer.wizard._apply() 239 page.uf_args['spin_id'].SetValue(str_to_gui('@H')) 240 self.app.gui.spin_viewer.wizard._go_next() 241 interpreter.flush() # Required because of the asynchronous uf call. 242 243 # Close the spin viewer window. 244 self.app.gui.spin_viewer.handler_close() 245 246 # Flush the interpreter in preparation for the synchronous user functions of the peak list wizard. 247 interpreter.flush() 248 249 # Set the element type. 250 self._execute_uf(uf_name='spin.element', element='N') 251 252 # Load the relaxation data. 253 data = [ 254 ['NOE_ForBugReport.txt', 'noe_800', 'NOE', 800000001.0], 255 ['T1_ForBugReport.txt', 'r1_800', 'R1', 800000001.0], 256 ['T2_ForBugReport.txt', 'r2_800', 'R2', 800000001.0] 257 ] 258 for i in range(len(data)): 259 self._execute_uf(uf_name='relax_data.read', file=data_path+data[i][0], ri_id=data[i][1], ri_type=data[i][2], frq=data[i][3], mol_name_col=1, res_num_col=2, res_name_col=3, spin_num_col=4, spin_name_col=5, data_col=6, error_col=7) 260 261 # Execute relax. 262 state = analysis.execute(wx.CommandEvent(wx.wxEVT_COMMAND_BUTTON_CLICKED, analysis.button_exec_relax.GetId())) 263 264 # Wait for execution to complete. 265 if hasattr(analysis, 'thread'): 266 analysis.thread.join() 267 268 # Flush all wx events. 269 wx.Yield() 270 271 # Exceptions in the thread. 272 self.check_exceptions()
273 274
275 - def test_mf_auto_analysis(self):
276 """Test the model-free auto-analysis. 277 278 This now catches U{bug #20603<https://web.archive.org/web/https://gna.org/bugs/?20603>}. 279 """ 280 281 # Simulate the new analysis wizard. 282 self.app.gui.analysis.menu_new(None) 283 page = self.app.gui.analysis.new_wizard.wizard.get_page(0) 284 page.select_mf(None) 285 page.analysis_name.SetValue(str_to_gui("Model-free test")) 286 self.app.gui.analysis.new_wizard.wizard._go_next(None) 287 page = self.app.gui.analysis.new_wizard.wizard.get_page(1) 288 self.app.gui.analysis.new_wizard.wizard._go_next(None) 289 290 # Get the data. 291 analysis_type, analysis_name, pipe_name, pipe_bundle, uf_exec = self.app.gui.analysis.new_wizard.get_data() 292 293 # Set up the analysis. 294 self.app.gui.analysis.new_analysis(analysis_type=analysis_type, analysis_name=analysis_name, pipe_name=pipe_name, pipe_bundle=pipe_bundle) 295 296 # Alias the analysis. 297 analysis = self.app.gui.analysis.get_page_from_name("Model-free test") 298 299 # Change the results directory. 300 analysis.field_results_dir.SetValue(str_to_gui(ds.tmpdir)) 301 302 # The data path. 303 data_path = status.install_path + sep + 'test_suite' + sep + 'shared_data' + sep + 'model_free' + sep + 'sphere' + sep 304 305 # Open and close the about window (mimicking user behaviour). 306 analysis._about() 307 analysis.about_dialog.Close() 308 309 # Launch the spin viewer window. 310 self.app.gui.show_tree() 311 312 # Spin loading wizard: Initialisation. 313 self.app.gui.spin_viewer.load_spins_wizard() 314 315 # Spin loading wizard: The PDB file. 316 page = self.app.gui.spin_viewer.wizard.get_page(0) 317 page.selection = 'new pdb' 318 self.app.gui.spin_viewer.wizard._go_next() 319 page = self.app.gui.spin_viewer.wizard.get_page(self.app.gui.spin_viewer.wizard._current_page) 320 page.uf_args['file'].SetValue(str_to_gui(status.install_path + sep + 'test_suite' + sep + 'shared_data' + sep + 'model_free' + sep + 'sphere' + sep + 'sphere.pdb')) 321 self.app.gui.spin_viewer.wizard._go_next() 322 interpreter.flush() # Required because of the asynchronous uf call. 323 324 # Spin loading wizard: The spin loading. 325 self.app.gui.spin_viewer.wizard._go_next() 326 interpreter.flush() # Required because of the asynchronous uf call. 327 328 # Close the spin viewer window. 329 self.app.gui.spin_viewer.handler_close() 330 331 # Flush the interpreter in preparation for the synchronous user functions of the peak list wizard. 332 interpreter.flush() 333 334 # Load the relaxation data. 335 data = [ 336 ['noe.500.out', 'noe_500', 'NOE', 500e6], 337 ['r1.500.out', 'r1_500', 'R1', 500e6], 338 ['r2.500.out', 'r2_500', 'R2', 500e6], 339 ['noe.900.out', 'noe_900', 'NOE', 900e6], 340 ['r1.900.out', 'r1_900', 'R1', 900e6], 341 ['r2.900.out', 'r2_900', 'R2', 900e6] 342 ] 343 for i in range(len(data)): 344 self._execute_uf(uf_name='relax_data.read', file=data_path+data[i][0], ri_id=data[i][1], ri_type=data[i][2], frq=data[i][3], mol_name_col=1, res_num_col=2, res_name_col=3, spin_num_col=4, spin_name_col=5, data_col=6, error_col=7) 345 346 # Simulate right clicking on the NOE to test the pop up menu (bug #20603, https://web.archive.org/web/https://gna.org/bugs/?20603). 347 analysis.relax_data.on_right_click(Fake_right_click()) 348 349 # Dipole-dipole interaction wizard: Initialisation. 350 analysis.setup_dipole_pair() 351 352 # Dipole-dipole interaction wizard: The interatom.define, interatom.set_dist, and interatom.unit_vectors user functions. 353 analysis.dipole_wizard._apply() 354 interpreter.flush() # Required because of the asynchronous uf call. 355 page = analysis.dipole_wizard.get_page(0) 356 page.uf_args['spin_id1'].SetValue(str_to_gui("@NE1")) 357 page.uf_args['spin_id2'].SetValue(str_to_gui("@HE1")) 358 analysis.dipole_wizard._go_next() 359 interpreter.flush() # Required because of the asynchronous uf call. 360 analysis.dipole_wizard._go_next() 361 interpreter.flush() # Required because of the asynchronous uf call. 362 analysis.dipole_wizard._go_next() 363 interpreter.flush() # Required because of the asynchronous uf call. 364 365 # Set up the CSA interaction. 366 analysis.value_set_csa() 367 uf_store['value.set'].wizard._go_next() 368 interpreter.flush() # Required because of the asynchronous uf call. 369 370 # Set up the nuclear isotopes. 371 analysis.spin_isotope_heteronuc() 372 uf_store['spin.isotope'].wizard._go_next() 373 interpreter.flush() # Required because of the asynchronous uf call. 374 analysis.spin_isotope_proton() 375 uf_store['spin.isotope'].wizard._go_next() 376 interpreter.flush() # Required because of the asynchronous uf call. 377 378 # Select only the tm0 and tm1 local tm models. 379 analysis.local_tm_model_field.select = [True, True, False, False, False, False, False, False, False, False] 380 analysis.local_tm_model_field.modify() 381 382 # Select only the m1 and m2 model-free models. 383 analysis.mf_model_field.select = [False, True, True, False, False, False, False, False, False, False] 384 analysis.mf_model_field.modify() 385 386 # Change the grid increments. 387 analysis.grid_inc.SetValue(3) 388 analysis.data.diff_tensor_grid_inc = {'sphere': 5, 'prolate': 5, 'oblate': 5, 'ellipsoid': 3} 389 390 # Set the number of Monte Carlo simulations. 391 analysis.mc_sim_num.SetValue(2) 392 393 # Set the maximum number of iterations (changing the allowed values). 394 analysis.max_iter.control.SetRange(0, 100) 395 analysis.max_iter.SetValue(1) 396 397 # Set the protocol mode to automatic. 398 analysis.mode_win.select_full_analysis() 399 analysis.mode_dialog() 400 401 # Check that the data has been correctly updated prior to execution. 402 analysis.sync_ds(upload=True) 403 self.assertEqual(analysis.data.save_dir, ds.tmpdir) 404 self.assertEqual(analysis.data.local_tm_models, ['tm0', 'tm1']) 405 self.assertEqual(analysis.data.mf_models, ['m1', 'm2']) 406 self.assertEqual(analysis.data.grid_inc, 3) 407 self.assertEqual(analysis.data.mc_sim_num, 2) 408 self.assertEqual(analysis.data.max_iter, 1) 409 self.assertEqual(analysis.data.diff_tensor_grid_inc['sphere'], 5) 410 self.assertEqual(analysis.data.diff_tensor_grid_inc['prolate'], 5) 411 self.assertEqual(analysis.data.diff_tensor_grid_inc['oblate'], 5) 412 self.assertEqual(analysis.data.diff_tensor_grid_inc['ellipsoid'], 3) 413 414 # Modify some of the class variables to speed up optimisation. 415 auto_model_free.dauvergne_protocol.dAuvergne_protocol.opt_func_tol = 1e-5 416 auto_model_free.dauvergne_protocol.dAuvergne_protocol.opt_max_iterations = 1000 417 418 # Execute relax. 419 state = analysis.execute(wx.CommandEvent(wx.wxEVT_COMMAND_BUTTON_CLICKED, analysis.button_exec_relax.GetId())) 420 421 # Wait for execution to complete. 422 if hasattr(analysis, 'thread'): 423 analysis.thread.join() 424 425 # Flush all wx events. 426 wx.Yield() 427 428 # Exceptions in the thread. 429 self.check_exceptions() 430 431 # Check the relax controller. 432 # FIXME: skipping the checks for certain wxPython bugs. 433 if status.relax_mode != 'gui' and wx.version() != '2.9.4.1 gtk2 (classic)': 434 self.assertEqual(self.app.gui.controller.mc_gauge_mf.GetValue(), 100) 435 self.assertEqual(self.app.gui.controller.progress_gauge_mf.GetValue(), 100) 436 self.assertEqual(self.app.gui.controller.main_gauge.GetValue(), 100) 437 438 # Check the diffusion tensor. 439 self.assertEqual(cdp.diff_tensor.type, 'sphere') 440 self.assertAlmostEqual(cdp.diff_tensor.tm, 1e-8) 441 self.assertEqual(cdp.diff_tensor.fixed, True) 442 443 # The global minimisation info. 444 self.assertAlmostEqual(cdp.chi2, 4e-19) 445 446 # The spin ID info. 447 mol_names = ["sphere_mol1"] * 20 448 res_names = ["GLY"] * 20 449 res_nums = [] 450 for i in range(1, 10): 451 res_nums.append(i) 452 res_nums.append(i) 453 res_nums.append(i) 454 res_nums.append(i) 455 spin_names = ["N", "H"] * 9 + ["NE1", "HE1"] 456 spin_nums = list(range(1, 21)) 457 isotopes = ["15N", "1H"] * 10 458 csa = [-172e-6, None] * 10 459 select = [True, False] * 10 460 fixed = [False, False] * 10 461 s2 = [0.8, None] * 10 462 te = [20e-12, None] * 10 463 464 # Check the spin data. 465 i = 0 466 for spin, mol_name, res_num, res_name in spin_loop(full_info=True): 467 # The ID info. 468 self.assertEqual(mol_name, mol_names[i]) 469 self.assertEqual(res_name, res_names[i]) 470 self.assertEqual(res_num, res_nums[i]) 471 self.assertEqual(spin.name, spin_names[i]) 472 self.assertEqual(spin.num, spin_nums[i]) 473 474 # The data. 475 self.assertEqual(spin.select, select[i]) 476 self.assertEqual(spin.fixed, fixed[i]) 477 self.assertEqual(spin.isotope, isotopes[i]) 478 if csa[i] == None: 479 self.assertEqual(spin.csa, None) 480 else: 481 self.assertAlmostEqual(spin.csa, csa[i]) 482 483 # The model-free data. 484 self.assertEqual(spin.model, 'm2') 485 self.assertEqual(spin.equation, 'mf_orig') 486 self.assertEqual(len(spin.params), 2) 487 self.assertEqual(spin.params[0], 's2') 488 self.assertEqual(spin.params[1], 'te') 489 if s2[i] == None: 490 self.assertEqual(spin.s2, None) 491 else: 492 self.assertAlmostEqual(spin.s2, 0.8) 493 self.assertEqual(spin.s2f, None) 494 self.assertEqual(spin.s2s, None) 495 self.assertEqual(spin.local_tm, None) 496 if te[i] == None: 497 self.assertEqual(spin.te, None) 498 else: 499 self.assertAlmostEqual(spin.te, 20e-12) 500 self.assertEqual(spin.tf, None) 501 self.assertEqual(spin.ts, None) 502 self.assertEqual(spin.rex, None) 503 504 # The spin minimisation info. 505 self.assertEqual(spin.chi2, None) 506 self.assertEqual(spin.iter, None) 507 self.assertEqual(spin.f_count, None) 508 self.assertEqual(spin.g_count, None) 509 self.assertEqual(spin.h_count, None) 510 self.assertEqual(spin.warning, None) 511 512 # Increment the index. 513 i += 1 514 515 # Check the interatomic data. 516 i = 0 517 for interatom in interatomic_loop(): 518 self.assertAlmostEqual(interatom.r, 1.02 * 1e-10)
519 520
521 - def test_opendx_s2_te_rex(self):
522 """Mapping the {S2, te, Rex} chi2 space through the OpenDX user function dx.map(). 523 524 This is to catch U{bug #22035<https://web.archive.org/web/https://gna.org/bugs/?22035>}, the dx.map user function being broken in the GUI. 525 """ 526 527 # Execute the script. 528 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'model_free'+sep+'opendx_s2_te_rex.py')
529 530 531
532 -class Fake_right_click:
533 """Simulate a grid_cell_right_click event .""" 534
535 - def GetPosition(self):
536 """Simulate the GetPosition() method.""" 537 538 # Return some random position. 539 return wx.Point(10, 10)
540 541
542 - def GetRow(self):
543 """Simulate the GetRow() method.""" 544 545 # Return the first row. 546 return 0
547