Changeset 81751c2 in sasmodels
- Timestamp:
- Oct 25, 2018 6:16:04 PM (6 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 869fd7b
- Parents:
- 39a06c9
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/guide/plugin.rst
r304c775 r81751c2 1035 1035 [{"radius": 120., "radius_pd": 0.2, "radius_pd_n":45}, 1036 1036 0.1, None, None, 120., None, 1.], # q, F, F^2, R_eff, V, form:shell 1037 [{"@S": "hardsphere"}, 0.1, None], 1037 1038 ] 1038 1039 … … 1056 1057 effective radius test, but include values for the first two elements, 1057 1058 $<F(q)>$ and $<F^2(q)>$. 1059 - for testing interaction between form factor and structure factor, specify 1060 the structure factor name in the parameters as *{"@S": "name", ...}* with 1061 the remaining list of parameters defined by the *P@S* product model. 1058 1062 1059 1063 .. _Test_Your_New_Model: -
sasmodels/model_test.py
r39a06c9 r81751c2 64 64 from .kernelcl import use_opencl 65 65 from .kernelcuda import use_cuda 66 from . import product 66 67 67 68 # pylint: disable=unused-import … … 214 215 ({}, [0.001, 0.01, 0.1], [None]*3), 215 216 ({}, [(0.1, 0.1)]*2, [None]*2), 216 # test that Fq will run 217 # test that Fq will run, and return R_eff, V, V_r 217 218 ({}, 0.1, None, None, None, None, None), 218 219 ] … … 221 222 if self.info.tests is not None: 222 223 tests += self.info.tests 224 S_tests = [test for test in tests if '@S' in test[0]] 225 P_tests = [test for test in tests if '@S' not in test[0]] 223 226 try: 224 227 model = build_model(self.info, dtype=self.dtype, 225 228 platform=self.platform) 226 results = [self.run_one(model, test) for test in tests] 229 results = [self.run_one(model, test) for test in P_tests] 230 for test in S_tests: 231 # pull the S model name out of the test defn 232 pars = test[0].copy() 233 s_name = pars.pop('@S') 234 ps_test = [pars] + list(test[1:]) 235 # build the P@S model 236 s_info = load_model_info(s_name) 237 ps_info = product.make_product_info(self.info, s_info) 238 ps_model = build_model(ps_info, dtype=self.dtype, 239 platform=self.platform) 240 # run the tests 241 results.append(self.run_one(ps_model, ps_test)) 242 227 243 if self.stash: 228 244 for test, target, actual in zip(tests, self.stash[0], results): -
sasmodels/models/sphere.py
r304c775 r81751c2 85 85 [{"radius": 120., "radius_pd": 0.2, "radius_pd_n":45}, 86 86 0.1, None, None, 120., None, 1.0], 87 [{"@S": "hardsphere"}, 0.1, None], 87 88 ]
Note: See TracChangeset
for help on using the changeset viewer.