Changeset 39a06c9 in sasmodels for sasmodels/model_test.py


Ignore:
Timestamp:
Oct 25, 2018 5:58:26 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
81751c2
Parents:
304c775
Message:

Remove references to ER and VR from sasmodels. Refs #1202.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/model_test.py

    r304c775 r39a06c9  
    1010 
    1111Each model is tested using the default parameters at q=0.1, (qx, qy)=(0.1, 0.1), 
    12 and the ER and VR are computed.  The return values at these points are not 
    13 considered.  The test is only to verify that the models run to completion, 
    14 and do not produce inf or NaN. 
     12and Fq is called to make sure R_eff, volume and volume ratio are computed. 
     13The return values at these points are not considered.  The test is only to 
     14verify that the models run to completion, and do not produce inf or NaN. 
    1515 
    1616Tests are defined with the *tests* attribute in the model.py file.  *tests* 
    1717is a list of individual tests to run, where each test consists of the 
    1818parameter values for the test, the q-values and the expected results.  For 
    19 the effective radius test, the q-value should be 'ER'.  For the VR test, 
    20 the q-value should be 'VR'.  For 1-D tests, either specify the q value or 
    21 a list of q-values, and the corresponding I(q) value, or list of I(q) values. 
     19the effective radius test and volume ratio tests, use the extended output 
     20form, which checks each output of kernel.Fq. For 1-D tests, either specify 
     21the q value or a list of q-values, and the corresponding I(q) value, or 
     22list of I(q) values. 
    2223 
    2324That is:: 
     
    3233                        [I(qx1, qy1), I(qx2, qy2), ...]], 
    3334 
    34         [ {parameters}, 'ER', ER(pars) ], 
    35         [ {parameters}, 'VR', VR(pars) ], 
     35        [ {parameters}, q, F(q), F^2(q), R_eff, V, V_r ], 
    3636        ... 
    3737    ] 
     
    214214                ({}, [0.001, 0.01, 0.1], [None]*3), 
    215215                ({}, [(0.1, 0.1)]*2, [None]*2), 
    216                 # test that ER/VR will run if they exist 
     216                # test that Fq will run 
    217217                ({}, 0.1, None, None, None, None, None), 
    218218                ] 
     
    249249        def _find_missing_tests(self): 
    250250            # type: () -> None 
    251             """make sure there are 1D, 2D, ER and VR tests as appropriate""" 
    252             model_has_VR = callable(self.info.VR) 
    253             model_has_ER = callable(self.info.ER) 
     251            """make sure there are 1D and 2D tests as appropriate""" 
    254252            model_has_1D = True 
    255253            model_has_2D = any(p.type == 'orientation' 
     
    259257            single = [test for test in self.info.tests 
    260258                      if not isinstance(test[2], list) and test[2] is not None] 
    261             tests_has_VR = any(test[1] == 'VR' for test in single) 
    262             tests_has_ER = any(test[1] == 'ER' for test in single) 
    263259            tests_has_1D_single = any(isinstance(test[1], float) for test in single) 
    264260            tests_has_2D_single = any(isinstance(test[1], tuple) for test in single) 
     
    273269 
    274270            missing = [] 
    275             if model_has_VR and not tests_has_VR: 
    276                 missing.append("VR") 
    277             if model_has_ER and not tests_has_ER: 
    278                 missing.append("ER") 
    279271            if model_has_1D and not (tests_has_1D_single or tests_has_1D_multiple): 
    280272                missing.append("1D") 
Note: See TracChangeset for help on using the changeset viewer.