Changeset a69d8cd in sasmodels
- Timestamp:
- Jan 26, 2018 9:13:22 PM (7 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- ecb485c
- Parents:
- 49284e1
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
.travis.yml
r2d09df1 ra69d8cd 37 37 - conda update --yes conda 38 38 - conda info -a 39 - conda install --yes python=$PY numpy scipy cython mako cffi 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" 40 41 install: 41 42 - pip install bumps … … 43 44 script: 44 45 - python --version 45 - python -m sasmodels.model_test -v dll all 46 #- python -m sasmodels.model_test -v dll all 47 - python -m pytest -v 46 48 before_deploy: 47 49 - echo -e "Host danse.chem.utk.edu\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config -
appveyor.yml
rfefc185 ra69d8cd 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 - cmd: conda install --yes --quiet numpy scipy 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" 71 72 # 2018-01-19 PAK: skipping pyopencl; this would be needed for deploy but maybe not for test 72 73 #- cmd: conda install --yes --channel conda-forge pyopencl … … 86 87 #- "%CMD_IN_ENV% python -m sasmodels.model_test dll all" 87 88 #- cmd /E:ON /V:ON /C obvci_appveyor_python_build_env.cmd python -m sasmoels.model_test dll all 88 - python -m sasmodels.model_test dll all 89 #- python -m sasmodels.model_test dll all 90 #- nosetests -v sasmodels/*.py 91 - python -m pytest -v -
sasmodels/convert.py
r2d81cfe ra69d8cd 633 633 def test_backward_forward(): 634 634 from .core import list_models 635 L = lambda name: _check_one(name, seed=1) 635 636 for name in list_models('all'): 636 L = lambda: _check_one(name, seed=1) 637 L.description = name 638 yield L 637 yield L, name -
sasmodels/core.py
r7a516d0 ra69d8cd 320 320 print("\n".join(list_models(kind))) 321 321 322 def test_load(): 323 # type: () -> None 324 """Check that model load works""" 322 def test_composite_order(): 325 323 def test_models(fst, snd): 326 324 """Confirm that two models produce the same parameters""" 327 325 fst = load_model(fst) 328 326 snd = load_model(snd) 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 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. 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 337 test_models( 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( 338 342 "cylinder+sphere", 339 343 "sphere+cylinder") 340 test_models(344 yield build_test( 341 345 "cylinder*sphere", 342 346 "sphere*cylinder") 343 test_models(347 yield build_test( 344 348 "cylinder@hardsphere*sphere", 345 349 "sphere*cylinder@hardsphere") 346 test_models(350 yield build_test( 347 351 "barbell+sphere*cylinder@hardsphere", 348 352 "sphere*cylinder@hardsphere+barbell") 349 test_models(353 yield build_test( 350 354 "barbell+cylinder@hardsphere*sphere", 351 355 "cylinder@hardsphere*sphere+barbell") 352 test_models(356 yield build_test( 353 357 "barbell+sphere*cylinder@hardsphere", 354 358 "barbell+cylinder@hardsphere*sphere") 355 test_models(359 yield build_test( 356 360 "sphere*cylinder@hardsphere+barbell", 357 361 "cylinder@hardsphere*sphere+barbell") 358 test_models(362 yield build_test( 359 363 "barbell+sphere*cylinder@hardsphere", 360 364 "cylinder@hardsphere*sphere+barbell") 361 test_models(365 yield build_test( 362 366 "barbell+cylinder@hardsphere*sphere", 363 367 "sphere*cylinder@hardsphere+barbell") 364 368 369 def test_composite(): 370 # type: () -> None 371 """Check that model load works""" 365 372 #Test the the model produces the parameters that we would expect 366 373 model = load_model("cylinder@hardsphere*sphere") -
sasmodels/model_test.py
r2d81cfe ra69d8cd 123 123 124 124 if is_py: # kernel implemented in python 125 test_name = " Model: %s, Kernel:python"%model_name125 test_name = "%s-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 = " Model: %s, Kernel:dll"%model_name137 test_name = "%s-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 = " Model: %s, Kernel: OpenCL"%model_name148 test_name = "%s-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_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 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 480 476 481 477 -
sasmodels/sasview_model.py
r2d81cfe ra69d8cd 859 859 # type: () -> None 860 860 """ 861 Load and run cylinder model from sas.models.CylinderModel861 Load and run cylinder model as sas-models-CylinderModel 862 862 """ 863 863 if not SUPPORT_OLD_STYLE_PLUGINS:
Note: See TracChangeset
for help on using the changeset viewer.