Changeset 86e8e66 in sasmodels for sasmodels/sasview_model.py
- Timestamp:
- Dec 20, 2016 12:08:41 PM (7 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:
- 0795293
- Parents:
- 54fb5d8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/sasview_model.py
r01ecc31 r86e8e66 57 57 import sas.models 58 58 from sasmodels.conversion_table import CONVERSION_TABLE 59 for version, _ in sorted(CONVERSION_TABLE.iteritems()): 60 for new_name, conversion in CONVERSION_TABLE.get(version).items(): 61 # CoreShellEllipsoidModel => core_shell_ellipsoid:1 62 new_name = new_name.split(':')[0] 63 old_name = conversion[0] 64 module_attrs = {old_name: find_model(new_name)} 65 ConstructedModule = type(old_name, (), module_attrs) 66 old_path = 'sas.models.' + old_name 67 setattr(sas.models, old_path, ConstructedModule) 68 sys.modules[old_path] = ConstructedModule 59 for new_name, conversion in CONVERSION_TABLE.get((3,1,2)).items(): 60 # CoreShellEllipsoidModel => core_shell_ellipsoid:1 61 new_name = new_name.split(':')[0] 62 old_name = conversion[0] 63 module_attrs = {old_name: find_model(new_name)} 64 ConstructedModule = type(old_name, (), module_attrs) 65 old_path = 'sas.models.' + old_name 66 setattr(sas.models, old_path, ConstructedModule) 67 sys.modules[old_path] = ConstructedModule 69 68 70 69
Note: See TracChangeset
for help on using the changeset viewer.