Package test_suite :: Package unit_tests :: Module value_testing_base
[hide private]
[frames] | no frames]

Source Code for Module test_suite.unit_tests.value_testing_base

   1  ############################################################################### 
   2  #                                                                             # 
   3  # Copyright (C) 2007-2012 Edward d'Auvergne                                   # 
   4  #                                                                             # 
   5  # This file is part of the program relax.                                     # 
   6  #                                                                             # 
   7  # relax 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 2 of the License, or           # 
  10  # (at your option) any later version.                                         # 
  11  #                                                                             # 
  12  # relax 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 relax; if not, write to the Free Software                        # 
  19  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   # 
  20  #                                                                             # 
  21  ############################################################################### 
  22   
  23  # Python module imports. 
  24  from math import pi 
  25   
  26  # relax module imports. 
  27  from data import Relax_data_store; ds = Relax_data_store() 
  28  from generic_fns import diffusion_tensor, pipes 
  29  from relax_errors import RelaxError, RelaxParamSetError, RelaxUnknownParamCombError 
  30  from test_suite.unit_tests.base_classes import UnitTestCase 
  31   
  32   
33 -class Value_base_class(UnitTestCase):
34 """Base class for the tests of both the 'prompt.value' and 'generic_fns.value' modules. 35 36 This base class also contains many shared unit tests. 37 """ 38
39 - def setUp(self):
40 """Set up for all the value unit tests.""" 41 42 # Add a consistency tests data pipe to the data store for testing consistency tests parameters. 43 ds.add(pipe_name='ct', pipe_type='ct') 44 45 # Add a model-free data pipe to the data store for testing model-free and diffusion parameters. 46 ds.add(pipe_name='mf', pipe_type='mf') 47 48 # Add a second model-free data pipe for copying tests. 49 ds.add(pipe_name='mf2', pipe_type='mf') 50 51 # Add a reduced spectral density mapping data pipe to the data store for testing RSDM parameters. 52 ds.add(pipe_name='jw', pipe_type='jw') 53 54 # Add a relaxation curve fitting data pipe to the data store for testing the associated parameters. 55 ds.add(pipe_name='relax_fit', pipe_type='relax_fit') 56 57 # Add a N-state model data pipe to the data store for testing the associated parameters. 58 ds.add(pipe_name='n_state', pipe_type='N-state') 59 60 # Set up some spins. 61 self.set_up_spins(pipe_name='ct') 62 self.set_up_spins(pipe_name='mf') 63 self.set_up_spins(pipe_name='jw') 64 self.set_up_spins(pipe_name='relax_fit') 65 66 # Set up the N-state model. 67 N = 4 68 ds['n_state'].N = N 69 ds['n_state'].alpha = [0.0] * N 70 ds['n_state'].beta = [0.0] * N 71 ds['n_state'].gamma = [0.0] * N
72 73
74 - def set_up_spins(self, pipe_name=None):
75 """Function for setting up a few spins for the given pipe.""" 76 77 # Alias the pipe. 78 pipe = pipes.get_pipe(pipe_name) 79 80 # Name the first molecule. 81 pipe.mol[0].name = 'Test mol' 82 83 # Create the first residue and add some data to its spin container. 84 pipe.mol[0].res[0].num = 1 85 pipe.mol[0].res[0].name = 'Met' 86 pipe.mol[0].res[0].spin[0].num = 111 87 pipe.mol[0].res[0].spin[0].name = 'NH' 88 89 # Add some more spins. 90 pipe.mol[0].res[0].spin.add_item('Ca', 114) 91 92 # Create a second residue. 93 pipe.mol[0].res.add_item('Trp', 2) 94 pipe.mol[0].res[1].spin[0].num = 112 95 pipe.mol[0].res[1].spin[0].name = 'NH'
96 97 98 99 100 ################################## 101 # Consistency testing parameters # 102 ################################## 103 104
105 - def test_set_ct_all_spins_j0(self):
106 """Set the consistency testing parameter J(0) for all spins. 107 108 The functions tested are both generic_fns.value.set() and prompt.value.set(). 109 """ 110 111 # Set the current data pipe to 'ct'. 112 pipes.switch('ct') 113 114 # Set the parameter. 115 self.value_fns.set(param='j0', val=4.5e-9) 116 117 # Test the parameter. 118 self.assertEqual(cdp.mol[0].res[0].spin[0].j0, 4.5e-9) 119 self.assertEqual(cdp.mol[0].res[1].spin[0].j0, 4.5e-9)
120 121
123 """Set the consistency testing parameter F_eta for all spins. 124 125 The functions tested are both generic_fns.value.set() and prompt.value.set(). 126 """ 127 128 # Set the current data pipe to 'ct'. 129 pipes.switch('ct') 130 131 # Set the parameter. 132 self.value_fns.set(param='f_eta', val=2.3e-10) 133 134 # Test the parameter. 135 self.assertEqual(cdp.mol[0].res[0].spin[0].f_eta, 2.3e-10) 136 self.assertEqual(cdp.mol[0].res[1].spin[0].f_eta, 2.3e-10)
137 138
139 - def test_set_ct_all_spins_f_r2(self):
140 """Set the consistency testing parameter F_R2 for all spins. 141 142 The functions tested are both generic_fns.value.set() and prompt.value.set(). 143 """ 144 145 # Set the current data pipe to 'ct'. 146 pipes.switch('ct') 147 148 # Set the parameter. 149 self.value_fns.set(param='f_r2', val=1.7e-12) 150 151 # Test the parameter. 152 self.assertEqual(cdp.mol[0].res[0].spin[0].f_r2, 1.7e-12) 153 self.assertEqual(cdp.mol[0].res[1].spin[0].f_r2, 1.7e-12)
154 155
156 - def test_set_ct_all_spins_r(self):
157 """Set the consistency testing bond length parameter for all spins. 158 159 The functions tested are both generic_fns.value.set() and prompt.value.set(). 160 """ 161 162 # Set the current data pipe to 'ct'. 163 pipes.switch('ct') 164 165 # Set the parameter. 166 self.value_fns.set(param='r', val=1.04e-10) 167 168 # Test the parameter. 169 self.assertEqual(cdp.mol[0].res[0].spin[0].r, 1.04e-10) 170 self.assertEqual(cdp.mol[0].res[1].spin[0].r, 1.04e-10)
171 172
173 - def test_set_ct_all_spins_csa(self):
174 """Set the consistency testing CSA parameter for all spins. 175 176 The functions tested are both generic_fns.value.set() and prompt.value.set(). 177 """ 178 179 # Set the current data pipe to 'ct'. 180 pipes.switch('ct') 181 182 # Set the parameter. 183 self.value_fns.set(param='csa', val=-160e-6) 184 185 # Test the parameter. 186 self.assertEqual(cdp.mol[0].res[0].spin[0].csa, -160e-6) 187 self.assertEqual(cdp.mol[0].res[1].spin[0].csa, -160e-6)
188 189
191 """Set the consistency testing heteronucleus type for all spins. 192 193 The functions tested are both generic_fns.value.set() and prompt.value.set(). 194 """ 195 196 # Set the current data pipe to 'ct'. 197 pipes.switch('ct') 198 199 # Set the parameter. 200 self.value_fns.set(param='heteronuc_type', val='13C') 201 202 # Test the parameter. 203 self.assertEqual(cdp.mol[0].res[0].spin[0].heteronuc_type, '13C') 204 self.assertEqual(cdp.mol[0].res[1].spin[0].heteronuc_type, '13C')
205 206
208 """Set the consistency testing theta angle for all spins. 209 210 The functions tested are both generic_fns.value.set() and prompt.value.set(). 211 """ 212 213 # Set the current data pipe to 'ct'. 214 pipes.switch('ct') 215 216 # Set the parameter. 217 self.value_fns.set(param='orientation', val=17) 218 219 # Test the parameter. 220 self.assertEqual(cdp.mol[0].res[0].spin[0].orientation, 17) 221 self.assertEqual(cdp.mol[0].res[1].spin[0].orientation, 17)
222 223
224 - def test_set_ct_all_spins_tc(self):
225 """Set the consistency testing approximate correlation time for all spins. 226 227 The functions tested are both generic_fns.value.set() and prompt.value.set(). 228 """ 229 230 # Set the current data pipe to 'ct'. 231 pipes.switch('ct') 232 233 # Set the parameter. 234 self.value_fns.set(param='tc', val=10) 235 236 # Test the parameter. 237 self.assertEqual(cdp.mol[0].res[0].spin[0].tc, 10) 238 self.assertEqual(cdp.mol[0].res[1].spin[0].tc, 10)
239 240
242 """Set different consistency tests parameters J(0), F_eta, F_R2 for all spins. 243 244 The functions tested are both generic_fns.value.set() and prompt.value.set(). 245 """ 246 247 # Set the current data pipe to 'ct'. 248 pipes.switch('ct') 249 250 # Set the parameter. 251 self.value_fns.set(param=['j0', 'f_eta', 'f_r2'], val=[6.4e-9, 3.5e-10, 2.3e-12]) 252 253 # Test the parameter. 254 self.assertEqual(cdp.mol[0].res[0].spin[0].j0, 6.4e-9) 255 self.assertEqual(cdp.mol[0].res[0].spin[0].f_eta, 3.5e-10) 256 self.assertEqual(cdp.mol[0].res[0].spin[0].f_r2, 2.3e-12) 257 self.assertEqual(cdp.mol[0].res[1].spin[0].j0, 6.4e-9) 258 self.assertEqual(cdp.mol[0].res[1].spin[0].f_eta, 3.5e-10) 259 self.assertEqual(cdp.mol[0].res[1].spin[0].f_r2, 2.3e-12)
260 261
263 """Set consistency tests parameters J(0), F_eta, F_R2 for all spins to the same value. 264 265 The functions tested are both generic_fns.value.set() and prompt.value.set(). 266 """ 267 268 # Set the current data pipe to 'ct'. 269 pipes.switch('ct') 270 271 # Set the parameter. 272 self.value_fns.set(param=['j0', 'f_eta', 'f_r2'], val=1.9e-10) 273 274 # Test the parameter. 275 self.assertEqual(cdp.mol[0].res[0].spin[0].j0, 1.9e-10) 276 self.assertEqual(cdp.mol[0].res[0].spin[0].f_eta, 1.9e-10) 277 self.assertEqual(cdp.mol[0].res[0].spin[0].f_r2, 1.9e-10) 278 self.assertEqual(cdp.mol[0].res[1].spin[0].j0, 1.9e-10) 279 self.assertEqual(cdp.mol[0].res[1].spin[0].f_eta, 1.9e-10) 280 self.assertEqual(cdp.mol[0].res[1].spin[0].f_r2, 1.9e-10)
281 282
283 - def test_set_ct_defaults_j0(self):
284 """Set the consistency testing parameter J(0) to the default value (there is none!). 285 286 The functions tested are both generic_fns.value.set() and prompt.value.set(). 287 """ 288 289 # Set the current data pipe to 'ct'. 290 pipes.switch('ct') 291 292 # Set the parameter. 293 self.assertRaises(RelaxParamSetError, self.value_fns.set, param='j0')
294 295
296 - def test_set_ct_defaults_f_eta(self):
297 """Set the consistency tests parameter F_eta to the default value (there is none!). 298 299 The functions tested are both generic_fns.value.set() and prompt.value.set(). 300 """ 301 302 # Set the current data pipe to 'ct'. 303 pipes.switch('ct') 304 305 # Set the parameter. 306 self.assertRaises(RelaxParamSetError, self.value_fns.set, param='f_eta')
307 308
309 - def test_set_ct_defaults_f_r2(self):
310 """Set the consistency tests parameter F_R2 to the default value (there is none!). 311 312 The functions tested are both generic_fns.value.set() and prompt.value.set(). 313 """ 314 315 # Set the current data pipe to 'ct'. 316 pipes.switch('ct') 317 318 # Set the parameter. 319 self.assertRaises(RelaxParamSetError, self.value_fns.set, param='f_r2')
320 321
322 - def test_set_ct_defaults_r(self):
323 """Set the consistency testing bond length parameter to the default value. 324 325 The functions tested are both generic_fns.value.set() and prompt.value.set(). 326 """ 327 328 # Set the current data pipe to 'ct'. 329 pipes.switch('ct') 330 331 # Set the parameter. 332 self.value_fns.set(param='r') 333 334 # Test the parameter. 335 self.assertAlmostEqual(cdp.mol[0].res[0].spin[0].r, 1.02e-10) 336 self.assertAlmostEqual(cdp.mol[0].res[1].spin[0].r, 1.02e-10)
337 338
339 - def test_set_ct_defaults_csa(self):
340 """Set the consistency testing CSA parameter to the default value. 341 342 The functions tested are both generic_fns.value.set() and prompt.value.set(). 343 """ 344 345 # Set the current data pipe to 'ct'. 346 pipes.switch('ct') 347 348 # Set the parameter. 349 self.value_fns.set(param='csa') 350 351 # Test the parameter. 352 self.assertAlmostEqual(cdp.mol[0].res[0].spin[0].csa, -172e-6) 353 self.assertAlmostEqual(cdp.mol[0].res[1].spin[0].csa, -172e-6)
354 355
357 """Set the consistency testing heteronucleus type to the default value. 358 359 The functions tested are both generic_fns.value.set() and prompt.value.set(). 360 """ 361 362 # Set the current data pipe to 'ct'. 363 pipes.switch('ct') 364 365 # Set the parameter. 366 self.value_fns.set(param='heteronuc_type') 367 368 # Test the parameter. 369 self.assertEqual(cdp.mol[0].res[0].spin[0].heteronuc_type, '15N') 370 self.assertEqual(cdp.mol[0].res[1].spin[0].heteronuc_type, '15N')
371 372
374 """Set the consistency testing theta angle parameter to the default value. 375 376 The functions tested are both generic_fns.value.set() and prompt.value.set(). 377 """ 378 379 # Set the current data pipe to 'ct'. 380 pipes.switch('ct') 381 382 # Set the parameter. 383 self.value_fns.set(param='orientation') 384 385 # Test the parameter. 386 self.assertAlmostEqual(cdp.mol[0].res[0].spin[0].orientation, 15.7) 387 self.assertAlmostEqual(cdp.mol[0].res[1].spin[0].orientation, 15.7)
388 389
390 - def test_set_ct_defaults_tc(self):
391 """Set the consistency testing approximate correlation time parameter to the default value. 392 393 The functions tested are both generic_fns.value.set() and prompt.value.set(). 394 """ 395 396 # Set the current data pipe to 'ct'. 397 pipes.switch('ct') 398 399 # Set the parameter. 400 self.value_fns.set(param='tc') 401 402 # Test the parameter. 403 self.assertAlmostEqual(cdp.mol[0].res[0].spin[0].tc, 13 * 1e-9) 404 self.assertAlmostEqual(cdp.mol[0].res[1].spin[0].tc, 13 * 1e-9)
405 406
408 """Set different consistency testing parameters J(0), F_eta, F_R2 to the default values (there are none!). 409 410 The functions tested are both generic_fns.value.set() and prompt.value.set(). 411 """ 412 413 # Set the current data pipe to 'ct'. 414 pipes.switch('ct') 415 416 # Set the parameter. 417 self.assertRaises(RelaxParamSetError, self.value_fns.set, param=['j0', 'f_eta', 'f_r2'])
418 419
420 - def test_set_ct_single_spin_j0(self):
421 """Set the consistency tests parameter J(0) for a single spin. 422 423 The functions tested are both generic_fns.value.set() and prompt.value.set(). 424 """ 425 426 # Set the current data pipe to 'ct'. 427 pipes.switch('ct') 428 429 # Set the parameter. 430 self.value_fns.set(param='j0', val=4.5e-9, spin_id='@112') 431 432 # Test the parameter. 433 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'j0')) 434 self.assertEqual(cdp.mol[0].res[1].spin[0].j0, 4.5e-9)
435 436
438 """Set the consistency tests parameter F_eta for a single spin. 439 440 The functions tested are both generic_fns.value.set() and prompt.value.set(). 441 """ 442 443 # Set the current data pipe to 'ct'. 444 pipes.switch('ct') 445 446 # Set the parameter. 447 self.value_fns.set(param='f_eta', val=2.3e-10, spin_id='@112') 448 449 # Test the parameter. 450 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'f_eta')) 451 self.assertEqual(cdp.mol[0].res[1].spin[0].f_eta, 2.3e-10)
452 453
455 """Set the consistency tests parameter F_R2 for a single spin. 456 457 The functions tested are both generic_fns.value.set() and prompt.value.set(). 458 """ 459 460 # Set the current data pipe to 'ct'. 461 pipes.switch('ct') 462 463 # Set the parameter. 464 self.value_fns.set(param='f_r2', val=1.7e-12, spin_id='@112') 465 466 # Test the parameter. 467 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'f_r2')) 468 self.assertEqual(cdp.mol[0].res[1].spin[0].f_r2, 1.7e-12)
469 470
471 - def test_set_ct_single_spin_r(self):
472 """Set the consistency tests bond length parameter for a single spin. 473 474 The functions tested are both generic_fns.value.set() and prompt.value.set(). 475 """ 476 477 # Set the current data pipe to 'ct'. 478 pipes.switch('ct') 479 480 # Set the parameter. 481 self.value_fns.set(param='r', val=1.04e-10, spin_id='@112') 482 483 # Test the parameter. 484 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'r')) 485 self.assertEqual(cdp.mol[0].res[1].spin[0].r, 1.04e-10)
486 487
489 """Set the consistency tests CSA parameter for a single spin. 490 491 The functions tested are both generic_fns.value.set() and prompt.value.set(). 492 """ 493 494 # Set the current data pipe to 'ct'. 495 pipes.switch('ct') 496 497 # Set the parameter. 498 self.value_fns.set(param='csa', val=-160e-6, spin_id='@112') 499 500 # Test the parameter. 501 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'csa')) 502 self.assertEqual(cdp.mol[0].res[1].spin[0].csa, -160e-6)
503 504
506 """Set the consistency testing heteronucleus type for a single spin. 507 508 The functions tested are both generic_fns.value.set() and prompt.value.set(). 509 """ 510 511 # Set the current data pipe to 'ct'. 512 pipes.switch('ct') 513 514 # Set the parameter. 515 self.value_fns.set(param='heteronuc_type', val='13C', spin_id='@112') 516 517 # Test the parameter. 518 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'heteronuc_type')) 519 self.assertEqual(cdp.mol[0].res[1].spin[0].heteronuc_type, '13C')
520 521
523 """Set the consistency tests theta angle parameter for a single spin. 524 525 The functions tested are both generic_fns.value.set() and prompt.value.set(). 526 """ 527 528 # Set the current data pipe to 'ct'. 529 pipes.switch('ct') 530 531 # Set the parameter. 532 self.value_fns.set(param='orientation', val=17, spin_id='@112') 533 534 # Test the parameter. 535 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'orientation')) 536 self.assertEqual(cdp.mol[0].res[1].spin[0].orientation, 17)
537 538
539 - def test_set_ct_single_spin_tc(self):
540 """Set the consistency tests approximate correlation time parameter for a single spin. 541 542 The functions tested are both generic_fns.value.set() and prompt.value.set(). 543 """ 544 545 # Set the current data pipe to 'ct'. 546 pipes.switch('ct') 547 548 # Set the parameter. 549 self.value_fns.set(param='tc', val=10, spin_id='@112') 550 551 # Test the parameter. 552 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'tc')) 553 self.assertEqual(cdp.mol[0].res[1].spin[0].tc, 10)
554 555
557 """Set different consistency tests parameters J(0), F_eta, F_R2 for a single spin. 558 559 The functions tested are both generic_fns.value.set() and prompt.value.set(). 560 """ 561 562 # Set the current data pipe to 'ct'. 563 pipes.switch('ct') 564 565 # Set the parameter. 566 self.value_fns.set(param=['j0', 'f_eta', 'f_r2'], val=[6.4e-9, 3.5e-10, 2.3e-12], spin_id='@112') 567 568 # Test the parameter. 569 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'j0')) 570 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'f_eta')) 571 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'f_r2')) 572 self.assertEqual(cdp.mol[0].res[1].spin[0].j0, 6.4e-9) 573 self.assertEqual(cdp.mol[0].res[1].spin[0].f_eta, 3.5e-10) 574 self.assertEqual(cdp.mol[0].res[1].spin[0].f_r2, 2.3e-12)
575 576
578 """Set consistency tests parameters J(0), F_eta, F_R2 for a single spin to the same value. 579 580 The functions tested are both generic_fns.value.set() and prompt.value.set(). 581 """ 582 583 # Set the current data pipe to 'ct'. 584 pipes.switch('ct') 585 586 # Set the parameter. 587 self.value_fns.set(param=['j0', 'f_eta', 'f_r2'], val=1.9e-10, spin_id='@112') 588 589 # Test the parameter. 590 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'j0')) 591 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'f_eta')) 592 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'f_r2')) 593 self.assertEqual(cdp.mol[0].res[1].spin[0].j0, 1.9e-10) 594 self.assertEqual(cdp.mol[0].res[1].spin[0].f_eta, 1.9e-10) 595 self.assertEqual(cdp.mol[0].res[1].spin[0].f_r2, 1.9e-10)
596 597 598 599 600 ##################################################### 601 # Diffusion tensor parameters (Model-free analysis) # 602 ##################################################### 603 604
606 """Set the spherical diffusion tensor tm parameter to the default value. 607 608 The functions tested are both generic_fns.value.set() and prompt.value.set(). 609 """ 610 611 # Set the current data pipe to 'mf'. 612 pipes.switch('mf') 613 614 # Initialise a diffusion tensor. 615 diffusion_tensor.init(1e-9) 616 617 # Set the parameter. 618 self.value_fns.set(param='tm') 619 620 # Test the parameter. 621 self.assertEqual(cdp.diff_tensor.tm, 1e-8)
622 623
625 """Set the spherical diffusion tensor Diso parameter to the default value. 626 627 The functions tested are both generic_fns.value.set() and prompt.value.set(). 628 """ 629 630 # Set the current data pipe to 'mf'. 631 pipes.switch('mf') 632 633 # Initialise a diffusion tensor. 634 diffusion_tensor.init(1e-9) 635 636 # Set the parameter. 637 self.value_fns.set(param='Diso') 638 639 # Test the parameter. 640 self.assertAlmostEqual(cdp.diff_tensor.Diso, 1.666e7)
641 642
644 """Try to set the spherical diffusion tensor Da parameter to the default value. 645 646 The functions tested are both generic_fns.value.set() and prompt.value.set(). 647 """ 648 649 # Set the current data pipe to 'mf'. 650 pipes.switch('mf') 651 652 # Initialise a diffusion tensor. 653 diffusion_tensor.init(1e-9) 654 655 # Set the parameter. 656 self.assertRaises(RelaxError, self.value_fns.set, param='Da')
657 658
660 """Try to set the spherical diffusion tensor Dr parameter to the default value. 661 662 The functions tested are both generic_fns.value.set() and prompt.value.set(). 663 """ 664 665 # Set the current data pipe to 'mf'. 666 pipes.switch('mf') 667 668 # Initialise a diffusion tensor. 669 diffusion_tensor.init(1e-9) 670 671 # Set the parameter. 672 self.assertRaises(RelaxError, self.value_fns.set, param='Dr')
673 674
676 """Try to set the spherical diffusion tensor Dx parameter to the default value. 677 678 The functions tested are both generic_fns.value.set() and prompt.value.set(). 679 """ 680 681 # Set the current data pipe to 'mf'. 682 pipes.switch('mf') 683 684 # Initialise a diffusion tensor. 685 diffusion_tensor.init(1e-9) 686 687 # Set the parameter. 688 self.assertRaises(RelaxError, self.value_fns.set, param='Dx')
689 690
692 """Try to set the spherical diffusion tensor Dy parameter to the default value. 693 694 The functions tested are both generic_fns.value.set() and prompt.value.set(). 695 """ 696 697 # Set the current data pipe to 'mf'. 698 pipes.switch('mf') 699 700 # Initialise a diffusion tensor. 701 diffusion_tensor.init(1e-9) 702 703 # Set the parameter. 704 self.assertRaises(RelaxError, self.value_fns.set, param='Dy')
705 706
708 """Try to set the spherical diffusion tensor Dz parameter to the default value. 709 710 The functions tested are both generic_fns.value.set() and prompt.value.set(). 711 """ 712 713 # Set the current data pipe to 'mf'. 714 pipes.switch('mf') 715 716 # Initialise a diffusion tensor. 717 diffusion_tensor.init(1e-9) 718 719 # Set the parameter. 720 self.assertRaises(RelaxError, self.value_fns.set, param='Dz')
721 722
724 """Try to set the spherical diffusion tensor Dpar parameter to the default value. 725 726 The functions tested are both generic_fns.value.set() and prompt.value.set(). 727 """ 728 729 # Set the current data pipe to 'mf'. 730 pipes.switch('mf') 731 732 # Initialise a diffusion tensor. 733 diffusion_tensor.init(1e-9) 734 735 # Set the parameter. 736 self.assertRaises(RelaxError, self.value_fns.set, param='Dpar')
737 738
740 """Try to set the spherical diffusion tensor Dper parameter to the default value. 741 742 The functions tested are both generic_fns.value.set() and prompt.value.set(). 743 """ 744 745 # Set the current data pipe to 'mf'. 746 pipes.switch('mf') 747 748 # Initialise a diffusion tensor. 749 diffusion_tensor.init(1e-9) 750 751 # Set the parameter. 752 self.assertRaises(RelaxError, self.value_fns.set, param='Dper')
753 754
756 """Try to set the spherical diffusion tensor Dratio parameter to the default value. 757 758 The functions tested are both generic_fns.value.set() and prompt.value.set(). 759 """ 760 761 # Set the current data pipe to 'mf'. 762 pipes.switch('mf') 763 764 # Initialise a diffusion tensor. 765 diffusion_tensor.init(1e-9) 766 767 # Set the parameter. 768 self.assertRaises(RelaxError, self.value_fns.set, param='Dratio')
769 770
772 """Try to set the spherical diffusion tensor alpha parameter to the default value. 773 774 The functions tested are both generic_fns.value.set() and prompt.value.set(). 775 """ 776 777 # Set the current data pipe to 'mf'. 778 pipes.switch('mf') 779 780 # Initialise a diffusion tensor. 781 diffusion_tensor.init(1e-9) 782 783 # Set the parameter. 784 self.assertRaises(RelaxError, self.value_fns.set, param='alpha')
785 786
788 """Try to set the spherical diffusion tensor beta parameter to the default value. 789 790 The functions tested are both generic_fns.value.set() and prompt.value.set(). 791 """ 792 793 # Set the current data pipe to 'mf'. 794 pipes.switch('mf') 795 796 # Initialise a diffusion tensor. 797 diffusion_tensor.init(1e-9) 798 799 # Set the parameter. 800 self.assertRaises(RelaxError, self.value_fns.set, param='beta')
801 802
804 """Try to set the spherical diffusion tensor gamma parameter to the default value. 805 806 The functions tested are both generic_fns.value.set() and prompt.value.set(). 807 """ 808 809 # Set the current data pipe to 'mf'. 810 pipes.switch('mf') 811 812 # Initialise a diffusion tensor. 813 diffusion_tensor.init(1e-9) 814 815 # Set the parameter. 816 self.assertRaises(RelaxError, self.value_fns.set, param='gamma')
817 818
820 """Try to set the spherical diffusion tensor theta parameter to the default value. 821 822 The functions tested are both generic_fns.value.set() and prompt.value.set(). 823 """ 824 825 # Set the current data pipe to 'mf'. 826 pipes.switch('mf') 827 828 # Initialise a diffusion tensor. 829 diffusion_tensor.init(1e-9) 830 831 # Set the parameter. 832 self.assertRaises(RelaxError, self.value_fns.set, param='theta')
833 834
836 """Try to set the spherical diffusion tensor phi parameter to the default value. 837 838 The functions tested are both generic_fns.value.set() and prompt.value.set(). 839 """ 840 841 # Set the current data pipe to 'mf'. 842 pipes.switch('mf') 843 844 # Initialise a diffusion tensor. 845 diffusion_tensor.init(1e-9) 846 847 # Set the parameter. 848 self.assertRaises(RelaxError, self.value_fns.set, param='phi')
849 850
852 """Set the spheroidal diffusion tensor tm parameter to the default value. 853 854 The functions tested are both generic_fns.value.set() and prompt.value.set(). 855 """ 856 857 # Set the current data pipe to 'mf'. 858 pipes.switch('mf') 859 860 # Initialise a diffusion tensor. 861 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 862 863 # Set the parameter. 864 self.value_fns.set(param='tm') 865 866 # Test the parameter. 867 self.assertEqual(cdp.diff_tensor.tm, 1e-8)
868 869
871 """Set the spheroidal diffusion tensor Diso parameter to the default value. 872 873 The functions tested are both generic_fns.value.set() and prompt.value.set(). 874 """ 875 876 # Set the current data pipe to 'mf'. 877 pipes.switch('mf') 878 879 # Initialise a diffusion tensor. 880 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 881 882 # Set the parameter. 883 self.value_fns.set(param='Diso') 884 885 # Test the parameter. 886 self.assertEqual(cdp.diff_tensor.tm, 1./(6*1.666e7))
887 888
890 """Set the spheroidal diffusion tensor Da parameter to the default value. 891 892 The functions tested are both generic_fns.value.set() and prompt.value.set(). 893 """ 894 895 # Set the current data pipe to 'mf'. 896 pipes.switch('mf') 897 898 # Initialise a diffusion tensor. 899 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 900 901 # Set the parameter. 902 self.value_fns.set(param='Da') 903 904 # Test the parameter. 905 self.assertEqual(cdp.diff_tensor.Da, 0.0)
906 907
909 """Set the spheroidal diffusion tensor Dr parameter to the default value. 910 911 The functions tested are both generic_fns.value.set() and prompt.value.set(). 912 """ 913 914 # Set the current data pipe to 'mf'. 915 pipes.switch('mf') 916 917 # Initialise a diffusion tensor. 918 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 919 920 # Set the parameter. 921 self.assertRaises(RelaxError, self.value_fns.set, param='Dr')
922 923
925 """Set the spheroidal diffusion tensor Dx parameter to the default value. 926 927 The functions tested are both generic_fns.value.set() and prompt.value.set(). 928 """ 929 930 # Set the current data pipe to 'mf'. 931 pipes.switch('mf') 932 933 # Initialise a diffusion tensor. 934 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 935 936 # Set the parameter. 937 self.assertRaises(RelaxError, self.value_fns.set, param='Dx')
938 939
941 """Set the spheroidal diffusion tensor Dy parameter to the default value. 942 943 The functions tested are both generic_fns.value.set() and prompt.value.set(). 944 """ 945 946 # Set the current data pipe to 'mf'. 947 pipes.switch('mf') 948 949 # Initialise a diffusion tensor. 950 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 951 952 # Set the parameter. 953 self.assertRaises(RelaxError, self.value_fns.set, param='Dy')
954 955
957 """Set the spheroidal diffusion tensor Dz parameter to the default value. 958 959 The functions tested are both generic_fns.value.set() and prompt.value.set(). 960 """ 961 962 # Set the current data pipe to 'mf'. 963 pipes.switch('mf') 964 965 # Initialise a diffusion tensor. 966 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 967 968 # Set the parameter. 969 self.assertRaises(RelaxError, self.value_fns.set, param='Dz')
970 971
973 """Try to set the spheroidal diffusion tensor Dpar parameter to the default value (this should not be possible). 974 975 The functions tested are both generic_fns.value.set() and prompt.value.set(). 976 """ 977 978 # Set the current data pipe to 'mf'. 979 pipes.switch('mf') 980 981 # Initialise a diffusion tensor. 982 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 983 984 # Set the parameter. 985 self.assertRaises(RelaxError, self.value_fns.set, param='Dpar')
986 987
989 """Try to set the spheroidal diffusion tensor Dper parameter to the default value (this should not be possible). 990 991 The functions tested are both generic_fns.value.set() and prompt.value.set(). 992 """ 993 994 # Set the current data pipe to 'mf'. 995 pipes.switch('mf') 996 997 # Initialise a diffusion tensor. 998 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 999 1000 # Set the parameter. 1001 self.assertRaises(RelaxError, self.value_fns.set, param='Dper')
1002 1003
1005 """Set the spheroidal diffusion tensor Dratio parameter to the default value. 1006 1007 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1008 """ 1009 1010 # Set the current data pipe to 'mf'. 1011 pipes.switch('mf') 1012 1013 # Initialise a diffusion tensor. 1014 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1015 1016 # Set the parameter. 1017 self.value_fns.set(param='Dratio') 1018 1019 # Test the parameter. 1020 self.assertEqual(cdp.diff_tensor.Dratio, 1.0)
1021 1022
1024 """Try to set the spheroidal diffusion tensor alpha parameter to the default value. 1025 1026 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1027 """ 1028 1029 # Set the current data pipe to 'mf'. 1030 pipes.switch('mf') 1031 1032 # Initialise a diffusion tensor. 1033 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1034 1035 # Set the parameter. 1036 self.assertRaises(RelaxError, self.value_fns.set, param='alpha')
1037 1038
1040 """Try to set the spheroidal diffusion tensor beta parameter to the default value. 1041 1042 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1043 """ 1044 1045 # Set the current data pipe to 'mf'. 1046 pipes.switch('mf') 1047 1048 # Initialise a diffusion tensor. 1049 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1050 1051 # Set the parameter. 1052 self.assertRaises(RelaxError, self.value_fns.set, param='beta')
1053 1054
1056 """Try to set the spheroidal diffusion tensor gamma parameter to the default value. 1057 1058 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1059 """ 1060 1061 # Set the current data pipe to 'mf'. 1062 pipes.switch('mf') 1063 1064 # Initialise a diffusion tensor. 1065 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1066 1067 # Set the parameter. 1068 self.assertRaises(RelaxError, self.value_fns.set, param='gamma')
1069 1070
1072 """Set the spheroidal diffusion tensor theta parameter to the default value. 1073 1074 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1075 """ 1076 1077 # Set the current data pipe to 'mf'. 1078 pipes.switch('mf') 1079 1080 # Initialise a diffusion tensor. 1081 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1082 1083 # Set the parameter. 1084 self.value_fns.set(param='theta') 1085 1086 # Test the parameter. 1087 self.assertEqual(cdp.diff_tensor.theta, 0.0)
1088 1089
1091 """Set the spheroidal diffusion tensor phi parameter to the default value. 1092 1093 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1094 """ 1095 1096 # Set the current data pipe to 'mf'. 1097 pipes.switch('mf') 1098 1099 # Initialise a diffusion tensor. 1100 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1101 1102 # Set the parameter. 1103 self.value_fns.set(param='phi') 1104 1105 # Test the parameter. 1106 self.assertEqual(cdp.diff_tensor.phi, 0.0)
1107 1108
1110 """Set the spheroidal diffusion tensor parameters {tm, Da} to the default values. 1111 1112 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1113 """ 1114 1115 # Set the current data pipe to 'mf'. 1116 pipes.switch('mf') 1117 1118 # Initialise a diffusion tensor. 1119 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1120 1121 # Set the parameters. 1122 self.value_fns.set(param=['tm', 'Da']) 1123 1124 # Test the parameter. 1125 self.assertEqual(cdp.diff_tensor.tm, 1e-8) 1126 self.assertEqual(cdp.diff_tensor.Da, 0.0)
1127 1128
1130 """Set the spheroidal diffusion tensor parameters {Diso, Da} to the default values. 1131 1132 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1133 """ 1134 1135 # Set the current data pipe to 'mf'. 1136 pipes.switch('mf') 1137 1138 # Initialise a diffusion tensor. 1139 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1140 1141 # Set the parameters. 1142 self.value_fns.set(param=['Diso', 'Da']) 1143 1144 # Test the parameter. 1145 self.assertAlmostEqual(cdp.diff_tensor.Diso, 1.666e7) 1146 self.assertEqual(cdp.diff_tensor.Da, 0.0)
1147 1148
1150 """Set the spheroidal diffusion tensor parameters {tm, Dratio} to the default values. 1151 1152 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1153 """ 1154 1155 # Set the current data pipe to 'mf'. 1156 pipes.switch('mf') 1157 1158 # Initialise a diffusion tensor. 1159 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1160 1161 # Set the parameters. 1162 self.value_fns.set(param=['tm', 'Dratio']) 1163 1164 # Test the parameter. 1165 self.assertEqual(cdp.diff_tensor.tm, 1e-8) 1166 self.assertEqual(cdp.diff_tensor.Dratio, 1.0)
1167 1168
1170 """Set the spheroidal diffusion tensor parameters {Dpar, Dper} to the default values. 1171 1172 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1173 """ 1174 1175 # Set the current data pipe to 'mf'. 1176 pipes.switch('mf') 1177 1178 # Initialise a diffusion tensor. 1179 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1180 1181 # Set the parameters. 1182 self.value_fns.set(param=['Dpar', 'Dper']) 1183 1184 # Test the parameter. 1185 self.assertAlmostEqual(cdp.diff_tensor.Dpar, 1.666e7) 1186 self.assertAlmostEqual(cdp.diff_tensor.Dper, 1.666e7)
1187 1188
1190 """Set the spheroidal diffusion tensor parameters {Dper, Dpar} to the default values. 1191 1192 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1193 """ 1194 1195 # Set the current data pipe to 'mf'. 1196 pipes.switch('mf') 1197 1198 # Initialise a diffusion tensor. 1199 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1200 1201 # Set the parameters. 1202 self.value_fns.set(param=['Dper', 'Dpar']) 1203 1204 # Test the parameter. 1205 self.assertAlmostEqual(cdp.diff_tensor.Dper, 1.666e7) 1206 self.assertAlmostEqual(cdp.diff_tensor.Dpar, 1.666e7)
1207 1208
1210 """Set the spheroidal diffusion tensor parameters {Diso, Dratio} to the default values. 1211 1212 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1213 """ 1214 1215 # Set the current data pipe to 'mf'. 1216 pipes.switch('mf') 1217 1218 # Initialise a diffusion tensor. 1219 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1220 1221 # Set the parameters. 1222 self.value_fns.set(param=['Diso', 'Dratio']) 1223 1224 # Test the parameter. 1225 self.assertAlmostEqual(cdp.diff_tensor.Diso, 1.666e7) 1226 self.assertEqual(cdp.diff_tensor.Dratio, 1.0)
1227 1228
1230 """Set the spheroidal diffusion tensor parameters {Dpar, Dratio} to the default values (this should not be possible). 1231 1232 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1233 """ 1234 1235 # Set the current data pipe to 'mf'. 1236 pipes.switch('mf') 1237 1238 # Initialise a diffusion tensor. 1239 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1240 1241 # Set the parameters. 1242 self.assertRaises(RelaxUnknownParamCombError, self.value_fns.set, param=['Dpar', 'Dratio'])
1243 1244
1246 """Set the ellipsoidal diffusion tensor tm parameter to the default value. 1247 1248 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1249 """ 1250 1251 # Set the current data pipe to 'mf'. 1252 pipes.switch('mf') 1253 1254 # Initialise a diffusion tensor. 1255 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 1256 1257 # Set the parameter. 1258 self.value_fns.set(param='tm') 1259 1260 # Test the parameter. 1261 self.assertEqual(cdp.diff_tensor.tm, 1e-8)
1262 1263
1265 """Set the ellipsoidal diffusion tensor Diso parameter to the default value. 1266 1267 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1268 """ 1269 1270 # Set the current data pipe to 'mf'. 1271 pipes.switch('mf') 1272 1273 # Initialise a diffusion tensor. 1274 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 1275 1276 # Set the parameter. 1277 self.value_fns.set(param='Diso') 1278 1279 # Test the parameter. 1280 self.assertEqual(cdp.diff_tensor.tm, 1./(6*1.666e7))
1281 1282
1284 """Set the ellipsoidal diffusion tensor Da parameter to the default value. 1285 1286 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1287 """ 1288 1289 # Set the current data pipe to 'mf'. 1290 pipes.switch('mf') 1291 1292 # Initialise a diffusion tensor. 1293 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 1294 1295 # Set the parameter. 1296 self.value_fns.set(param='Da') 1297 1298 # Test the parameter. 1299 self.assertEqual(cdp.diff_tensor.Da, 0.0)
1300 1301
1303 """Set the ellipsoidal diffusion tensor Dr parameter to the default value. 1304 1305 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1306 """ 1307 1308 # Set the current data pipe to 'mf'. 1309 pipes.switch('mf') 1310 1311 # Initialise a diffusion tensor. 1312 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 1313 1314 # Set the parameter. 1315 self.value_fns.set(param='Dr') 1316 1317 # Test the parameter. 1318 self.assertEqual(cdp.diff_tensor.Dr, 0.0)
1319 1320
1322 """Set the ellipsoidal diffusion tensor Dx parameter to the default value. 1323 1324 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1325 """ 1326 1327 # Set the current data pipe to 'mf'. 1328 pipes.switch('mf') 1329 1330 # Initialise a diffusion tensor. 1331 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 1332 1333 # Set the parameter. 1334 self.assertRaises(RelaxError, self.value_fns.set, param='Dx')
1335 1336
1338 """Set the ellipsoidal diffusion tensor Dy parameter to the default value. 1339 1340 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1341 """ 1342 1343 # Set the current data pipe to 'mf'. 1344 pipes.switch('mf') 1345 1346 # Initialise a diffusion tensor. 1347 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 1348 1349 # Set the parameter. 1350 self.assertRaises(RelaxError, self.value_fns.set, param='Dy')
1351 1352
1354 """Set the ellipsoidal diffusion tensor Dz parameter to the default value. 1355 1356 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1357 """ 1358 1359 # Set the current data pipe to 'mf'. 1360 pipes.switch('mf') 1361 1362 # Initialise a diffusion tensor. 1363 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 1364 1365 # Set the parameter. 1366 self.assertRaises(RelaxError, self.value_fns.set, param='Dz')
1367 1368
1370 """Try to set the ellipsoidal diffusion tensor Dpar parameter to the default value (this should not be possible). 1371 1372 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1373 """ 1374 1375 # Set the current data pipe to 'mf'. 1376 pipes.switch('mf') 1377 1378 # Initialise a diffusion tensor. 1379 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 1380 1381 # Set the parameter. 1382 self.assertRaises(RelaxError, self.value_fns.set, param='Dpar')
1383 1384
1386 """Try to set the ellipsoidal diffusion tensor Dper parameter to the default value (this should not be possible). 1387 1388 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1389 """ 1390 1391 # Set the current data pipe to 'mf'. 1392 pipes.switch('mf') 1393 1394 # Initialise a diffusion tensor. 1395 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 1396 1397 # Set the parameter. 1398 self.assertRaises(RelaxError, self.value_fns.set, param='Dper')
1399 1400
1402 """Set the ellipsoidal diffusion tensor Dratio parameter to the default value. 1403 1404 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1405 """ 1406 1407 # Set the current data pipe to 'mf'. 1408 pipes.switch('mf') 1409 1410 # Initialise a diffusion tensor. 1411 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 1412 1413 # Set the parameter. 1414 self.assertRaises(RelaxError, self.value_fns.set, param='Dratio')
1415 1416
1418 """Try to set the ellipsoidal diffusion tensor alpha parameter to the default value. 1419 1420 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1421 """ 1422 1423 # Set the current data pipe to 'mf'. 1424 pipes.switch('mf') 1425 1426 # Initialise a diffusion tensor. 1427 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 1428 1429 # Set the parameter. 1430 self.value_fns.set(param='alpha') 1431 1432 # Test the parameter. 1433 self.assertEqual(cdp.diff_tensor.alpha, 0.0)
1434 1435
1437 """Try to set the ellipsoidal diffusion tensor beta parameter to the default value. 1438 1439 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1440 """ 1441 1442 # Set the current data pipe to 'mf'. 1443 pipes.switch('mf') 1444 1445 # Initialise a diffusion tensor. 1446 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 1447 1448 # Set the parameter. 1449 self.value_fns.set(param='beta') 1450 1451 # Test the parameter. 1452 self.assertEqual(cdp.diff_tensor.beta, 0.0)
1453 1454
1456 """Try to set the ellipsoidal diffusion tensor gamma parameter to the default value. 1457 1458 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1459 """ 1460 1461 # Set the current data pipe to 'mf'. 1462 pipes.switch('mf') 1463 1464 # Initialise a diffusion tensor. 1465 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 1466 1467 # Set the parameter. 1468 self.value_fns.set(param='gamma') 1469 1470 # Test the parameter. 1471 self.assertEqual(cdp.diff_tensor.gamma, 0.0)
1472 1473
1475 """Set the ellipsoidal diffusion tensor theta parameter to the default value. 1476 1477 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1478 """ 1479 1480 # Set the current data pipe to 'mf'. 1481 pipes.switch('mf') 1482 1483 # Initialise a diffusion tensor. 1484 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 1485 1486 # Set the parameter. 1487 self.assertRaises(RelaxError, self.value_fns.set, param='theta')
1488 1489
1491 """Set the ellipsoidal diffusion tensor phi parameter to the default value. 1492 1493 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1494 """ 1495 1496 # Set the current data pipe to 'mf'. 1497 pipes.switch('mf') 1498 1499 # Initialise a diffusion tensor. 1500 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 1501 1502 # Set the parameter. 1503 self.assertRaises(RelaxError, self.value_fns.set, param='phi')
1504 1505
1507 """Set the ellipsoidal diffusion tensor parameters {tm, Da, Dr} to the default values. 1508 1509 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1510 """ 1511 1512 # Set the current data pipe to 'mf'. 1513 pipes.switch('mf') 1514 1515 # Initialise a diffusion tensor. 1516 diffusion_tensor.init((1e-9, 2e6, 0.4, 0, 0, 0)) 1517 1518 # Set the parameters. 1519 self.value_fns.set(param=['tm', 'Da', 'Dr']) 1520 1521 # Test the parameters. 1522 self.assertEqual(cdp.diff_tensor.tm, 1e-8) 1523 self.assertEqual(cdp.diff_tensor.Da, 0.0) 1524 self.assertEqual(cdp.diff_tensor.Dr, 0.0)
1525 1526
1528 """Set the ellipsoidal diffusion tensor parameters {Diso, Da, Dr} to the default values. 1529 1530 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1531 """ 1532 1533 # Set the current data pipe to 'mf'. 1534 pipes.switch('mf') 1535 1536 # Initialise a diffusion tensor. 1537 diffusion_tensor.init((1e-9, 2e6, 0.4, 0, 0, 0)) 1538 1539 # Set the parameters. 1540 self.value_fns.set(param=['Diso', 'Da', 'Dr']) 1541 1542 # Test the parameters. 1543 self.assertAlmostEqual(cdp.diff_tensor.Diso, 1.666e7) 1544 self.assertEqual(cdp.diff_tensor.Da, 0.0) 1545 self.assertEqual(cdp.diff_tensor.Dr, 0.0)
1546 1547
1549 """Set the ellipsoidal diffusion tensor parameters {Dx, Dy, Dz} to the default values. 1550 1551 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1552 """ 1553 1554 # Set the current data pipe to 'mf'. 1555 pipes.switch('mf') 1556 1557 # Initialise a diffusion tensor. 1558 diffusion_tensor.init((1e-9, 2e6, 0.4, 0, 0, 0)) 1559 1560 # Set the parameters. 1561 self.value_fns.set(param=['Dx', 'Dy', 'Dz']) 1562 1563 # Test the parameters. 1564 self.assertAlmostEqual(cdp.diff_tensor.Dx, 1.666e7) 1565 self.assertAlmostEqual(cdp.diff_tensor.Dy, 1.666e7) 1566 self.assertAlmostEqual(cdp.diff_tensor.Dz, 1.666e7)
1567 1568
1570 """Try to set the ellipsoidal diffusion tensor parameters {tm, Diso, Dr} to the default values (this should not be possible). 1571 1572 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1573 """ 1574 1575 # Set the current data pipe to 'mf'. 1576 pipes.switch('mf') 1577 1578 # Initialise a diffusion tensor. 1579 diffusion_tensor.init((1e-9, 2e6, 0.4, 0, 0, 0)) 1580 1581 # Set the parameters. 1582 self.assertRaises(RelaxUnknownParamCombError, self.value_fns.set, param=['tm', 'Diso', 'Dr'])
1583 1584
1586 """Set the spherical diffusion tensor tm parameter. 1587 1588 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1589 """ 1590 1591 # Set the current data pipe to 'mf'. 1592 pipes.switch('mf') 1593 1594 # Initialise a diffusion tensor. 1595 diffusion_tensor.init(1e-9) 1596 1597 # Set the parameter. 1598 self.value_fns.set(param='tm', val=1e-8) 1599 1600 # Test the parameter. 1601 self.assertEqual(cdp.diff_tensor.tm, 1e-8)
1602 1603
1605 """Set the spherical diffusion tensor Diso parameter. 1606 1607 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1608 """ 1609 1610 # Set the current data pipe to 'mf'. 1611 pipes.switch('mf') 1612 1613 # Initialise a diffusion tensor. 1614 diffusion_tensor.init(1e-9) 1615 1616 # Set the parameter. 1617 self.value_fns.set(param='Diso', val=5e7) 1618 1619 # Test the parameter. 1620 self.assertEqual(cdp.diff_tensor.Diso, 5e7)
1621 1622
1624 """Try to set the spherical diffusion tensor Da parameter. 1625 1626 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1627 """ 1628 1629 # Set the current data pipe to 'mf'. 1630 pipes.switch('mf') 1631 1632 # Initialise a diffusion tensor. 1633 diffusion_tensor.init(1e-9) 1634 1635 # Set the parameter. 1636 self.assertRaises(RelaxError, self.value_fns.set, param='Da', val=2e6)
1637 1638
1640 """Try to set the spherical diffusion tensor Dr parameter. 1641 1642 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1643 """ 1644 1645 # Set the current data pipe to 'mf'. 1646 pipes.switch('mf') 1647 1648 # Initialise a diffusion tensor. 1649 diffusion_tensor.init(1e-9) 1650 1651 # Set the parameter. 1652 self.assertRaises(RelaxError, self.value_fns.set, param='Dr', val=2e6)
1653 1654
1656 """Try to set the spherical diffusion tensor Dx parameter. 1657 1658 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1659 """ 1660 1661 # Set the current data pipe to 'mf'. 1662 pipes.switch('mf') 1663 1664 # Initialise a diffusion tensor. 1665 diffusion_tensor.init(1e-9) 1666 1667 # Set the parameter. 1668 self.assertRaises(RelaxError, self.value_fns.set, param='Dx', val=2e6)
1669 1670
1672 """Try to set the spherical diffusion tensor Dy parameter. 1673 1674 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1675 """ 1676 1677 # Set the current data pipe to 'mf'. 1678 pipes.switch('mf') 1679 1680 # Initialise a diffusion tensor. 1681 diffusion_tensor.init(1e-9) 1682 1683 # Set the parameter. 1684 self.assertRaises(RelaxError, self.value_fns.set, param='Dy', val=2e6)
1685 1686
1688 """Try to set the spherical diffusion tensor Dz parameter. 1689 1690 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1691 """ 1692 1693 # Set the current data pipe to 'mf'. 1694 pipes.switch('mf') 1695 1696 # Initialise a diffusion tensor. 1697 diffusion_tensor.init(1e-9) 1698 1699 # Set the parameter. 1700 self.assertRaises(RelaxError, self.value_fns.set, param='Dz', val=2e6)
1701 1702
1704 """Try to set the spherical diffusion tensor Dpar parameter. 1705 1706 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1707 """ 1708 1709 # Set the current data pipe to 'mf'. 1710 pipes.switch('mf') 1711 1712 # Initialise a diffusion tensor. 1713 diffusion_tensor.init(1e-9) 1714 1715 # Set the parameter. 1716 self.assertRaises(RelaxError, self.value_fns.set, param='Dpar', val=2e6)
1717 1718
1720 """Try to set the spherical diffusion tensor Dper parameter. 1721 1722 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1723 """ 1724 1725 # Set the current data pipe to 'mf'. 1726 pipes.switch('mf') 1727 1728 # Initialise a diffusion tensor. 1729 diffusion_tensor.init(1e-9) 1730 1731 # Set the parameter. 1732 self.assertRaises(RelaxError, self.value_fns.set, param='Dper', val=2e6)
1733 1734
1736 """Try to set the spherical diffusion tensor Dratio parameter. 1737 1738 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1739 """ 1740 1741 # Set the current data pipe to 'mf'. 1742 pipes.switch('mf') 1743 1744 # Initialise a diffusion tensor. 1745 diffusion_tensor.init(1e-9) 1746 1747 # Set the parameter. 1748 self.assertRaises(RelaxError, self.value_fns.set, param='Dratio', val=1.2)
1749 1750
1752 """Try to set the spherical diffusion tensor alpha parameter. 1753 1754 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1755 """ 1756 1757 # Set the current data pipe to 'mf'. 1758 pipes.switch('mf') 1759 1760 # Initialise a diffusion tensor. 1761 diffusion_tensor.init(1e-9) 1762 1763 # Set the parameter. 1764 self.assertRaises(RelaxError, self.value_fns.set, param='alpha', val=pi/2)
1765 1766
1768 """Try to set the spherical diffusion tensor beta parameter. 1769 1770 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1771 """ 1772 1773 # Set the current data pipe to 'mf'. 1774 pipes.switch('mf') 1775 1776 # Initialise a diffusion tensor. 1777 diffusion_tensor.init(1e-9) 1778 1779 # Set the parameter. 1780 self.assertRaises(RelaxError, self.value_fns.set, param='beta', val=pi/2)
1781 1782
1784 """Try to set the spherical diffusion tensor gamma parameter. 1785 1786 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1787 """ 1788 1789 # Set the current data pipe to 'mf'. 1790 pipes.switch('mf') 1791 1792 # Initialise a diffusion tensor. 1793 diffusion_tensor.init(1e-9) 1794 1795 # Set the parameter. 1796 self.assertRaises(RelaxError, self.value_fns.set, param='gamma', val=pi/2)
1797 1798
1800 """Try to set the spherical diffusion tensor theta parameter. 1801 1802 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1803 """ 1804 1805 # Set the current data pipe to 'mf'. 1806 pipes.switch('mf') 1807 1808 # Initialise a diffusion tensor. 1809 diffusion_tensor.init(1e-9) 1810 1811 # Set the parameter. 1812 self.assertRaises(RelaxError, self.value_fns.set, param='theta', val=pi/2)
1813 1814
1816 """Try to set the spherical diffusion tensor phi parameter. 1817 1818 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1819 """ 1820 1821 # Set the current data pipe to 'mf'. 1822 pipes.switch('mf') 1823 1824 # Initialise a diffusion tensor. 1825 diffusion_tensor.init(1e-9) 1826 1827 # Set the parameter. 1828 self.assertRaises(RelaxError, self.value_fns.set, param='phi', val=pi/2)
1829 1830
1832 """Set the spheroidal diffusion tensor tm parameter. 1833 1834 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1835 """ 1836 1837 # Set the current data pipe to 'mf'. 1838 pipes.switch('mf') 1839 1840 # Initialise a diffusion tensor. 1841 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1842 1843 # Set the parameter. 1844 self.value_fns.set(param='tm', val=1e-8) 1845 1846 # Test the parameter. 1847 self.assertEqual(cdp.diff_tensor.tm, 1e-8)
1848 1849
1851 """Set the spheroidal diffusion tensor Diso parameter. 1852 1853 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1854 """ 1855 1856 # Set the current data pipe to 'mf'. 1857 pipes.switch('mf') 1858 1859 # Initialise a diffusion tensor. 1860 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1861 1862 # Set the parameter. 1863 self.value_fns.set(param='Diso', val=5e7) 1864 1865 # Test the parameter. 1866 self.assertEqual(cdp.diff_tensor.tm, 1./(6*5e7))
1867 1868
1870 """Set the spheroidal diffusion tensor Da parameter. 1871 1872 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1873 """ 1874 1875 # Set the current data pipe to 'mf'. 1876 pipes.switch('mf') 1877 1878 # Initialise a diffusion tensor. 1879 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1880 1881 # Set the parameter. 1882 self.value_fns.set(param='Da', val=1e6) 1883 1884 # Test the parameter. 1885 self.assertEqual(cdp.diff_tensor.Da, 1e6)
1886 1887
1889 """Set the spheroidal diffusion tensor Dr parameter. 1890 1891 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1892 """ 1893 1894 # Set the current data pipe to 'mf'. 1895 pipes.switch('mf') 1896 1897 # Initialise a diffusion tensor. 1898 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1899 1900 # Set the parameter. 1901 self.assertRaises(RelaxError, self.value_fns.set, param='Dr', val=0.2)
1902 1903
1905 """Set the spheroidal diffusion tensor Dx parameter. 1906 1907 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1908 """ 1909 1910 # Set the current data pipe to 'mf'. 1911 pipes.switch('mf') 1912 1913 # Initialise a diffusion tensor. 1914 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1915 1916 # Set the parameter. 1917 self.assertRaises(RelaxError, self.value_fns.set, param='Dx', val=1e6)
1918 1919
1921 """Set the spheroidal diffusion tensor Dy parameter. 1922 1923 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1924 """ 1925 1926 # Set the current data pipe to 'mf'. 1927 pipes.switch('mf') 1928 1929 # Initialise a diffusion tensor. 1930 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1931 1932 # Set the parameter. 1933 self.assertRaises(RelaxError, self.value_fns.set, param='Dy', val=1e6)
1934 1935
1937 """Set the spheroidal diffusion tensor Dz parameter. 1938 1939 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1940 """ 1941 1942 # Set the current data pipe to 'mf'. 1943 pipes.switch('mf') 1944 1945 # Initialise a diffusion tensor. 1946 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1947 1948 # Set the parameter. 1949 self.assertRaises(RelaxError, self.value_fns.set, param='Dz', val=1e6)
1950 1951
1953 """Try to set the spheroidal diffusion tensor Dpar parameter (this should not be possible). 1954 1955 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1956 """ 1957 1958 # Set the current data pipe to 'mf'. 1959 pipes.switch('mf') 1960 1961 # Initialise a diffusion tensor. 1962 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1963 1964 # Set the parameter. 1965 self.assertRaises(RelaxError, self.value_fns.set, param='Dpar', val=1e6)
1966 1967
1969 """Try to set the spheroidal diffusion tensor Dper parameter (this should not be possible). 1970 1971 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1972 """ 1973 1974 # Set the current data pipe to 'mf'. 1975 pipes.switch('mf') 1976 1977 # Initialise a diffusion tensor. 1978 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1979 1980 # Set the parameter. 1981 self.assertRaises(RelaxError, self.value_fns.set, param='Dper', val=1e6)
1982 1983
1985 """Set the spheroidal diffusion tensor Dratio parameter. 1986 1987 The functions tested are both generic_fns.value.set() and prompt.value.set(). 1988 """ 1989 1990 # Set the current data pipe to 'mf'. 1991 pipes.switch('mf') 1992 1993 # Initialise a diffusion tensor. 1994 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 1995 1996 # Set the parameter. 1997 self.value_fns.set(param='Dratio', val=1.2) 1998 1999 # Test the parameter. 2000 self.assertAlmostEqual(cdp.diff_tensor.Dratio, 1.2)
2001 2002
2004 """Try to set the spheroidal diffusion tensor alpha parameter. 2005 2006 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2007 """ 2008 2009 # Set the current data pipe to 'mf'. 2010 pipes.switch('mf') 2011 2012 # Initialise a diffusion tensor. 2013 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 2014 2015 # Set the parameter. 2016 self.assertRaises(RelaxError, self.value_fns.set, param='alpha', val=pi/2)
2017 2018
2020 """Try to set the spheroidal diffusion tensor beta parameter. 2021 2022 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2023 """ 2024 2025 # Set the current data pipe to 'mf'. 2026 pipes.switch('mf') 2027 2028 # Initialise a diffusion tensor. 2029 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 2030 2031 # Set the parameter. 2032 self.assertRaises(RelaxError, self.value_fns.set, param='beta', val=pi/2)
2033 2034
2036 """Try to set the spheroidal diffusion tensor gamma parameter. 2037 2038 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2039 """ 2040 2041 # Set the current data pipe to 'mf'. 2042 pipes.switch('mf') 2043 2044 # Initialise a diffusion tensor. 2045 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 2046 2047 # Set the parameter. 2048 self.assertRaises(RelaxError, self.value_fns.set, param='gamma', val=pi/2)
2049 2050
2052 """Set the spheroidal diffusion tensor theta parameter. 2053 2054 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2055 """ 2056 2057 # Set the current data pipe to 'mf'. 2058 pipes.switch('mf') 2059 2060 # Initialise a diffusion tensor. 2061 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 2062 2063 # Set the parameter. 2064 self.value_fns.set(param='theta', val=pi/2) 2065 2066 # Test the parameter. 2067 self.assertEqual(cdp.diff_tensor.theta, pi/2)
2068 2069
2071 """Set the spheroidal diffusion tensor phi parameter. 2072 2073 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2074 """ 2075 2076 # Set the current data pipe to 'mf'. 2077 pipes.switch('mf') 2078 2079 # Initialise a diffusion tensor. 2080 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 2081 2082 # Set the parameter. 2083 self.value_fns.set(param='phi', val=pi/2) 2084 2085 # Test the parameter. 2086 self.assertEqual(cdp.diff_tensor.phi, pi/2)
2087 2088
2090 """Set the spheroidal diffusion tensor parameters {tm, Da}. 2091 2092 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2093 """ 2094 2095 # Set the current data pipe to 'mf'. 2096 pipes.switch('mf') 2097 2098 # Initialise a diffusion tensor. 2099 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 2100 2101 # Set the parameters. 2102 self.value_fns.set(param=['tm', 'Da'], val=[1e-8, 1e6]) 2103 2104 # Test the parameter. 2105 self.assertEqual(cdp.diff_tensor.tm, 1e-8) 2106 self.assertEqual(cdp.diff_tensor.Da, 1e6)
2107 2108
2110 """Set the spheroidal diffusion tensor parameters {Diso, Da}. 2111 2112 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2113 """ 2114 2115 # Set the current data pipe to 'mf'. 2116 pipes.switch('mf') 2117 2118 # Initialise a diffusion tensor. 2119 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 2120 2121 # Set the parameters. 2122 self.value_fns.set(param=['Diso', 'Da'], val=[1e7, 1e6]) 2123 2124 # Test the parameter. 2125 self.assertEqual(cdp.diff_tensor.Diso, 1e7) 2126 self.assertEqual(cdp.diff_tensor.Da, 1e6)
2127 2128
2130 """Set the spheroidal diffusion tensor parameters {tm, Dratio}. 2131 2132 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2133 """ 2134 2135 # Set the current data pipe to 'mf'. 2136 pipes.switch('mf') 2137 2138 # Initialise a diffusion tensor. 2139 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 2140 2141 # Set the parameters. 2142 self.value_fns.set(param=['tm', 'Dratio'], val=[1e-8, 1.6]) 2143 2144 # Test the parameter. 2145 self.assertEqual(cdp.diff_tensor.tm, 1e-8) 2146 self.assertEqual(cdp.diff_tensor.Dratio, 1.6)
2147 2148
2150 """Set the spheroidal diffusion tensor parameters {Dpar, Dper}. 2151 2152 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2153 """ 2154 2155 # Set the current data pipe to 'mf'. 2156 pipes.switch('mf') 2157 2158 # Initialise a diffusion tensor. 2159 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 2160 2161 # Set the parameters. 2162 self.value_fns.set(param=['Dpar', 'Dper'], val=[1e7, 2e7]) 2163 2164 # Test the parameter. 2165 self.assertAlmostEqual(cdp.diff_tensor.Dpar, 1e7) 2166 self.assertAlmostEqual(cdp.diff_tensor.Dper, 2e7)
2167 2168
2170 """Set the spheroidal diffusion tensor parameters {Dper, Dpar}. 2171 2172 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2173 """ 2174 2175 # Set the current data pipe to 'mf'. 2176 pipes.switch('mf') 2177 2178 # Initialise a diffusion tensor. 2179 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 2180 2181 # Set the parameters. 2182 self.value_fns.set(param=['Dper', 'Dpar'], val=[1e7, 2e7]) 2183 2184 # Test the parameter. 2185 self.assertAlmostEqual(cdp.diff_tensor.Dper, 1e7) 2186 self.assertAlmostEqual(cdp.diff_tensor.Dpar, 2e7)
2187 2188
2190 """Set the spheroidal diffusion tensor parameters {Diso, Dratio}. 2191 2192 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2193 """ 2194 2195 # Set the current data pipe to 'mf'. 2196 pipes.switch('mf') 2197 2198 # Initialise a diffusion tensor. 2199 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 2200 2201 # Set the parameters. 2202 self.value_fns.set(param=['Diso', 'Dratio'], val=[1e7, 1.2]) 2203 2204 # Test the parameter. 2205 self.assertEqual(cdp.diff_tensor.Diso, 1e7) 2206 self.assertEqual(cdp.diff_tensor.Dratio, 1.2)
2207 2208
2210 """Set the spheroidal diffusion tensor parameters {Dpar, Dratio} (this should not be possible). 2211 2212 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2213 """ 2214 2215 # Set the current data pipe to 'mf'. 2216 pipes.switch('mf') 2217 2218 # Initialise a diffusion tensor. 2219 diffusion_tensor.init((1e-9, 2e6, 0, 0)) 2220 2221 # Set the parameters. 2222 self.assertRaises(RelaxUnknownParamCombError, self.value_fns.set, param=['Dpar', 'Dratio'], val=[1e7, 1.2])
2223 2224
2226 """Set the ellipsoidal diffusion tensor tm parameter. 2227 2228 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2229 """ 2230 2231 # Set the current data pipe to 'mf'. 2232 pipes.switch('mf') 2233 2234 # Initialise a diffusion tensor. 2235 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 2236 2237 # Set the parameter. 2238 self.value_fns.set(param='tm', val=1e-8) 2239 2240 # Test the parameter. 2241 self.assertEqual(cdp.diff_tensor.tm, 1e-8)
2242 2243
2245 """Set the ellipsoidal diffusion tensor Diso parameter. 2246 2247 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2248 """ 2249 2250 # Set the current data pipe to 'mf'. 2251 pipes.switch('mf') 2252 2253 # Initialise a diffusion tensor. 2254 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 2255 2256 # Set the parameter. 2257 self.value_fns.set(param='Diso', val=5e7) 2258 2259 # Test the parameter. 2260 self.assertEqual(cdp.diff_tensor.tm, 1./(6*5e7))
2261 2262
2264 """Set the ellipsoidal diffusion tensor Da parameter. 2265 2266 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2267 """ 2268 2269 # Set the current data pipe to 'mf'. 2270 pipes.switch('mf') 2271 2272 # Initialise a diffusion tensor. 2273 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 2274 2275 # Set the parameter. 2276 self.value_fns.set(param='Da', val=1e6) 2277 2278 # Test the parameter. 2279 self.assertEqual(cdp.diff_tensor.Da, 1e6)
2280 2281
2283 """Set the ellipsoidal diffusion tensor Dr parameter. 2284 2285 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2286 """ 2287 2288 # Set the current data pipe to 'mf'. 2289 pipes.switch('mf') 2290 2291 # Initialise a diffusion tensor. 2292 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 2293 2294 # Set the parameter. 2295 self.value_fns.set(param='Dr', val=0.3) 2296 2297 # Test the parameter. 2298 self.assertEqual(cdp.diff_tensor.Dr, 0.3)
2299 2300
2302 """Set the ellipsoidal diffusion tensor Dx parameter. 2303 2304 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2305 """ 2306 2307 # Set the current data pipe to 'mf'. 2308 pipes.switch('mf') 2309 2310 # Initialise a diffusion tensor. 2311 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 2312 2313 # Set the parameter. 2314 self.assertRaises(RelaxError, self.value_fns.set, param='Dx', val=1e6)
2315 2316
2318 """Set the ellipsoidal diffusion tensor Dy parameter. 2319 2320 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2321 """ 2322 2323 # Set the current data pipe to 'mf'. 2324 pipes.switch('mf') 2325 2326 # Initialise a diffusion tensor. 2327 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 2328 2329 # Set the parameter. 2330 self.assertRaises(RelaxError, self.value_fns.set, param='Dy', val=1e6)
2331 2332
2334 """Set the ellipsoidal diffusion tensor Dz parameter. 2335 2336 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2337 """ 2338 2339 # Set the current data pipe to 'mf'. 2340 pipes.switch('mf') 2341 2342 # Initialise a diffusion tensor. 2343 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 2344 2345 # Set the parameter. 2346 self.assertRaises(RelaxError, self.value_fns.set, param='Dz', val=1e6)
2347 2348
2350 """Try to set the ellipsoidal diffusion tensor Dpar parameter (this should not be possible). 2351 2352 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2353 """ 2354 2355 # Set the current data pipe to 'mf'. 2356 pipes.switch('mf') 2357 2358 # Initialise a diffusion tensor. 2359 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 2360 2361 # Set the parameter. 2362 self.assertRaises(RelaxError, self.value_fns.set, param='Dpar', val=1e6)
2363 2364
2366 """Try to set the ellipsoidal diffusion tensor Dper parameter (this should not be possible). 2367 2368 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2369 """ 2370 2371 # Set the current data pipe to 'mf'. 2372 pipes.switch('mf') 2373 2374 # Initialise a diffusion tensor. 2375 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 2376 2377 # Set the parameter. 2378 self.assertRaises(RelaxError, self.value_fns.set, param='Dper', val=1e6)
2379 2380
2382 """Set the ellipsoidal diffusion tensor Dratio parameter. 2383 2384 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2385 """ 2386 2387 # Set the current data pipe to 'mf'. 2388 pipes.switch('mf') 2389 2390 # Initialise a diffusion tensor. 2391 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 2392 2393 # Set the parameter. 2394 self.assertRaises(RelaxError, self.value_fns.set, param='Dratio', val=1.2)
2395 2396
2398 """Try to set the ellipsoidal diffusion tensor alpha parameter. 2399 2400 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2401 """ 2402 2403 # Set the current data pipe to 'mf'. 2404 pipes.switch('mf') 2405 2406 # Initialise a diffusion tensor. 2407 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 2408 2409 # Set the parameter. 2410 self.value_fns.set(param='alpha', val=pi/2) 2411 2412 # Test the parameter. 2413 self.assertEqual(cdp.diff_tensor.alpha, pi/2)
2414 2415
2417 """Try to set the ellipsoidal diffusion tensor beta parameter. 2418 2419 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2420 """ 2421 2422 # Set the current data pipe to 'mf'. 2423 pipes.switch('mf') 2424 2425 # Initialise a diffusion tensor. 2426 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 2427 2428 # Set the parameter. 2429 self.value_fns.set(param='beta', val=pi/2) 2430 2431 # Test the parameter. 2432 self.assertEqual(cdp.diff_tensor.beta, pi/2)
2433 2434
2436 """Try to set the ellipsoidal diffusion tensor gamma parameter. 2437 2438 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2439 """ 2440 2441 # Set the current data pipe to 'mf'. 2442 pipes.switch('mf') 2443 2444 # Initialise a diffusion tensor. 2445 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 2446 2447 # Set the parameter. 2448 self.value_fns.set(param='gamma', val=pi/2) 2449 2450 # Test the parameter. 2451 self.assertEqual(cdp.diff_tensor.gamma, pi/2)
2452 2453
2455 """Set the ellipsoidal diffusion tensor theta parameter. 2456 2457 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2458 """ 2459 2460 # Set the current data pipe to 'mf'. 2461 pipes.switch('mf') 2462 2463 # Initialise a diffusion tensor. 2464 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 2465 2466 # Set the parameter. 2467 self.assertRaises(RelaxError, self.value_fns.set, param='theta', val=pi/2)
2468 2469
2471 """Set the ellipsoidal diffusion tensor phi parameter. 2472 2473 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2474 """ 2475 2476 # Set the current data pipe to 'mf'. 2477 pipes.switch('mf') 2478 2479 # Initialise a diffusion tensor. 2480 diffusion_tensor.init((1e-9, 2e6, 0.2, 0, 0, 0)) 2481 2482 # Set the parameter. 2483 self.assertRaises(RelaxError, self.value_fns.set, param='phi', val=pi/2)
2484 2485
2487 """Set the ellipsoidal diffusion tensor parameters {tm, Da, Dr}. 2488 2489 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2490 """ 2491 2492 # Set the current data pipe to 'mf'. 2493 pipes.switch('mf') 2494 2495 # Initialise a diffusion tensor. 2496 diffusion_tensor.init((1e-9, 2e6, 0.4, 0, 0, 0)) 2497 2498 # Set the parameters. 2499 self.value_fns.set(param=['tm', 'Da', 'Dr'], val=[1e-8, 1e6, 0.2]) 2500 2501 # Test the parameters. 2502 self.assertEqual(cdp.diff_tensor.tm, 1e-8) 2503 self.assertEqual(cdp.diff_tensor.Da, 1e6) 2504 self.assertEqual(cdp.diff_tensor.Dr, 0.2)
2505 2506
2508 """Set the ellipsoidal diffusion tensor parameters {Diso, Da, Dr}. 2509 2510 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2511 """ 2512 2513 # Set the current data pipe to 'mf'. 2514 pipes.switch('mf') 2515 2516 # Initialise a diffusion tensor. 2517 diffusion_tensor.init((1e-9, 2e6, 0.4, 0, 0, 0)) 2518 2519 # Set the parameters. 2520 self.value_fns.set(param=['Diso', 'Da', 'Dr'], val=[1e7, 1e6, 0.2]) 2521 2522 # Test the parameters. 2523 self.assertEqual(cdp.diff_tensor.Diso, 1e7) 2524 self.assertEqual(cdp.diff_tensor.Da, 1e6) 2525 self.assertEqual(cdp.diff_tensor.Dr, 0.2)
2526 2527
2529 """Set the ellipsoidal diffusion tensor parameters {Dx, Dy, Dz}. 2530 2531 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2532 """ 2533 2534 # Set the current data pipe to 'mf'. 2535 pipes.switch('mf') 2536 2537 # Initialise a diffusion tensor. 2538 diffusion_tensor.init((1e-9, 2e6, 0.4, 0, 0, 0)) 2539 2540 # Set the parameters. 2541 self.value_fns.set(param=['Dx', 'Dy', 'Dz'], val=[1e7, 2e7, 3e7]) 2542 2543 # Test the parameters. 2544 self.assertEqual(cdp.diff_tensor.Dx, 1e7) 2545 self.assertEqual(cdp.diff_tensor.Dy, 2e7) 2546 self.assertEqual(cdp.diff_tensor.Dz, 3e7)
2547 2548
2550 """Set the ellipsoidal diffusion tensor parameters {Dx, Dy, Dz} all to the same value. 2551 2552 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2553 """ 2554 2555 # Set the current data pipe to 'mf'. 2556 pipes.switch('mf') 2557 2558 # Initialise a diffusion tensor. 2559 diffusion_tensor.init((1e-9, 2e6, 0.4, 0, 0, 0)) 2560 2561 # Set the parameters. 2562 self.value_fns.set(param=['Dx', 'Dy', 'Dz'], val=1e7) 2563 2564 # Test the parameters. 2565 self.assertEqual(cdp.diff_tensor.Dx, 1e7) 2566 self.assertEqual(cdp.diff_tensor.Dy, 1e7) 2567 self.assertEqual(cdp.diff_tensor.Dz, 1e7)
2568 2569
2571 """Try to set the ellipsoidal diffusion tensor parameters {tm, Diso, Dr} (this should not be possible). 2572 2573 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2574 """ 2575 2576 # Set the current data pipe to 'mf'. 2577 pipes.switch('mf') 2578 2579 # Initialise a diffusion tensor. 2580 diffusion_tensor.init((1e-9, 2e6, 0.4, 0, 0, 0)) 2581 2582 # Set the parameters. 2583 self.assertRaises(RelaxUnknownParamCombError, self.value_fns.set, param=['tm', 'Diso', 'Dr'], val=[1e-8, 1e6, 0.2])
2584 2585 2586 2587 2588 ############################################### 2589 # Reduced spectral density mapping parameters # 2590 ############################################### 2591 2592
2593 - def test_set_jw_all_spins_j0(self):
2594 """Set the RSDM parameter J(0) for all spins. 2595 2596 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2597 """ 2598 2599 # Set the current data pipe to 'jw'. 2600 pipes.switch('jw') 2601 2602 # Set the parameter. 2603 self.value_fns.set(param='j0', val=4.5e-9) 2604 2605 # Test the parameter. 2606 self.assertEqual(cdp.mol[0].res[0].spin[0].j0, 4.5e-9) 2607 self.assertEqual(cdp.mol[0].res[1].spin[0].j0, 4.5e-9)
2608 2609
2610 - def test_set_jw_all_spins_jwx(self):
2611 """Set the RSDM parameter J(wX) for all spins. 2612 2613 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2614 """ 2615 2616 # Set the current data pipe to 'jw'. 2617 pipes.switch('jw') 2618 2619 # Set the parameter. 2620 self.value_fns.set(param='jwx', val=2.3e-10) 2621 2622 # Test the parameter. 2623 self.assertEqual(cdp.mol[0].res[0].spin[0].jwx, 2.3e-10) 2624 self.assertEqual(cdp.mol[0].res[1].spin[0].jwx, 2.3e-10)
2625 2626
2627 - def test_set_jw_all_spins_jwh(self):
2628 """Set the RSDM parameter J(wH) for all spins. 2629 2630 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2631 """ 2632 2633 # Set the current data pipe to 'jw'. 2634 pipes.switch('jw') 2635 2636 # Set the parameter. 2637 self.value_fns.set(param='jwh', val=1.7e-12) 2638 2639 # Test the parameter. 2640 self.assertEqual(cdp.mol[0].res[0].spin[0].jwh, 1.7e-12) 2641 self.assertEqual(cdp.mol[0].res[1].spin[0].jwh, 1.7e-12)
2642 2643
2644 - def test_set_jw_all_spins_r(self):
2645 """Set the RSDM bond length parameter for all spins. 2646 2647 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2648 """ 2649 2650 # Set the current data pipe to 'jw'. 2651 pipes.switch('jw') 2652 2653 # Set the parameter. 2654 self.value_fns.set(param='r', val=1.04e-10) 2655 2656 # Test the parameter. 2657 self.assertEqual(cdp.mol[0].res[0].spin[0].r, 1.04e-10) 2658 self.assertEqual(cdp.mol[0].res[1].spin[0].r, 1.04e-10)
2659 2660
2661 - def test_set_jw_all_spins_csa(self):
2662 """Set the RSDM CSA parameter for all spins. 2663 2664 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2665 """ 2666 2667 # Set the current data pipe to 'jw'. 2668 pipes.switch('jw') 2669 2670 # Set the parameter. 2671 self.value_fns.set(param='csa', val=-160e-6) 2672 2673 # Test the parameter. 2674 self.assertEqual(cdp.mol[0].res[0].spin[0].csa, -160e-6) 2675 self.assertEqual(cdp.mol[0].res[1].spin[0].csa, -160e-6)
2676 2677
2679 """Set the RSDM heteronucleus type for all spins. 2680 2681 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2682 """ 2683 2684 # Set the current data pipe to 'jw'. 2685 pipes.switch('jw') 2686 2687 # Set the parameter. 2688 self.value_fns.set(param='heteronuc_type', val='13C') 2689 2690 # Test the parameter. 2691 self.assertEqual(cdp.mol[0].res[0].spin[0].heteronuc_type, '13C') 2692 self.assertEqual(cdp.mol[0].res[1].spin[0].heteronuc_type, '13C')
2693 2694
2696 """Set different RSDM parameters J(0), J(wX), J(wH) for all spins. 2697 2698 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2699 """ 2700 2701 # Set the current data pipe to 'jw'. 2702 pipes.switch('jw') 2703 2704 # Set the parameter. 2705 self.value_fns.set(param=['j0', 'jwx', 'jwh'], val=[6.4e-9, 3.5e-10, 2.3e-12]) 2706 2707 # Test the parameter. 2708 self.assertEqual(cdp.mol[0].res[0].spin[0].j0, 6.4e-9) 2709 self.assertEqual(cdp.mol[0].res[0].spin[0].jwx, 3.5e-10) 2710 self.assertEqual(cdp.mol[0].res[0].spin[0].jwh, 2.3e-12) 2711 self.assertEqual(cdp.mol[0].res[1].spin[0].j0, 6.4e-9) 2712 self.assertEqual(cdp.mol[0].res[1].spin[0].jwx, 3.5e-10) 2713 self.assertEqual(cdp.mol[0].res[1].spin[0].jwh, 2.3e-12)
2714 2715
2717 """Set RSDM parameters J(0), J(wX), J(wH) for all spins to the same value. 2718 2719 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2720 """ 2721 2722 # Set the current data pipe to 'jw'. 2723 pipes.switch('jw') 2724 2725 # Set the parameter. 2726 self.value_fns.set(param=['j0', 'jwx', 'jwh'], val=1.9e-10) 2727 2728 # Test the parameter. 2729 self.assertEqual(cdp.mol[0].res[0].spin[0].j0, 1.9e-10) 2730 self.assertEqual(cdp.mol[0].res[0].spin[0].jwx, 1.9e-10) 2731 self.assertEqual(cdp.mol[0].res[0].spin[0].jwh, 1.9e-10) 2732 self.assertEqual(cdp.mol[0].res[1].spin[0].j0, 1.9e-10) 2733 self.assertEqual(cdp.mol[0].res[1].spin[0].jwx, 1.9e-10) 2734 self.assertEqual(cdp.mol[0].res[1].spin[0].jwh, 1.9e-10)
2735 2736
2737 - def test_set_jw_defaults_j0(self):
2738 """Set the RSDM parameter J(0) to the default value (there is none!). 2739 2740 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2741 """ 2742 2743 # Set the current data pipe to 'jw'. 2744 pipes.switch('jw') 2745 2746 # Set the parameter. 2747 self.assertRaises(RelaxParamSetError, self.value_fns.set, param='j0')
2748 2749
2750 - def test_set_jw_defaults_jwx(self):
2751 """Set the RSDM parameter J(wX) to the default value (there is none!). 2752 2753 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2754 """ 2755 2756 # Set the current data pipe to 'jw'. 2757 pipes.switch('jw') 2758 2759 # Set the parameter. 2760 self.assertRaises(RelaxParamSetError, self.value_fns.set, param='jwx')
2761 2762
2763 - def test_set_jw_defaults_jwh(self):
2764 """Set the RSDM parameter J(wH) to the default value (there is none!). 2765 2766 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2767 """ 2768 2769 # Set the current data pipe to 'jw'. 2770 pipes.switch('jw') 2771 2772 # Set the parameter. 2773 self.assertRaises(RelaxParamSetError, self.value_fns.set, param='jwh')
2774 2775
2776 - def test_set_jw_defaults_r(self):
2777 """Set the RSDM bond length parameter to the default value. 2778 2779 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2780 """ 2781 2782 # Set the current data pipe to 'jw'. 2783 pipes.switch('jw') 2784 2785 # Set the parameter. 2786 self.value_fns.set(param='r') 2787 2788 # Test the parameter. 2789 self.assertAlmostEqual(cdp.mol[0].res[0].spin[0].r, 1.02e-10) 2790 self.assertAlmostEqual(cdp.mol[0].res[1].spin[0].r, 1.02e-10)
2791 2792
2793 - def test_set_jw_defaults_csa(self):
2794 """Set the RSDM CSA parameter to the default value. 2795 2796 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2797 """ 2798 2799 # Set the current data pipe to 'jw'. 2800 pipes.switch('jw') 2801 2802 # Set the parameter. 2803 self.value_fns.set(param='csa') 2804 2805 # Test the parameter. 2806 self.assertAlmostEqual(cdp.mol[0].res[0].spin[0].csa, -172e-6) 2807 self.assertAlmostEqual(cdp.mol[0].res[1].spin[0].csa, -172e-6)
2808 2809
2811 """Set the RSDM heteronucleus type to the default value. 2812 2813 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2814 """ 2815 2816 # Set the current data pipe to 'jw'. 2817 pipes.switch('jw') 2818 2819 # Set the parameter. 2820 self.value_fns.set(param='heteronuc_type') 2821 2822 # Test the parameter. 2823 self.assertEqual(cdp.mol[0].res[0].spin[0].heteronuc_type, '15N') 2824 self.assertEqual(cdp.mol[0].res[1].spin[0].heteronuc_type, '15N')
2825 2826
2828 """Set different RSDM parameters J(0), J(wX), J(wH) to the default values (there are none!). 2829 2830 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2831 """ 2832 2833 # Set the current data pipe to 'jw'. 2834 pipes.switch('jw') 2835 2836 # Set the parameter. 2837 self.assertRaises(RelaxParamSetError, self.value_fns.set, param=['j0', 'jwx', 'jwh'])
2838 2839
2840 - def test_set_jw_single_spin_j0(self):
2841 """Set the RSDM parameter J(0) for a single spin. 2842 2843 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2844 """ 2845 2846 # Set the current data pipe to 'jw'. 2847 pipes.switch('jw') 2848 2849 # Set the parameter. 2850 self.value_fns.set(param='j0', val=4.5e-9, spin_id='@112') 2851 2852 # Test the parameter. 2853 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'j0')) 2854 self.assertEqual(cdp.mol[0].res[1].spin[0].j0, 4.5e-9)
2855 2856
2858 """Set the RSDM parameter J(wX) for a single spin. 2859 2860 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2861 """ 2862 2863 # Set the current data pipe to 'jw'. 2864 pipes.switch('jw') 2865 2866 # Set the parameter. 2867 self.value_fns.set(param='jwx', val=2.3e-10, spin_id='@112') 2868 2869 # Test the parameter. 2870 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'jwx')) 2871 self.assertEqual(cdp.mol[0].res[1].spin[0].jwx, 2.3e-10)
2872 2873
2875 """Set the RSDM parameter J(wH) for a single spin. 2876 2877 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2878 """ 2879 2880 # Set the current data pipe to 'jw'. 2881 pipes.switch('jw') 2882 2883 # Set the parameter. 2884 self.value_fns.set(param='jwh', val=1.7e-12, spin_id='@112') 2885 2886 # Test the parameter. 2887 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'jwh')) 2888 self.assertEqual(cdp.mol[0].res[1].spin[0].jwh, 1.7e-12)
2889 2890
2891 - def test_set_jw_single_spin_r(self):
2892 """Set the RSDM bond length parameter for a single spin. 2893 2894 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2895 """ 2896 2897 # Set the current data pipe to 'jw'. 2898 pipes.switch('jw') 2899 2900 # Set the parameter. 2901 self.value_fns.set(param='r', val=1.04e-10, spin_id='@112') 2902 2903 # Test the parameter. 2904 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'r')) 2905 self.assertEqual(cdp.mol[0].res[1].spin[0].r, 1.04e-10)
2906 2907
2909 """Set the RSDM CSA parameter for a single spin. 2910 2911 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2912 """ 2913 2914 # Set the current data pipe to 'jw'. 2915 pipes.switch('jw') 2916 2917 # Set the parameter. 2918 self.value_fns.set(param='csa', val=-160e-6, spin_id='@112') 2919 2920 # Test the parameter. 2921 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'csa')) 2922 self.assertEqual(cdp.mol[0].res[1].spin[0].csa, -160e-6)
2923 2924
2926 """Set the RSDM heteronucleus type for a single spin. 2927 2928 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2929 """ 2930 2931 # Set the current data pipe to 'jw'. 2932 pipes.switch('jw') 2933 2934 # Set the parameter. 2935 self.value_fns.set(param='heteronuc_type', val='13C', spin_id='@112') 2936 2937 # Test the parameter. 2938 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'heteronuc_type')) 2939 self.assertEqual(cdp.mol[0].res[1].spin[0].heteronuc_type, '13C')
2940 2941
2943 """Set different RSDM parameters J(0), J(wX), J(wH) for a single spin. 2944 2945 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2946 """ 2947 2948 # Set the current data pipe to 'jw'. 2949 pipes.switch('jw') 2950 2951 # Set the parameter. 2952 self.value_fns.set(param=['j0', 'jwx', 'jwh'], val=[6.4e-9, 3.5e-10, 2.3e-12], spin_id='@112') 2953 2954 # Test the parameter. 2955 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'j0')) 2956 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'jwx')) 2957 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'jwh')) 2958 self.assertEqual(cdp.mol[0].res[1].spin[0].j0, 6.4e-9) 2959 self.assertEqual(cdp.mol[0].res[1].spin[0].jwx, 3.5e-10) 2960 self.assertEqual(cdp.mol[0].res[1].spin[0].jwh, 2.3e-12)
2961 2962
2964 """Set RSDM parameters J(0), J(wX), J(wH) for a single spin to the same value. 2965 2966 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2967 """ 2968 2969 # Set the current data pipe to 'jw'. 2970 pipes.switch('jw') 2971 2972 # Set the parameter. 2973 self.value_fns.set(param=['j0', 'jwx', 'jwh'], val=1.9e-10, spin_id='@112') 2974 2975 # Test the parameter. 2976 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'j0')) 2977 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'jwx')) 2978 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'jwh')) 2979 self.assertEqual(cdp.mol[0].res[1].spin[0].j0, 1.9e-10) 2980 self.assertEqual(cdp.mol[0].res[1].spin[0].jwx, 1.9e-10) 2981 self.assertEqual(cdp.mol[0].res[1].spin[0].jwh, 1.9e-10)
2982 2983 2984 2985 ######################### 2986 # Model-free parameters # 2987 ######################### 2988 2989
2991 """Set the model-free local tm parameter for all spins. 2992 2993 The functions tested are both generic_fns.value.set() and prompt.value.set(). 2994 """ 2995 2996 # Set the current data pipe to 'mf'. 2997 pipes.switch('mf') 2998 2999 # Set the parameter. 3000 self.value_fns.set(param='local_tm', val=1e-8) 3001 3002 # Test the parameter. 3003 self.assertEqual(cdp.mol[0].res[0].spin[0].local_tm, 1e-8) 3004 self.assertEqual(cdp.mol[0].res[1].spin[0].local_tm, 1e-8)
3005 3006
3007 - def test_set_mf_all_spins_s2(self):
3008 """Set the model-free S2 parameter for all spins. 3009 3010 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3011 """ 3012 3013 # Set the current data pipe to 'mf'. 3014 pipes.switch('mf') 3015 3016 # Set the parameter. 3017 self.value_fns.set(param='s2', val=0.8) 3018 3019 # Test the parameter. 3020 self.assertEqual(cdp.mol[0].res[0].spin[0].s2, 0.8) 3021 self.assertEqual(cdp.mol[0].res[1].spin[0].s2, 0.8)
3022 3023
3024 - def test_set_mf_all_spins_s2f(self):
3025 """Set the model-free S2f parameter for all spins. 3026 3027 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3028 """ 3029 3030 # Set the current data pipe to 'mf'. 3031 pipes.switch('mf') 3032 3033 # Set the parameter. 3034 self.value_fns.set(param='s2f', val=0.45) 3035 3036 # Test the parameter. 3037 self.assertEqual(cdp.mol[0].res[0].spin[0].s2f, 0.45) 3038 self.assertEqual(cdp.mol[0].res[1].spin[0].s2f, 0.45)
3039 3040
3041 - def test_set_mf_all_spins_s2s(self):
3042 """Set the model-free S2s parameter for all spins. 3043 3044 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3045 """ 3046 3047 # Set the current data pipe to 'mf'. 3048 pipes.switch('mf') 3049 3050 # Set the parameter. 3051 self.value_fns.set(param='s2s', val=0.1) 3052 3053 # Test the parameter. 3054 self.assertEqual(cdp.mol[0].res[0].spin[0].s2s, 0.1) 3055 self.assertEqual(cdp.mol[0].res[1].spin[0].s2s, 0.1)
3056 3057
3058 - def test_set_mf_all_spins_te(self):
3059 """Set the model-free te parameter for all spins. 3060 3061 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3062 """ 3063 3064 # Set the current data pipe to 'mf'. 3065 pipes.switch('mf') 3066 3067 # Set the parameter. 3068 self.value_fns.set(param='te', val=12.5e-12) 3069 3070 # Test the parameter. 3071 self.assertEqual(cdp.mol[0].res[0].spin[0].te, 12.5e-12) 3072 self.assertEqual(cdp.mol[0].res[1].spin[0].te, 12.5e-12)
3073 3074
3075 - def test_set_mf_all_spins_tf(self):
3076 """Set the model-free tf parameter for all spins. 3077 3078 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3079 """ 3080 3081 # Set the current data pipe to 'mf'. 3082 pipes.switch('mf') 3083 3084 # Set the parameter. 3085 self.value_fns.set(param='tf', val=20.1e-12) 3086 3087 # Test the parameter. 3088 self.assertEqual(cdp.mol[0].res[0].spin[0].tf, 20.1e-12) 3089 self.assertEqual(cdp.mol[0].res[1].spin[0].tf, 20.1e-12)
3090 3091
3092 - def test_set_mf_all_spins_ts(self):
3093 """Set the model-free ts parameter for all spins. 3094 3095 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3096 """ 3097 3098 # Set the current data pipe to 'mf'. 3099 pipes.switch('mf') 3100 3101 # Set the parameter. 3102 self.value_fns.set(param='ts', val=1.23e-9) 3103 3104 # Test the parameter. 3105 self.assertEqual(cdp.mol[0].res[0].spin[0].ts, 1.23e-9) 3106 self.assertEqual(cdp.mol[0].res[1].spin[0].ts, 1.23e-9)
3107 3108
3109 - def test_set_mf_all_spins_rex(self):
3110 """Set the model-free Rex parameter for all spins. 3111 3112 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3113 """ 3114 3115 # Set the current data pipe to 'mf'. 3116 pipes.switch('mf') 3117 3118 # Set the parameter. 3119 self.value_fns.set(param='rex', val=2.34) 3120 3121 # Test the parameter. 3122 self.assertEqual(cdp.mol[0].res[0].spin[0].rex, 2.34) 3123 self.assertEqual(cdp.mol[0].res[1].spin[0].rex, 2.34)
3124 3125
3126 - def test_set_mf_all_spins_r(self):
3127 """Set the model-free bond length parameter for all spins. 3128 3129 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3130 """ 3131 3132 # Set the current data pipe to 'mf'. 3133 pipes.switch('mf') 3134 3135 # Set the parameter. 3136 self.value_fns.set(param='r', val=1.02e-10) 3137 3138 # Test the parameter. 3139 self.assertEqual(cdp.mol[0].res[0].spin[0].r, 1.02e-10) 3140 self.assertEqual(cdp.mol[0].res[1].spin[0].r, 1.02e-10)
3141 3142
3143 - def test_set_mf_all_spins_csa(self):
3144 """Set the model-free CSA parameter for all spins. 3145 3146 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3147 """ 3148 3149 # Set the current data pipe to 'mf'. 3150 pipes.switch('mf') 3151 3152 # Set the parameter. 3153 self.value_fns.set(param='csa', val=-172e-6) 3154 3155 # Test the parameter. 3156 self.assertEqual(cdp.mol[0].res[0].spin[0].csa, -172e-6) 3157 self.assertEqual(cdp.mol[0].res[1].spin[0].csa, -172e-6)
3158 3159
3161 """Set the model-free heteronucleus type for all spins. 3162 3163 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3164 """ 3165 3166 # Set the current data pipe to 'mf'. 3167 pipes.switch('mf') 3168 3169 # Set the parameter. 3170 self.value_fns.set(param='heteronuc_type', val='13C') 3171 3172 # Test the parameter. 3173 self.assertEqual(cdp.mol[0].res[0].spin[0].heteronuc_type, '13C') 3174 self.assertEqual(cdp.mol[0].res[1].spin[0].heteronuc_type, '13C')
3175 3176
3178 """Set the model-free S2f and S2s parameters for all spins to different values. 3179 3180 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3181 """ 3182 3183 # Set the current data pipe to 'mf'. 3184 pipes.switch('mf') 3185 3186 # Set the parameter. 3187 self.value_fns.set(param=['s2f', 's2s'], val=[0.7, 0.9]) 3188 3189 # Test the parameters. 3190 self.assertEqual(cdp.mol[0].res[0].spin[0].s2f, 0.7) 3191 self.assertEqual(cdp.mol[0].res[0].spin[0].s2s, 0.9) 3192 self.assertEqual(cdp.mol[0].res[1].spin[0].s2f, 0.7) 3193 self.assertEqual(cdp.mol[0].res[1].spin[0].s2s, 0.9)
3194 3195
3197 """Set the model-free S2f and S2s parameters for all spins to the same value. 3198 3199 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3200 """ 3201 3202 # Set the current data pipe to 'mf'. 3203 pipes.switch('mf') 3204 3205 # Set the parameter. 3206 self.value_fns.set(param=['s2f', 's2s'], val=0.7) 3207 3208 # Test the parameters. 3209 self.assertEqual(cdp.mol[0].res[0].spin[0].s2f, 0.7) 3210 self.assertEqual(cdp.mol[0].res[0].spin[0].s2s, 0.7) 3211 self.assertEqual(cdp.mol[0].res[1].spin[0].s2f, 0.7) 3212 self.assertEqual(cdp.mol[0].res[1].spin[0].s2s, 0.7)
3213 3214
3216 """Set the model-free local tm parameter to the default value. 3217 3218 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3219 """ 3220 3221 # Set the current data pipe to 'mf'. 3222 pipes.switch('mf') 3223 3224 # Set the parameter. 3225 self.value_fns.set(param='local_tm') 3226 3227 # Test the parameter. 3228 self.assertEqual(cdp.mol[0].res[0].spin[0].local_tm, 10 * 1e-9) 3229 self.assertEqual(cdp.mol[0].res[1].spin[0].local_tm, 10 * 1e-9)
3230 3231
3232 - def test_set_mf_defaults_s2(self):
3233 """Set the model-free S2 parameter to the default value. 3234 3235 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3236 """ 3237 3238 # Set the current data pipe to 'mf'. 3239 pipes.switch('mf') 3240 3241 # Set the parameter. 3242 self.value_fns.set(param='s2') 3243 3244 # Test the parameter. 3245 self.assertEqual(cdp.mol[0].res[0].spin[0].s2, 0.8) 3246 self.assertEqual(cdp.mol[0].res[1].spin[0].s2, 0.8)
3247 3248
3249 - def test_set_mf_defaults_s2f(self):
3250 """Set the model-free S2f parameter to the default value. 3251 3252 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3253 """ 3254 3255 # Set the current data pipe to 'mf'. 3256 pipes.switch('mf') 3257 3258 # Set the parameter. 3259 self.value_fns.set(param='s2f') 3260 3261 # Test the parameter. 3262 self.assertEqual(cdp.mol[0].res[0].spin[0].s2f, 0.8) 3263 self.assertEqual(cdp.mol[0].res[1].spin[0].s2f, 0.8)
3264 3265
3266 - def test_set_mf_defaults_s2s(self):
3267 """Set the model-free S2s parameter to the default value. 3268 3269 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3270 """ 3271 3272 # Set the current data pipe to 'mf'. 3273 pipes.switch('mf') 3274 3275 # Set the parameter. 3276 self.value_fns.set(param='s2s') 3277 3278 # Test the parameter. 3279 self.assertEqual(cdp.mol[0].res[0].spin[0].s2s, 0.8) 3280 self.assertEqual(cdp.mol[0].res[1].spin[0].s2s, 0.8)
3281 3282
3283 - def test_set_mf_defaults_te(self):
3284 """Set the model-free te parameter to the default value. 3285 3286 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3287 """ 3288 3289 # Set the current data pipe to 'mf'. 3290 pipes.switch('mf') 3291 3292 # Set the parameter. 3293 self.value_fns.set(param='te') 3294 3295 # Test the parameter. 3296 self.assertEqual(cdp.mol[0].res[0].spin[0].te, 100 * 1e-12) 3297 self.assertEqual(cdp.mol[0].res[1].spin[0].te, 100 * 1e-12)
3298 3299
3300 - def test_set_mf_defaults_tf(self):
3301 """Set the model-free tf parameter to the default value. 3302 3303 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3304 """ 3305 3306 # Set the current data pipe to 'mf'. 3307 pipes.switch('mf') 3308 3309 # Set the parameter. 3310 self.value_fns.set(param='tf') 3311 3312 # Test the parameter. 3313 self.assertEqual(cdp.mol[0].res[0].spin[0].tf, 10 * 1e-12) 3314 self.assertEqual(cdp.mol[0].res[1].spin[0].tf, 10 * 1e-12)
3315 3316
3317 - def test_set_mf_defaults_ts(self):
3318 """Set the model-free ts parameter to the default value. 3319 3320 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3321 """ 3322 3323 # Set the current data pipe to 'mf'. 3324 pipes.switch('mf') 3325 3326 # Set the parameter. 3327 self.value_fns.set(param='ts') 3328 3329 # Test the parameter. 3330 self.assertEqual(cdp.mol[0].res[0].spin[0].ts, 1000 * 1e-12) 3331 self.assertEqual(cdp.mol[0].res[1].spin[0].ts, 1000 * 1e-12)
3332 3333
3334 - def test_set_mf_defaults_rex(self):
3335 """Set the model-free Rex parameter to the default value. 3336 3337 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3338 """ 3339 3340 # Set the current data pipe to 'mf'. 3341 pipes.switch('mf') 3342 3343 # Set the parameter. 3344 self.value_fns.set(param='rex') 3345 3346 # Test the parameter. 3347 self.assertEqual(cdp.mol[0].res[0].spin[0].rex, 0.0) 3348 self.assertEqual(cdp.mol[0].res[1].spin[0].rex, 0.0)
3349 3350
3351 - def test_set_mf_defaults_r(self):
3352 """Set the model-free bond length parameter to the default value. 3353 3354 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3355 """ 3356 3357 # Set the current data pipe to 'mf'. 3358 pipes.switch('mf') 3359 3360 # Set the parameter. 3361 self.value_fns.set(param='r') 3362 3363 # Test the parameter. 3364 self.assertEqual(cdp.mol[0].res[0].spin[0].r, 1.02 * 1e-10) 3365 self.assertEqual(cdp.mol[0].res[1].spin[0].r, 1.02 * 1e-10)
3366 3367
3368 - def test_set_mf_defaults_csa(self):
3369 """Set the model-free CSA parameter to the default value. 3370 3371 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3372 """ 3373 3374 # Set the current data pipe to 'mf'. 3375 pipes.switch('mf') 3376 3377 # Set the parameter. 3378 self.value_fns.set(param='csa') 3379 3380 # Test the parameter. 3381 self.assertEqual(cdp.mol[0].res[0].spin[0].csa, -172 * 1e-6) 3382 self.assertEqual(cdp.mol[0].res[1].spin[0].csa, -172 * 1e-6)
3383 3384
3386 """Set the model-free heteronucleus type to the default value. 3387 3388 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3389 """ 3390 3391 # Set the current data pipe to 'mf'. 3392 pipes.switch('mf') 3393 3394 # Set the parameter. 3395 self.value_fns.set(param='heteronuc_type') 3396 3397 # Test the parameter. 3398 self.assertEqual(cdp.mol[0].res[0].spin[0].heteronuc_type, '15N') 3399 self.assertEqual(cdp.mol[0].res[1].spin[0].heteronuc_type, '15N')
3400 3401
3403 """Set the model-free S2f and S2s parameters to the default values. 3404 3405 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3406 """ 3407 3408 # Set the current data pipe to 'mf'. 3409 pipes.switch('mf') 3410 3411 # Set the parameter. 3412 self.value_fns.set(param=['s2f', 's2s']) 3413 3414 # Test the parameters. 3415 self.assertEqual(cdp.mol[0].res[0].spin[0].s2f, 0.8) 3416 self.assertEqual(cdp.mol[0].res[0].spin[0].s2s, 0.8) 3417 self.assertEqual(cdp.mol[0].res[1].spin[0].s2f, 0.8) 3418 self.assertEqual(cdp.mol[0].res[1].spin[0].s2s, 0.8)
3419 3420
3422 """Set the model-free local tm parameter for a single spin. 3423 3424 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3425 """ 3426 3427 # Set the current data pipe to 'mf'. 3428 pipes.switch('mf') 3429 3430 # Set the parameter. 3431 self.value_fns.set(param='local_tm', val=1e-8, spin_id='@112') 3432 3433 # Test the parameter. 3434 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'local_tm')) 3435 self.assertEqual(cdp.mol[0].res[1].spin[0].local_tm, 1e-8)
3436 3437
3438 - def test_set_mf_single_spin_s2(self):
3439 """Set the model-free S2 parameter for a single spin. 3440 3441 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3442 """ 3443 3444 # Set the current data pipe to 'mf'. 3445 pipes.switch('mf') 3446 3447 # Set the parameter. 3448 self.value_fns.set(param='s2', val=0.8, spin_id='@112') 3449 3450 # Test the parameter. 3451 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 's2')) 3452 self.assertEqual(cdp.mol[0].res[1].spin[0].s2, 0.8)
3453 3454
3456 """Set the model-free S2f parameter for a single spin. 3457 3458 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3459 """ 3460 3461 # Set the current data pipe to 'mf'. 3462 pipes.switch('mf') 3463 3464 # Set the parameter. 3465 self.value_fns.set(param='s2f', val=0.45, spin_id='@112') 3466 3467 # Test the parameter. 3468 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 's2f')) 3469 self.assertEqual(cdp.mol[0].res[1].spin[0].s2f, 0.45)
3470 3471
3473 """Set the model-free S2s parameter for a single spin. 3474 3475 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3476 """ 3477 3478 # Set the current data pipe to 'mf'. 3479 pipes.switch('mf') 3480 3481 # Set the parameter. 3482 self.value_fns.set(param='s2s', val=0.1, spin_id='@112') 3483 3484 # Test the parameter. 3485 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 's2s')) 3486 self.assertEqual(cdp.mol[0].res[1].spin[0].s2s, 0.1)
3487 3488
3489 - def test_set_mf_single_spin_te(self):
3490 """Set the model-free te parameter for a single spin. 3491 3492 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3493 """ 3494 3495 # Set the current data pipe to 'mf'. 3496 pipes.switch('mf') 3497 3498 # Set the parameter. 3499 self.value_fns.set(param='te', val=12.5e-12, spin_id='@112') 3500 3501 # Test the parameter. 3502 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'te')) 3503 self.assertEqual(cdp.mol[0].res[1].spin[0].te, 12.5e-12)
3504 3505
3506 - def test_set_mf_single_spin_tf(self):
3507 """Set the model-free tf parameter for a single spin. 3508 3509 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3510 """ 3511 3512 # Set the current data pipe to 'mf'. 3513 pipes.switch('mf') 3514 3515 # Set the parameter. 3516 self.value_fns.set(param='tf', val=20.1e-12, spin_id='@112') 3517 3518 # Test the parameter. 3519 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'tf')) 3520 self.assertEqual(cdp.mol[0].res[1].spin[0].tf, 20.1e-12)
3521 3522
3523 - def test_set_mf_single_spin_ts(self):
3524 """Set the model-free ts parameter for a single spin. 3525 3526 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3527 """ 3528 3529 # Set the current data pipe to 'mf'. 3530 pipes.switch('mf') 3531 3532 # Set the parameter. 3533 self.value_fns.set(param='ts', val=1.23e-9, spin_id='@112') 3534 3535 # Test the parameter. 3536 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'ts')) 3537 self.assertEqual(cdp.mol[0].res[1].spin[0].ts, 1.23e-9)
3538 3539
3541 """Set the model-free Rex parameter for a single spin. 3542 3543 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3544 """ 3545 3546 # Set the current data pipe to 'mf'. 3547 pipes.switch('mf') 3548 3549 # Set the parameter. 3550 self.value_fns.set(param='rex', val=2.34, spin_id='@112') 3551 3552 # Test the parameter. 3553 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'rex')) 3554 self.assertEqual(cdp.mol[0].res[1].spin[0].rex, 2.34)
3555 3556
3557 - def test_set_mf_single_spin_r(self):
3558 """Set the model-free bond length parameter for a single spin. 3559 3560 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3561 """ 3562 3563 # Set the current data pipe to 'mf'. 3564 pipes.switch('mf') 3565 3566 # Set the parameter. 3567 self.value_fns.set(param='r', val=1.02e-10, spin_id='@112') 3568 3569 # Test the parameter. 3570 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'r')) 3571 self.assertEqual(cdp.mol[0].res[1].spin[0].r, 1.02e-10)
3572 3573
3575 """Set the model-free CSA parameter for a single spin. 3576 3577 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3578 """ 3579 3580 # Set the current data pipe to 'mf'. 3581 pipes.switch('mf') 3582 3583 # Set the parameter. 3584 self.value_fns.set(param='csa', val=-172e-6, spin_id='@112') 3585 3586 # Test the parameter. 3587 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'csa')) 3588 self.assertEqual(cdp.mol[0].res[1].spin[0].csa, -172e-6)
3589 3590
3592 """Set the model-free heteronucleus type for a single spin. 3593 3594 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3595 """ 3596 3597 # Set the current data pipe to 'mf'. 3598 pipes.switch('mf') 3599 3600 # Set the parameter. 3601 self.value_fns.set(param='heteronuc_type', val='13C', spin_id='@112') 3602 3603 # Test the parameter. 3604 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'heteronuc_type')) 3605 self.assertEqual(cdp.mol[0].res[1].spin[0].heteronuc_type, '13C')
3606 3607
3609 """Set the model-free S2f and S2s parameters for a single spin to different values. 3610 3611 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3612 """ 3613 3614 # Set the current data pipe to 'mf'. 3615 pipes.switch('mf') 3616 3617 # Set the parameter. 3618 self.value_fns.set(param=['s2f', 's2s'], val=[0.7, 0.9], spin_id='@112') 3619 3620 # Test the parameters. 3621 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 's2f')) 3622 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 's2s')) 3623 self.assertEqual(cdp.mol[0].res[1].spin[0].s2f, 0.7) 3624 self.assertEqual(cdp.mol[0].res[1].spin[0].s2s, 0.9)
3625 3626
3628 """Set the model-free S2f and S2s parameters for a single spin to the same value. 3629 3630 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3631 """ 3632 3633 # Set the current data pipe to 'mf'. 3634 pipes.switch('mf') 3635 3636 # Set the parameter. 3637 self.value_fns.set(param=['s2f', 's2s'], val=0.7, spin_id='@112') 3638 3639 # Test the parameters. 3640 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 's2f')) 3641 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 's2s')) 3642 self.assertEqual(cdp.mol[0].res[1].spin[0].s2f, 0.7) 3643 self.assertEqual(cdp.mol[0].res[1].spin[0].s2s, 0.7)
3644 3645 3646 3647 ############################ 3648 # N-state model parameters # 3649 ############################ 3650 3651
3652 - def test_set_n_state_model_rx(self):
3653 """Set the N-state model curve fitting alpha2 parameter. 3654 3655 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3656 """ 3657 3658 # Set the current data pipe to 'n_state'. 3659 pipes.switch('n_state') 3660 3661 # Set the parameter. 3662 self.value_fns.set(param='alpha2', val=pi) 3663 3664 # Test the parameter. 3665 self.assertEqual(cdp.alpha[0], 0.0) 3666 self.assertEqual(cdp.alpha[1], 0.0) 3667 self.assertEqual(cdp.alpha[2], pi) 3668 self.assertEqual(cdp.alpha[3], 0.0)
3669 3670 3671 3672 ####################################### 3673 # Relaxation curve fitting parameters # 3674 ####################################### 3675 3676
3678 """Set the relaxation curve fitting Rx parameter for all spins. 3679 3680 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3681 """ 3682 3683 # Set the current data pipe to 'relax_fit'. 3684 pipes.switch('relax_fit') 3685 3686 # Set the parameter. 3687 self.value_fns.set(param='rx', val=1.2) 3688 3689 # Test the parameter. 3690 self.assertEqual(cdp.mol[0].res[0].spin[0].rx, 1.2) 3691 self.assertEqual(cdp.mol[0].res[1].spin[0].rx, 1.2)
3692 3693
3695 """Set the relaxation curve fitting I0 parameter for all spins. 3696 3697 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3698 """ 3699 3700 # Set the current data pipe to 'relax_fit'. 3701 pipes.switch('relax_fit') 3702 3703 # Set the parameter. 3704 self.value_fns.set(param='i0', val=520) 3705 3706 # Test the parameter. 3707 self.assertEqual(cdp.mol[0].res[0].spin[0].i0, 520) 3708 self.assertEqual(cdp.mol[0].res[1].spin[0].i0, 520)
3709 3710
3712 """Set the relaxation curve fitting Iinf parameter for all spins. 3713 3714 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3715 """ 3716 3717 # Set the current data pipe to 'relax_fit'. 3718 pipes.switch('relax_fit') 3719 3720 # Set the parameter. 3721 self.value_fns.set(param='iinf', val=-1.7) 3722 3723 # Test the parameter. 3724 self.assertEqual(cdp.mol[0].res[0].spin[0].iinf, -1.7) 3725 self.assertEqual(cdp.mol[0].res[1].spin[0].iinf, -1.7)
3726 3727
3729 """Set the relaxation curve fitting parameters {I0, Iinf} for all spins to different values. 3730 3731 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3732 """ 3733 3734 # Set the current data pipe to 'relax_fit'. 3735 pipes.switch('relax_fit') 3736 3737 # Set the parameter. 3738 self.value_fns.set(param=['i0', 'iinf'], val=[123456, -1.7]) 3739 3740 # Test the parameter. 3741 self.assertEqual(cdp.mol[0].res[0].spin[0].i0, 123456) 3742 self.assertEqual(cdp.mol[0].res[0].spin[0].iinf, -1.7) 3743 self.assertEqual(cdp.mol[0].res[1].spin[0].i0, 123456) 3744 self.assertEqual(cdp.mol[0].res[1].spin[0].iinf, -1.7)
3745 3746
3748 """Set the relaxation curve fitting parameters {I0, Iinf} for all spins to the same value. 3749 3750 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3751 """ 3752 3753 # Set the current data pipe to 'relax_fit'. 3754 pipes.switch('relax_fit') 3755 3756 # Set the parameter. 3757 self.value_fns.set(param=['i0', 'iinf'], val=0.0) 3758 3759 # Test the parameter. 3760 self.assertEqual(cdp.mol[0].res[0].spin[0].i0, 0.0) 3761 self.assertEqual(cdp.mol[0].res[0].spin[0].iinf, 0.0) 3762 self.assertEqual(cdp.mol[0].res[1].spin[0].i0, 0.0) 3763 self.assertEqual(cdp.mol[0].res[1].spin[0].iinf, 0.0)
3764 3765
3767 """Set the relaxation curve fitting Rx parameter to the default value. 3768 3769 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3770 """ 3771 3772 # Set the current data pipe to 'relax_fit'. 3773 pipes.switch('relax_fit') 3774 3775 # Set the parameter. 3776 self.value_fns.set(param='rx') 3777 3778 # Test the parameter. 3779 self.assertEqual(cdp.mol[0].res[0].spin[0].rx, 8.0) 3780 self.assertEqual(cdp.mol[0].res[1].spin[0].rx, 8.0)
3781 3782
3784 """Set the relaxation curve fitting I0 parameter to the default value. 3785 3786 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3787 """ 3788 3789 # Set the current data pipe to 'relax_fit'. 3790 pipes.switch('relax_fit') 3791 3792 # Set the parameter. 3793 self.value_fns.set(param='i0') 3794 3795 # Test the parameter. 3796 self.assertEqual(cdp.mol[0].res[0].spin[0].i0, 10000.0) 3797 self.assertEqual(cdp.mol[0].res[1].spin[0].i0, 10000.0)
3798 3799
3801 """Set the relaxation curve fitting Iinf parameter to the default value. 3802 3803 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3804 """ 3805 3806 # Set the current data pipe to 'relax_fit'. 3807 pipes.switch('relax_fit') 3808 3809 # Set the parameter. 3810 self.value_fns.set(param='iinf') 3811 3812 # Test the parameter. 3813 self.assertEqual(cdp.mol[0].res[0].spin[0].iinf, 0.0) 3814 self.assertEqual(cdp.mol[0].res[1].spin[0].iinf, 0.0)
3815 3816
3818 """Set the relaxation curve fitting parameters {I0, Iinf} to the default values. 3819 3820 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3821 """ 3822 3823 # Set the current data pipe to 'relax_fit'. 3824 pipes.switch('relax_fit') 3825 3826 # Set the parameter. 3827 self.value_fns.set(param=['i0', 'iinf']) 3828 3829 # Test the parameter. 3830 self.assertEqual(cdp.mol[0].res[0].spin[0].i0, 10000.0) 3831 self.assertEqual(cdp.mol[0].res[0].spin[0].iinf, 0.0) 3832 self.assertEqual(cdp.mol[0].res[1].spin[0].i0, 10000.0) 3833 self.assertEqual(cdp.mol[0].res[1].spin[0].iinf, 0.0)
3834 3835
3837 """Set the relaxation curve fitting Rx parameter for all spins. 3838 3839 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3840 """ 3841 3842 # Set the current data pipe to 'relax_fit'. 3843 pipes.switch('relax_fit') 3844 3845 # Set the parameter. 3846 self.value_fns.set(param='rx', val=1.2, spin_id='@112') 3847 3848 # Test the parameter. 3849 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'rx')) 3850 self.assertEqual(cdp.mol[0].res[1].spin[0].rx, 1.2)
3851 3852
3854 """Set the relaxation curve fitting I0 parameter for all spins. 3855 3856 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3857 """ 3858 3859 # Set the current data pipe to 'relax_fit'. 3860 pipes.switch('relax_fit') 3861 3862 # Set the parameter. 3863 self.value_fns.set(param='i0', val=520, spin_id='@112') 3864 3865 # Test the parameter. 3866 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'i0')) 3867 self.assertEqual(cdp.mol[0].res[1].spin[0].i0, 520)
3868 3869
3871 """Set the relaxation curve fitting Iinf parameter for all spins. 3872 3873 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3874 """ 3875 3876 # Set the current data pipe to 'relax_fit'. 3877 pipes.switch('relax_fit') 3878 3879 # Set the parameter. 3880 self.value_fns.set(param='iinf', val=-1.7, spin_id='@112') 3881 3882 # Test the parameter. 3883 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'iinf')) 3884 self.assertEqual(cdp.mol[0].res[1].spin[0].iinf, -1.7)
3885 3886
3888 """Set the relaxation curve fitting parameters {I0, Iinf} for all spins to different values. 3889 3890 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3891 """ 3892 3893 # Set the current data pipe to 'relax_fit'. 3894 pipes.switch('relax_fit') 3895 3896 # Set the parameter. 3897 self.value_fns.set(param=['i0', 'iinf'], val=[123456, -1.7], spin_id='@112') 3898 3899 # Test the parameter. 3900 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'i0')) 3901 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'iinf')) 3902 self.assertEqual(cdp.mol[0].res[1].spin[0].i0, 123456) 3903 self.assertEqual(cdp.mol[0].res[1].spin[0].iinf, -1.7)
3904 3905
3907 """Set the relaxation curve fitting parameters {I0, Iinf} for all spins to the same value. 3908 3909 The functions tested are both generic_fns.value.set() and prompt.value.set(). 3910 """ 3911 3912 # Set the current data pipe to 'relax_fit'. 3913 pipes.switch('relax_fit') 3914 3915 # Set the parameter. 3916 self.value_fns.set(param=['i0', 'iinf'], val=0.0, spin_id='@112') 3917 3918 # Test the parameter. 3919 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'i0')) 3920 self.assert_(not hasattr(cdp.mol[0].res[0].spin[0], 'iinf')) 3921 self.assertEqual(cdp.mol[0].res[1].spin[0].i0, 0.0) 3922 self.assertEqual(cdp.mol[0].res[1].spin[0].iinf, 0.0)
3923