Changes in / [ecb485c:ecf895e] in sasmodels


Ignore:
Files:
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • .travis.yml

    ra69d8cd r2d09df1  
    3737- conda update --yes conda 
    3838- conda info -a 
    39 # 2018-01-26 PAK: sasmodels uses yield generator for tests, which isn't supported in pytest 4+ 
    40 - conda install --yes python=$PY numpy scipy cython mako cffi "pytest<4" 
     39- conda install --yes python=$PY numpy scipy cython mako cffi 
    4140install: 
    4241- pip install bumps 
     
    4443script: 
    4544- python --version 
    46 #- python -m sasmodels.model_test -v dll all 
    47 - python -m pytest -v 
     45- python -m sasmodels.model_test -v dll all 
    4846before_deploy: 
    4947- echo -e "Host danse.chem.utk.edu\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config 
  • appveyor.yml

    ra69d8cd rfefc185  
    4444 
    4545install: 
    46     # Set the CONDA_NPY, although it has no impact on the actual build. 
     46    # Set the CONDA_NPY, although it has no impact on the actual build.  
    4747    # We need this because of a test within conda-build. 
    4848    - cmd: set CONDA_NPY=19 
     
    6868    #- cmd: conda install --yes --quiet obvious-ci 
    6969    # 2018-01-19 PAK: skipping toolchain cython and cffi (these were for pyopencl?) 
    70     # 2018-01-26 PAK: sasmodels uses yield generator for tests, which isn't supported in pytest 4+ 
    71     - cmd: conda install --yes --quiet numpy scipy "pytest<4" 
     70    - cmd: conda install --yes --quiet numpy scipy 
    7271    # 2018-01-19 PAK: skipping pyopencl; this would be needed for deploy but maybe not for test 
    7372    #- cmd: conda install --yes --channel conda-forge pyopencl 
     
    8786    #- "%CMD_IN_ENV% python -m sasmodels.model_test dll all" 
    8887    #- cmd /E:ON /V:ON /C obvci_appveyor_python_build_env.cmd python -m sasmoels.model_test dll all 
    89     #- python -m sasmodels.model_test dll all 
    90     #- nosetests -v sasmodels/*.py 
    91     - python -m pytest -v 
     88    - python -m sasmodels.model_test dll all 
  • sasmodels/convert.py

    ra69d8cd r2d81cfe  
    633633def test_backward_forward(): 
    634634    from .core import list_models 
    635     L = lambda name: _check_one(name, seed=1) 
    636635    for name in list_models('all'): 
    637         yield L, name 
     636        L = lambda: _check_one(name, seed=1) 
     637        L.description = name 
     638        yield L 
  • sasmodels/core.py

    ra69d8cd r7a516d0  
    320320    print("\n".join(list_models(kind))) 
    321321 
    322 def test_composite_order(): 
     322def test_load(): 
     323    # type: () -> None 
     324    """Check that model load works""" 
    323325    def test_models(fst, snd): 
    324326        """Confirm that two models produce the same parameters""" 
    325327        fst = load_model(fst) 
    326328        snd = load_model(snd) 
    327         # Un-disambiguate parameter names so that we can check if the same 
    328         # parameters are in a pair of composite models. Since each parameter in 
    329         # the mixture model is tagged as e.g., A_sld, we ought to use a 
    330         # regex subsitution s/^[A-Z]+_/_/, but removing all uppercase letters 
    331         # is good enough. 
     329        # Remove the upper case characters frin the parameters, since 
     330        # they lasndel the order of events and we specfically are 
     331        # changin that aspect 
    332332        fst = [[x for x in p.name if x == x.lower()] for p in fst.info.parameters.kernel_parameters] 
    333333        snd = [[x for x in p.name if x == x.lower()] for p in snd.info.parameters.kernel_parameters] 
    334334        assert sorted(fst) == sorted(snd), "{} != {}".format(fst, snd) 
    335335 
    336     def build_test(first, second): 
    337         test = lambda description: test_models(first, second) 
    338         description = first + " vs. " + second 
    339         return test, description 
    340  
    341     yield build_test( 
     336 
     337    test_models( 
    342338        "cylinder+sphere", 
    343339        "sphere+cylinder") 
    344     yield build_test( 
     340    test_models( 
    345341        "cylinder*sphere", 
    346342        "sphere*cylinder") 
    347     yield build_test( 
     343    test_models( 
    348344        "cylinder@hardsphere*sphere", 
    349345        "sphere*cylinder@hardsphere") 
    350     yield build_test( 
     346    test_models( 
    351347        "barbell+sphere*cylinder@hardsphere", 
    352348        "sphere*cylinder@hardsphere+barbell") 
    353     yield build_test( 
     349    test_models( 
    354350        "barbell+cylinder@hardsphere*sphere", 
    355351        "cylinder@hardsphere*sphere+barbell") 
    356     yield build_test( 
     352    test_models( 
    357353        "barbell+sphere*cylinder@hardsphere", 
    358354        "barbell+cylinder@hardsphere*sphere") 
    359     yield build_test( 
     355    test_models( 
    360356        "sphere*cylinder@hardsphere+barbell", 
    361357        "cylinder@hardsphere*sphere+barbell") 
    362     yield build_test( 
     358    test_models( 
    363359        "barbell+sphere*cylinder@hardsphere", 
    364360        "cylinder@hardsphere*sphere+barbell") 
    365     yield build_test( 
     361    test_models( 
    366362        "barbell+cylinder@hardsphere*sphere", 
    367363        "sphere*cylinder@hardsphere+barbell") 
    368364 
    369 def test_composite(): 
    370     # type: () -> None 
    371     """Check that model load works""" 
    372365    #Test the the model produces the parameters that we would expect 
    373366    model = load_model("cylinder@hardsphere*sphere") 
  • sasmodels/model_test.py

    ra69d8cd r2d81cfe  
    123123 
    124124        if is_py:  # kernel implemented in python 
    125             test_name = "%s-python"%model_name 
     125            test_name = "Model: %s, Kernel: python"%model_name 
    126126            test_method_name = "test_%s_python" % model_info.id 
    127127            test = ModelTestCase(test_name, model_info, 
     
    135135            # test using dll if desired 
    136136            if 'dll' in loaders or not core.HAVE_OPENCL: 
    137                 test_name = "%s-dll"%model_name 
     137                test_name = "Model: %s, Kernel: dll"%model_name 
    138138                test_method_name = "test_%s_dll" % model_info.id 
    139139                test = ModelTestCase(test_name, model_info, 
     
    146146            # test using opencl if desired and available 
    147147            if 'opencl' in loaders and core.HAVE_OPENCL: 
    148                 test_name = "%s-opencl"%model_name 
     148                test_name = "Model: %s, Kernel: OpenCL"%model_name 
    149149                test_method_name = "test_%s_opencl" % model_info.id 
    150150                # Using dtype=None so that the models that are only 
     
    469469    loaders = ['opencl', 'dll'] if core.HAVE_OPENCL else ['dll'] 
    470470    tests = make_suite(loaders, ['all']) 
    471     for test in tests: 
    472         # In order for nosetest to show the test name, wrap the test.run_all 
    473         # instance in function that takes the test name as a parameter which 
    474         # will be displayed when the test is run. 
    475         yield lambda name: test.run_all(), test.test_name 
     471    for test_i in tests: 
     472        # In order for nosetest to see the correct test name, need to set 
     473        # the description attribute of the returned function.  Since we 
     474        # can't do this for the returned instance, wrap it in a lambda and 
     475        # set the description on the lambda.  Otherwise we could just do: 
     476        #    yield test_i.run_all 
     477        L = lambda: test_i.run_all() 
     478        L.description = test_i.test_name 
     479        yield L 
    476480 
    477481 
  • sasmodels/sasview_model.py

    ra69d8cd r2d81cfe  
    859859    # type: () -> None 
    860860    """ 
    861     Load and run cylinder model as sas-models-CylinderModel 
     861    Load and run cylinder model from sas.models.CylinderModel 
    862862    """ 
    863863    if not SUPPORT_OLD_STYLE_PLUGINS: 
Note: See TracChangeset for help on using the changeset viewer.