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/FuzzySphereModel.py

    r35aface r96656e3  
    2828from sans_extension.c_models import CFuzzySphereModel 
    2929import copy     
    30      
     30 
     31def create_FuzzySphereModel(): 
     32    obj = FuzzySphereModel() 
     33    #CFuzzySphereModel.__init__(obj) is called by FuzzySphereModel constructor 
     34    return obj 
     35 
    3136class FuzzySphereModel(CFuzzySphereModel, BaseComponent): 
    3237    """  
     
    5055        # Initialize BaseComponent first, then sphere 
    5156        BaseComponent.__init__(self) 
     57        #apply(CFuzzySphereModel.__init__, (self,))  
    5258        CFuzzySphereModel.__init__(self) 
    5359         
     
    7985         
    8086        ## non-fittable parameters 
    81         self.non_fittable=[] 
     87        self.non_fittable = [] 
    8288         
    8389        ## parameters with orientation 
    84         self.orientation_params =[] 
     90        self.orientation_params = [] 
    8591    
     92    def __reduce_ex__(self, proto): 
     93        """ 
     94        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of  
     95        c model. 
     96        """ 
     97        return (create_FuzzySphereModel,tuple()) 
     98         
    8699    def clone(self): 
    87100        """ Return a identical copy of self """ 
    88101        return self._clone(FuzzySphereModel())    
    89          
    90     def __getstate__(self): 
    91         """ 
    92         return object state for pickling and copying 
    93         """ 
    94         model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log} 
    95          
    96         return self.__dict__, model_state 
    97          
    98     def __setstate__(self, state): 
    99         """ 
    100         create object from pickled state 
    101          
    102         :param state: the state of the current model 
    103          
    104         """ 
    105          
    106         self.__dict__, model_state = state 
    107         self.params = model_state['params'] 
    108         self.dispersion = model_state['dispersion'] 
    109         self.log = model_state['log'] 
    110102         
    111103    
Note: See TracChangeset for help on using the changeset viewer.