Ignore:
Timestamp:
Jan 6, 2011 12:42:14 PM (14 years ago)
Author:
Jae Cho <jhjcho@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
3be060d
Parents:
b9b9930
Message:

update models due to changes of template

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/SphereSLDModel.py

    r4b3d25b r96656e3  
    2828from sans_extension.c_models import CSphereSLDModel 
    2929import copy     
    30      
     30 
     31def create_SphereSLDModel(): 
     32    obj = SphereSLDModel() 
     33    #CSphereSLDModel.__init__(obj) is called by SphereSLDModel constructor 
     34    return obj 
     35 
    3136class SphereSLDModel(CSphereSLDModel, BaseComponent): 
    3237    """  
     
    104109        # Initialize BaseComponent first, then sphere 
    105110        BaseComponent.__init__(self) 
     111        #apply(CSphereSLDModel.__init__, (self,))  
    106112        CSphereSLDModel.__init__(self) 
    107113         
     
    195201         
    196202        ## non-fittable parameters 
    197         self.non_fittable=['n_shells', 'func_inter0', 'func_inter1', 'func_inter2', 'func_inter3', 'func_inter4', 'func_inter5', 'func_inter5', 'func_inter7', 'func_inter8', 'func_inter9', 'func_inter10'] 
     203        self.non_fittable = ['n_shells', 'func_inter0', 'func_inter1', 'func_inter2', 'func_inter3', 'func_inter4', 'func_inter5', 'func_inter5', 'func_inter7', 'func_inter8', 'func_inter9', 'func_inter10'] 
    198204         
    199205        ## parameters with orientation 
    200         self.orientation_params =[] 
    201     
     206        self.orientation_params = [] 
     207    
     208    def __reduce_ex__(self, proto): 
     209        """ 
     210        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of  
     211        c model. 
     212        """ 
     213        return (create_SphereSLDModel,tuple()) 
     214         
    202215    def clone(self): 
    203216        """ Return a identical copy of self """ 
    204217        return self._clone(SphereSLDModel())    
    205          
    206     def __getstate__(self): 
    207         """ 
    208         return object state for pickling and copying 
    209         """ 
    210         model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log} 
    211          
    212         return self.__dict__, model_state 
    213          
    214     def __setstate__(self, state): 
    215         """ 
    216         create object from pickled state 
    217          
    218         :param state: the state of the current model 
    219          
    220         """ 
    221          
    222         self.__dict__, model_state = state 
    223         self.params = model_state['params'] 
    224         self.dispersion = model_state['dispersion'] 
    225         self.log = model_state['log'] 
    226218         
    227219    
Note: See TracChangeset for help on using the changeset viewer.