Changeset 01ecc31 in sasmodels


Ignore:
Timestamp:
Dec 9, 2016 12:21:26 PM (7 years ago)
Author:
krzywon
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
54fb5d8
Parents:
16fd9e5
Message:

All old versions of models are run through in sasview_model.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/sasview_model.py

    r4b4eee1 r01ecc31  
    5757    import sas.models 
    5858    from sasmodels.conversion_table import CONVERSION_TABLE 
    59     for new_name, conversion in CONVERSION_TABLE.get('4.0.1').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 
     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 
    6869 
    6970 
Note: See TracChangeset for help on using the changeset viewer.