Changeset 6d6508e in sasmodels for sasmodels/convert.py
- Timestamp:
- Apr 7, 2016 6:57:33 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:
- d2fc9a4
- Parents:
- 3707eee
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/convert.py
r8bd7b77 r6d6508e 153 153 def revert_name(model_info): 154 154 _read_conversion_table() 155 oldname, oldpars = CONVERSION_TABLE.get(model_info ['id'], [None, {}])155 oldname, oldpars = CONVERSION_TABLE.get(model_info.id, [None, {}]) 156 156 return oldname 157 157 158 158 def _get_old_pars(model_info): 159 159 _read_conversion_table() 160 oldname, oldpars = CONVERSION_TABLE.get(model_info ['id'], [None, {}])160 oldname, oldpars = CONVERSION_TABLE.get(model_info.id, [None, {}]) 161 161 return oldpars 162 162 … … 165 165 Convert model from new style parameter names to old style. 166 166 """ 167 if model_info ['composition']is not None:168 composition_type, parts = model_info ['composition']167 if model_info.composition is not None: 168 composition_type, parts = model_info.composition 169 169 if composition_type == 'product': 170 170 P, S = parts … … 180 180 181 181 # Note: update compare.constrain_pars to match 182 name = model_info ['id']183 if name in MODELS_WITHOUT_SCALE or model_info ['structure_factor']:182 name = model_info.id 183 if name in MODELS_WITHOUT_SCALE or model_info.structure_factor: 184 184 if oldpars.pop('scale', 1.0) != 1.0: 185 185 warnings.warn("parameter scale not used in sasview %s"%name) 186 if name in MODELS_WITHOUT_BACKGROUND or model_info ['structure_factor']:186 if name in MODELS_WITHOUT_BACKGROUND or model_info.structure_factor: 187 187 if oldpars.pop('background', 0.0) != 0.0: 188 188 warnings.warn("parameter background not used in sasview %s"%name) … … 225 225 Restrict parameter values to those that will match sasview. 226 226 """ 227 name = model_info ['id']227 name = model_info.id 228 228 # Note: update convert.revert_model to match 229 if name in MODELS_WITHOUT_SCALE or model_info ['structure_factor']:229 if name in MODELS_WITHOUT_SCALE or model_info.structure_factor: 230 230 pars['scale'] = 1 231 if name in MODELS_WITHOUT_BACKGROUND or model_info ['structure_factor']:231 if name in MODELS_WITHOUT_BACKGROUND or model_info.structure_factor: 232 232 pars['background'] = 0 233 233 # sasview multiplies background by structure factor
Note: See TracChangeset
for help on using the changeset viewer.