Changeset fcd7bbd in sasmodels for sasmodels/product.py
- Timestamp:
- Mar 16, 2016 9:27:13 PM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 70bbb74
- Parents:
- 63776d3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/product.py
r35b4c47 rfcd7bbd 28 28 s_id, s_name, s_pars = s_info['id'], s_info['name'], s_info['parameters'] 29 29 # We require models to start with scale and background 30 assert s_pars[SCALE] [0]== 'scale'31 assert s_pars[BACKGROUND] [0]== 'background'30 assert s_pars[SCALE].name == 'scale' 31 assert s_pars[BACKGROUND].name == 'background' 32 32 # We require structure factors to start with effect radius and volfraction 33 assert s_pars[EFFECT_RADIUS] [0]== 'effect_radius'34 assert s_pars[VOLFRACTION] [0]== 'volfraction'33 assert s_pars[EFFECT_RADIUS].name == 'effect_radius' 34 assert s_pars[VOLFRACTION].name == 'volfraction' 35 35 # Combine the parameter sets. We are skipping the first three 36 36 # parameters of S since scale, background are defined in P and … … 38 38 pars = p_pars + s_pars[3:] 39 39 # check for duplicates; can't use assertion since they may never be checked 40 if len(set(p [0]for p in pars)) != len(pars):40 if len(set(p.name for p in pars)) != len(pars): 41 41 raise ValueError("Duplicate parameters in %s and %s"%(p_id)) 42 42 # For comparison with sasview, determine the old parameters. … … 52 52 model_info['title'] = 'Product of %s and structure factor %s'%(p_name, s_name) 53 53 model_info['description'] = model_info['title'] 54 model_info['docs'] = model_info['title'] 54 55 model_info['category'] = "custom" 55 56 model_info['parameters'] = pars 56 # Remember the component info blocks so we can build the product model 57 model_info['composition'] = ('product', [p_info, s_info]) 57 #model_info['single'] = p_info['single'] and s_info['single'] 58 model_info['structure_factor'] = False 59 model_info['variant_info'] = None 60 #model_info['tests'] = [] 61 #model_info['source'] = [] 62 # Iq, Iqxy, form_volume, ER, VR and sesans 58 63 model_info['oldname'] = oldname 59 64 model_info['oldpars'] = oldpars 65 model_info['composition'] = ('product', [p_info, s_info]) 60 66 process_parameters(model_info) 61 67 return model_info
Note: See TracChangeset
for help on using the changeset viewer.