Changeset 6140894 in sasmodels
 Timestamp:
 Mar 28, 2019 1:19:16 PM (11 months ago)
 Branches:
 master, ticket1257vesicleproduct, ticket_1156, ticket_822_more_unit_tests
 Children:
 3709366
 Parents:
 d8e81f7
 Location:
 sasmodels
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

sasmodels/model_test.py
rd8e81f7 r6140894 247 247 platform=self.platform) 248 248 # run the tests 249 <<<<<<< HEAD250 249 #self.info = ps_model.info 251 250 #print("SELF.INFO PARAMS!!!",[p.id for p in self.info.parameters.call_parameters]) 252 251 #print("PS MODEL PARAMETERS:",[p.id for p in ps_model.info.parameters.call_parameters]) 253 =======254 >>>>>>> 2ed7de04217c5103c5fd8d7c14e29e04923269d5255 252 results.append(self.run_one(ps_model, ps_test)) 256 253 
sasmodels/models/sphere.py
rb39bf3b r6140894 75 75 ["sld_solvent", "1e6/Ang^2", 6, [inf, inf], "sld", 76 76 "Solvent scattering length density"], 77 ["radius", "Ang", 45, [0, inf], "volume",77 ["radius", "Ang", 50, [0, inf], "volume", 78 78 "Sphere radius"], 79 79 ] … … 92 92 93 93 tests = [ 94 # [{}, 0.2, 0.726362], 95 # [{"scale": 1., "background": 0., "sld": 6., "sld_solvent": 1., 96 # "radius": 120., "radius_pd": 0.2, "radius_pd_n":45}, 97 # 0.2, 0.2288431], 98 # [{"radius": 120., "radius_pd": 0.02, "radius_pd_n":45}, 99 # 0.2, 792.0646662454202, [1166737.0473152], 120.0, 7246723.820358589, 1.0], # the longer list here checks F1, F2, R_eff, volume, volume_ratio = call_Fq(kernel, pars) 100 # # But note P(Q) = F2/volume, F1 and F2 are vectors, for some reason only F2 needs square brackets 101 # # BUT what is scaling of F1 ??? At low Pd F2 ~ F1^2 ? 94 [{}, 0.2, 0.726362], # each test starts with default parameter values inside { }, unless modified. Then Q and expected value of I(Q) 95 [{"scale": 1., "background": 0., "sld": 6., "sld_solvent": 1., 96 "radius": 120., "radius_pd": 0.2, "radius_pd_n":45}, 97 0.2, 0.2288431], 98 [{"radius": 120., "radius_pd": 0.02, "radius_pd_n":45}, 99 0.2, 792.0646662454202, 1166737.0473152, 120.0, 7246723.820358589, 1.0], # the longer list here checks F1, F2, R_eff, volume, volume_ratio = call_Fq(kernel, pars) 100 # But note P(Q) = F2/volume 101 # F and F^2 are "unscaled", with for n <F F*>S(q) or for beta approx I(q) = n [<F F*> + <F><F*> (S(q)  1)] 102 # for n the number density and <.> the orientation average, and F = integral rho(r) exp(i q . r) dr. 103 # The number density is volume fraction divided by particle volume. 104 # Effectively, this leaves F = V drho form, where form is the usual 3 j1(qr)/(qr) or whatever depending on the shape. 102 105 # [{"@S": "hardsphere"}, 103 106 # 0.01, 55.881884232102124], # this is current value, not verified elsewhere yet … … 111 114 "radius": 120., "radius_pd": 0.2, "radius_pd_n":45, 112 115 "volfraction":0.2, 113 "radius_effective":45.0, # hard sphere structure factor 114 "structure_factor_mode": 1, # decoupling approximation 115 #"effective_radius_type": 1 # equivalent sphere Currently have hardwired model_test to accept radius_effective 116 # direct_model has the name & value BUT does it get passed to S(Q)??? What about volfracion, plus the many parameters used by other S(Q) ? 117 # effective_radius_type does NOT appear in the list, has it been stripped out??? 118 }, 0.01, 0.7940350343881906], 119 # [{"@S": "hardsphere", # hard sphere structure factor 120 # "structure_factor_mode": 2, #  WHY same result? 121 # "effective_radius_type": 2, "radius_effective":23.0 # 122 # }, 0.1, 0.7940350343881906] 116 "radius_effective":45.0, # uses this (check) 117 "structure_factor_mode": 1, # 0 = normal decoupling approximation, 1 = beta(Q) approx 118 "radius_effective_mode": 0 # equivalent sphere, there is only one valid mode for sphere. says this used r_eff =0 or default 50? 119 }, 0.01, 1316.2990966463444 ], 120 [{"@S": "hardsphere", 121 "radius": 120., "radius_pd": 0.2, "radius_pd_n":45, 122 "volfraction":0.2, 123 "radius_effective":50.0, # hard sphere structure factor 124 "structure_factor_mode": 1, # 0 = normal decoupling approximation, 1 = beta(Q) approx 125 "radius_effective_mode": 0 # this used r_eff =0 or default 50? 126 }, 0.01, 1324.7375636587356 ], 127 [{"@S": "hardsphere", 128 "radius": 120., "radius_pd": 0.2, "radius_pd_n":45, 129 "volfraction":0.2, 130 "radius_effective":50.0, # hard sphere structure factor 131 "structure_factor_mode": 1, # 0 = normal decoupling approximation, 1 = beta(Q) approx 132 "radius_effective_mode": 1 # this used 120 ??? 133 }, 0.01, 1579.2858949296565 ] 123 134 ] 124 135 # putting None for expected result will pass the test if there are no errors from the routine, but without any check on the value of the result
Note: See TracChangeset
for help on using the changeset viewer.