Changeset 7ef319e in sasview for sansmodels/src
- Timestamp:
- Oct 21, 2009 10:36:35 AM (15 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 81bece4
- Parents:
- 156a0b2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/test/utest_other_models.py
ra65ffcb r7ef319e 5 5 Some models return limit of the function at critical point . 6 6 So the user should expect finite value for some critical points. 7 Only critical q=0 will be tested. 8 9 Critical points tests that fail. the user is responsible of changing 10 the model tested or document the failure. 11 7 12 Initial values for models are given as the one of Igo software. 8 13 @author: Gervaise Alina / UTK 14 @summary: Run by G. Alina 10/21/2009 15 Most of the lamellar tests are not passing. Check lamellar im 16 plementation. 17 critial points tested not passing for: 18 - Flexible Cylinder 19 - PeakLorenzt 20 - Squarewell Structure 21 - StickyHstructure 22 - hardSphereStructure 23 24 9 25 """ 10 26 … … 56 72 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 57 73 58 74 def testCriticalPoint(self): 75 """ Test coreshell at the critical point""" 76 self.assert_(numpy.isfinite(self.comp.run(0.0))) 59 77 60 78 class TestMultiShellModel(unittest.TestCase): … … 102 120 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 103 121 122 def testCriticalPoint(self): 123 """ Test multishell at the critical point""" 124 self.assert_(numpy.isfinite(self.comp.run(0.0))) 104 125 105 126 class TestVesicleModel(unittest.TestCase): … … 145 166 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 146 167 147 168 def testCriticalPoint(self): 169 """ Test vesicle at the critical point""" 170 self.assert_(numpy.isfinite(self.comp.run(0.0))) 171 172 148 173 class TestBinaryHSModel(unittest.TestCase): 149 174 """ Unit tests for BinaryHS Model""" … … 189 214 self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8) 190 215 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 191 216 217 def testCriticalPoint(self): 218 """ Test BinaryHS at the critical point""" 219 self.assert_(numpy.isfinite(self.comp.run(0.0))) 220 192 221 193 222 class TestCoreShellCylinderModel(unittest.TestCase): … … 242 271 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 243 272 273 def testCriticalPoint(self): 274 """ Test CoreShellCylinder at the critical point""" 275 self.assert_(numpy.isfinite(self.comp.run(0.0))) 276 244 277 245 278 class TestHollowCylinderModel(unittest.TestCase): … … 291 324 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 292 325 326 def testCriticalPoint(self): 327 """ Test HollowCylinder at the critical point""" 328 self.assert_(numpy.isfinite(self.comp.run(0.0))) 329 293 330 294 331 class TestFlexibleCylinderModel(unittest.TestCase): … … 340 377 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 341 378 379 def testCriticalPoint(self): 380 """ Test FlexibleCylinder at the critical point""" 381 self.assert_(numpy.isfinite(self.comp.run(0.0))) 342 382 343 383 … … 396 436 self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8) 397 437 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 398 438 439 def testCriticalPoint(self): 440 """ Test StackedDisks at the critical point""" 441 self.assert_(numpy.isfinite(self.comp.run(0.0))) 442 399 443 400 444 class TestParallelepipedModel(unittest.TestCase): … … 448 492 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 449 493 494 def testCriticalPoint(self): 495 """ Test Parallelepiped at the critical point""" 496 self.assert_(numpy.isfinite(self.comp.run(0.0))) 450 497 451 498 class TestEllipticalCylinderModel(unittest.TestCase): … … 499 546 self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8) 500 547 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 501 548 549 def testCriticalPoint(self): 550 """ Test EllipticalCylinder at the critical point""" 551 self.assert_(numpy.isfinite(self.comp.run(0.0))) 502 552 503 553 … … 549 599 self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8) 550 600 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 551 601 602 def testCriticalPoint(self): 603 """ Test Ellipsoid at the critical point""" 604 self.assert_(numpy.isfinite(self.comp.run(0.0))) 552 605 553 606 class TestCoreShellEllipsoidModel(unittest.TestCase): … … 603 656 self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8) 604 657 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 605 658 659 def testCriticalPoint(self): 660 """ Test CoreShellEllipsoid at the critical point""" 661 self.assert_(numpy.isfinite(self.comp.run(0.0))) 606 662 607 663 class TestTriaxialEllipsoidModel(unittest.TestCase): … … 656 712 self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8) 657 713 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 658 714 715 def testCriticalPoint(self): 716 """ Test TriaxialEllipsoid at the critical point""" 717 self.assert_(numpy.isfinite(self.comp.run(0.0))) 659 718 660 719 class TestLamellarModel(unittest.TestCase): … … 699 758 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 700 759 760 def testCriticalPoint(self): 761 """ Test Lamellar at the critical point""" 762 self.assert_(numpy.isfinite(self.comp.run(0.0))) 701 763 702 764 class TestLamellarFFHGModel(unittest.TestCase): … … 743 805 self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8) 744 806 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 745 807 808 def testCriticalPoint(self): 809 """ Test LamellarFFHG at the critical point""" 810 self.assert_(numpy.isfinite(self.comp.run(0.0))) 746 811 747 812 class TestLamellarPSModel(unittest.TestCase): … … 789 854 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 790 855 791 856 def testCriticalPoint(self): 857 """ Test LamellarPS at the critical point""" 858 self.assert_(numpy.isfinite(self.comp.run(0.0))) 792 859 793 860 class TestLamellarPSHGModel(unittest.TestCase): … … 836 903 self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8) 837 904 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 838 905 906 def testCriticalPoint(self): 907 """ Test LamellarPSHG at the critical point""" 908 self.assert_(numpy.isfinite(self.comp.run(0.0))) 839 909 840 910 class TestSquareWellStructure(unittest.TestCase): … … 878 948 self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8) 879 949 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 880 950 951 def testCriticalPoint(self): 952 """ Test SquareWellStructure at the critical point""" 953 self.assert_(numpy.isfinite(self.comp.run(0.0))) 881 954 882 955 class TestHardsphereStructure(unittest.TestCase): … … 917 990 self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8) 918 991 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 919 992 993 def testCriticalPoint(self): 994 """ Test HardsphereStructure at the critical point""" 995 self.assert_(numpy.isfinite(self.comp.run(0.0))) 920 996 921 997 class TestStickyHSStructure(unittest.TestCase): … … 952 1028 self.assertEquals(self.comp.run(1.3),self.x_array[1]) 953 1029 954 955 1030 def testEval_2D(self): 956 1031 """ Test 2D model for a StickyHSStructure with evalDistribution""" … … 960 1035 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 961 1036 962 1037 def testCriticalPoint(self): 1038 """ Test StickyHSStructure at the critical point""" 1039 self.assert_(numpy.isfinite(self.comp.run(0.0))) 963 1040 964 1041 class TestHayterMSAStructure(unittest.TestCase): … … 1003 1080 self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8) 1004 1081 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 1005 1082 1083 def testCriticalPoint(self): 1084 """ Test HayterMSAStructure at the critical point""" 1085 self.assert_(numpy.isfinite(self.comp.run(0.0))) 1006 1086 1007 1087 … … 1044 1124 self.assertEquals(self.comp.run(1.3),self.x_array[1]) 1045 1125 1046 1047 1126 def testEval_2D(self): 1048 1127 """ Test 2D model for a BEPolyelectrolyte with evalDistribution""" … … 1051 1130 self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8) 1052 1131 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 1053 1132 1133 def testCriticalPoint(self): 1134 """ Test BEPolyelectrolyte at the critical point""" 1135 self.assert_(numpy.isfinite(self.comp.run(0.0))) 1136 1054 1137 1055 1138 class TestDABModel(unittest.TestCase): … … 1085 1168 self.assertEquals(self.comp.run(1.3),self.x_array[1]) 1086 1169 1087 1088 1170 def testEval_2D(self): 1089 1171 """ Test 2D model for a DABModel with evalDistribution""" … … 1092 1174 self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8) 1093 1175 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 1094 1176 1177 def testCriticalPoint(self): 1178 """ Test DABModel at the critical point""" 1179 self.assert_(numpy.isfinite(self.comp.run(0.0))) 1095 1180 1096 1181 … … 1113 1198 self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime]) 1114 1199 1115 1116 1200 def test1D(self): 1117 1201 """ Test 1D model for a GuinierModel""" … … 1122 1206 self.assertAlmostEqual(self.comp.run([1.0, 1.3]),0.716531, 4) 1123 1207 1124 1125 1208 def testEval_1D(self): 1126 1209 """ Test 1D model for a GuinierModel with evalDistribution""" … … 1135 1218 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 1136 1219 1220 def testCriticalPoint(self): 1221 """ Test GuinierModel at the critical point""" 1222 self.assert_(numpy.isfinite(self.comp.run(0.0))) 1137 1223 1138 1224 … … 1176 1262 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 1177 1263 1264 def testCriticalPoint(self): 1265 """ Test DebyeModel at the critical point""" 1266 self.assertEquals(self.comp.run(0.0),1.001) 1267 1178 1268 1179 1269 class TestPorodModel(unittest.TestCase): … … 1215 1305 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 1216 1306 1217 def testCreaticalP t(self):1307 def testCreaticalPoint(self): 1218 1308 """ Test for critical point for PorodModel run""" 1219 1309 self.assertRaises(ZeroDivisionError, self.comp.run, 0.0) … … 1259 1349 self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8) 1260 1350 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 1261 1351 1352 def testCriticalPoint(self): 1353 """ Test PeakGauss at the critical point""" 1354 self.assert_(numpy.isfinite(self.comp.run(0.0))) 1262 1355 1263 1356 class TestPeakLorentzModel(unittest.TestCase): … … 1301 1394 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 1302 1395 1303 1396 def testCriticalPoint(self): 1397 """ Test PeakLorentz at the critical point""" 1398 self.comp.setParam('B', 0.0) 1399 self.assertRaises(ZeroDivisionError, self.comp.run, 10) 1400 self.assert_(numpy.isfinite(self.comp.run(0.0))) 1401 1402 1304 1403 class TestFractalAbsModel(unittest.TestCase): 1305 1404 """ Unit tests for FractalAbsModel""" … … 1344 1443 self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8) 1345 1444 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 1346 1445 1446 def testCriticalPoint(self): 1447 """ Test Fractal Abs at the critical point""" 1448 self.assert_(numpy.isfinite(self.comp.run(0.0))) 1347 1449 1348 1450 class TestFractalModel(unittest.TestCase): … … 1389 1491 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 1390 1492 1493 def testCriticalPoint(self): 1494 """ Test Fractal at the critical point""" 1495 self.assert_(numpy.isfinite(self.comp.run(0.0))) 1391 1496 1392 1497 class TestLorentzModel(unittest.TestCase): … … 1428 1533 self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8) 1429 1534 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 1430 1535 1536 def testCriticalPoint(self): 1537 """ Test Lorentz at the critical point""" 1538 self.assert_(numpy.isfinite(self.comp.run(0.0))) 1539 1540 1431 1541 class TestPowerLawAbsModel(unittest.TestCase): 1432 1542 """ Unit tests for PowerLawAbsModel""" … … 1467 1577 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 1468 1578 1579 def testCriticalPoint(self): 1580 """ Test PowerLawAbs at the critical point""" 1581 self.assert_(numpy.isfinite(self.comp.run(0.0))) 1582 1583 1469 1584 class TestPowerLawModel(unittest.TestCase): 1470 1585 """ Unit tests for PowerLawModel""" … … 1504 1619 self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8) 1505 1620 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 1621 1622 def testCriticalPoint(self): 1623 """ Test PowerLawModel at the critical point""" 1624 self.assert_(numpy.isfinite(self.comp.run(0.0))) 1506 1625 1507 1626 … … 1544 1663 self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8) 1545 1664 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 1546 1665 1666 def testCriticalPoint(self): 1667 """ Test TeubnerStrey at the critical point""" 1668 self.assert_(numpy.isfinite(self.comp.run(0.0))) 1669 1547 1670 1548 1671 class TestLineModel(unittest.TestCase): … … 1578 1701 self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8) 1579 1702 self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8) 1580 1703 1704 def testCriticalPoint(self): 1705 """ Test line at the critical point""" 1706 self.assert_(numpy.isfinite(self.comp.run(0.0))) 1581 1707 1582 1708 if __name__ == '__main__':
Note: See TracChangeset
for help on using the changeset viewer.