Changeset a297255 in sasmodels
- Timestamp:
- Dec 23, 2016 9:36:18 AM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 3a45c2c
- Parents:
- 0795293
- Location:
- sasmodels
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/conversion_table.py
r0795293 ra297255 28 28 29 29 CONVERSION_TABLE = { 30 (4,0,1) : {},31 (4,0,0) : {},32 30 (3,1,2) : { 33 31 "adsorbed_layer": [ -
sasmodels/convert.py
r0795293 ra297255 93 93 94 94 def _get_translation_table(model_info, version=(3,1,2)): 95 _, translation = CONVERSION_TABLE.get(version ).get(model_info.id, [None, {}])95 _, translation = CONVERSION_TABLE.get(version, {}).get(model_info.id, [None, {}]) 96 96 translation = translation.copy() 97 97 for p in model_info.parameters.kernel_parameters: … … 154 154 """ 155 155 for sasmodels_name, [sasview_name, _] in \ 156 CONVERSION_TABLE.get(version ).items():156 CONVERSION_TABLE.get(version, {}).items(): 157 157 if sasview_name == model_name: 158 158 return sasmodels_name … … 302 302 keys = sorted(CONVERSION_TABLE.keys()) 303 303 for i, version in enumerate(keys): 304 # Don't allow indices outside list 305 next_i = i + 1 306 if next_i == len(keys): 307 next_i = i 304 308 # If the save state is from a later version, skip the check 305 if model_version > version and model_version != keys[i+1]: 306 continue 307 newname = _conversion_target(name, version) 309 if model_version <= keys[next_i]: 310 newname = _conversion_target(name, version) 311 else: 312 newname = None 308 313 # If no conversion is found, move on 309 314 if newname is None: … … 315 320 # Can't use _get_translation_table since that will return the 'bare' 316 321 # version. 317 translation = CONVERSION_TABLE.get(version )[newname][1]322 translation = CONVERSION_TABLE.get(version, {})[newname][1] 318 323 else: 319 324 model_info = load_model_info(newname) -
sasmodels/sasview_model.py
r86e8e66 ra297255 57 57 import sas.models 58 58 from sasmodels.conversion_table import CONVERSION_TABLE 59 for new_name, conversion in CONVERSION_TABLE.get((3,1,2) ).items():59 for new_name, conversion in CONVERSION_TABLE.get((3,1,2), {}).items(): 60 60 # CoreShellEllipsoidModel => core_shell_ellipsoid:1 61 61 new_name = new_name.split(':')[0]
Note: See TracChangeset
for help on using the changeset viewer.