Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/sasview_model.py

    r64614ad ra38b065  
    1616import logging 
    1717from os.path import basename, splitext 
     18import thread 
    1819 
    1920import numpy as np  # type: ignore 
     
    3940    pass 
    4041 
     42calculation_lock = thread.allocate_lock() 
     43 
    4144SUPPORT_OLD_STYLE_PLUGINS = True 
    4245 
     
    5760    import sas.models 
    5861    from sasmodels.conversion_table import CONVERSION_TABLE 
    59     for new_name, conversion in CONVERSION_TABLE.items(): 
     62    for new_name, conversion in CONVERSION_TABLE.get((3,1,2), {}).items(): 
    6063        # CoreShellEllipsoidModel => core_shell_ellipsoid:1 
    6164        new_name = new_name.split(':')[0] 
    62         old_name = conversion[0] 
     65        old_name = conversion[0] if len(conversion) < 3 else conversion[2] 
    6366        module_attrs = {old_name: find_model(new_name)} 
    6467        ConstructedModule = type(old_name, (), module_attrs) 
     
    605608        to the card for each evaluation. 
    606609        """ 
     610        ## uncomment the following when trying to debug the uncoordinated calls 
     611        ## to calculate_Iq 
     612        #if calculation_lock.locked(): 
     613        #    logging.info("calculation waiting for another thread to complete") 
     614        #    logging.info("\n".join(traceback.format_stack())) 
     615 
     616        with calculation_lock: 
     617            return self._calculate_Iq(qx, qy) 
     618 
     619    def _calculate_Iq(self, qx, qy=None): 
    607620        #core.HAVE_OPENCL = False 
    608621        if self._model is None: 
Note: See TracChangeset for help on using the changeset viewer.