Changes in / [ecb485c:ecf895e] in sasmodels
- Files:
-
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
.travis.yml
ra69d8cd r2d09df1 37 37 - conda update --yes conda 38 38 - 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 41 40 install: 42 41 - pip install bumps … … 44 43 script: 45 44 - 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 48 46 before_deploy: 49 47 - echo -e "Host danse.chem.utk.edu\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config -
appveyor.yml
ra69d8cd rfefc185 44 44 45 45 install: 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. 47 47 # We need this because of a test within conda-build. 48 48 - cmd: set CONDA_NPY=19 … … 68 68 #- cmd: conda install --yes --quiet obvious-ci 69 69 # 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 72 71 # 2018-01-19 PAK: skipping pyopencl; this would be needed for deploy but maybe not for test 73 72 #- cmd: conda install --yes --channel conda-forge pyopencl … … 87 86 #- "%CMD_IN_ENV% python -m sasmodels.model_test dll all" 88 87 #- 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 633 633 def test_backward_forward(): 634 634 from .core import list_models 635 L = lambda name: _check_one(name, seed=1)636 635 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 320 320 print("\n".join(list_models(kind))) 321 321 322 def test_composite_order(): 322 def test_load(): 323 # type: () -> None 324 """Check that model load works""" 323 325 def test_models(fst, snd): 324 326 """Confirm that two models produce the same parameters""" 325 327 fst = load_model(fst) 326 328 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 332 332 fst = [[x for x in p.name if x == x.lower()] for p in fst.info.parameters.kernel_parameters] 333 333 snd = [[x for x in p.name if x == x.lower()] for p in snd.info.parameters.kernel_parameters] 334 334 assert sorted(fst) == sorted(snd), "{} != {}".format(fst, snd) 335 335 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( 342 338 "cylinder+sphere", 343 339 "sphere+cylinder") 344 yield build_test(340 test_models( 345 341 "cylinder*sphere", 346 342 "sphere*cylinder") 347 yield build_test(343 test_models( 348 344 "cylinder@hardsphere*sphere", 349 345 "sphere*cylinder@hardsphere") 350 yield build_test(346 test_models( 351 347 "barbell+sphere*cylinder@hardsphere", 352 348 "sphere*cylinder@hardsphere+barbell") 353 yield build_test(349 test_models( 354 350 "barbell+cylinder@hardsphere*sphere", 355 351 "cylinder@hardsphere*sphere+barbell") 356 yield build_test(352 test_models( 357 353 "barbell+sphere*cylinder@hardsphere", 358 354 "barbell+cylinder@hardsphere*sphere") 359 yield build_test(355 test_models( 360 356 "sphere*cylinder@hardsphere+barbell", 361 357 "cylinder@hardsphere*sphere+barbell") 362 yield build_test(358 test_models( 363 359 "barbell+sphere*cylinder@hardsphere", 364 360 "cylinder@hardsphere*sphere+barbell") 365 yield build_test(361 test_models( 366 362 "barbell+cylinder@hardsphere*sphere", 367 363 "sphere*cylinder@hardsphere+barbell") 368 364 369 def test_composite():370 # type: () -> None371 """Check that model load works"""372 365 #Test the the model produces the parameters that we would expect 373 366 model = load_model("cylinder@hardsphere*sphere") -
sasmodels/model_test.py
ra69d8cd r2d81cfe 123 123 124 124 if is_py: # kernel implemented in python 125 test_name = " %s-python"%model_name125 test_name = "Model: %s, Kernel: python"%model_name 126 126 test_method_name = "test_%s_python" % model_info.id 127 127 test = ModelTestCase(test_name, model_info, … … 135 135 # test using dll if desired 136 136 if 'dll' in loaders or not core.HAVE_OPENCL: 137 test_name = " %s-dll"%model_name137 test_name = "Model: %s, Kernel: dll"%model_name 138 138 test_method_name = "test_%s_dll" % model_info.id 139 139 test = ModelTestCase(test_name, model_info, … … 146 146 # test using opencl if desired and available 147 147 if 'opencl' in loaders and core.HAVE_OPENCL: 148 test_name = " %s-opencl"%model_name148 test_name = "Model: %s, Kernel: OpenCL"%model_name 149 149 test_method_name = "test_%s_opencl" % model_info.id 150 150 # Using dtype=None so that the models that are only … … 469 469 loaders = ['opencl', 'dll'] if core.HAVE_OPENCL else ['dll'] 470 470 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 476 480 477 481 -
sasmodels/sasview_model.py
ra69d8cd r2d81cfe 859 859 # type: () -> None 860 860 """ 861 Load and run cylinder model as sas-models-CylinderModel861 Load and run cylinder model from sas.models.CylinderModel 862 862 """ 863 863 if not SUPPORT_OLD_STYLE_PLUGINS:
Note: See TracChangeset
for help on using the changeset viewer.