Ignore:
Timestamp:
Jan 6, 2011 2: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/Gaussian.py

    r35aface r96656e3  
    2828from sans_extension.c_models import CGaussian 
    2929import copy     
    30      
     30 
     31def create_Gaussian(): 
     32    obj = Gaussian() 
     33    #CGaussian.__init__(obj) is called by Gaussian constructor 
     34    return obj 
     35 
    3136class Gaussian(CGaussian, BaseComponent): 
    3237    """  
     
    4752        # Initialize BaseComponent first, then sphere 
    4853        BaseComponent.__init__(self) 
     54        #apply(CGaussian.__init__, (self,))  
    4955        CGaussian.__init__(self) 
    5056         
     
    6470         
    6571        ## non-fittable parameters 
    66         self.non_fittable=[] 
     72        self.non_fittable = [] 
    6773         
    6874        ## parameters with orientation 
    69         self.orientation_params =[] 
     75        self.orientation_params = [] 
    7076    
     77    def __reduce_ex__(self, proto): 
     78        """ 
     79        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of  
     80        c model. 
     81        """ 
     82        return (create_Gaussian,tuple()) 
     83         
    7184    def clone(self): 
    7285        """ Return a identical copy of self """ 
    7386        return self._clone(Gaussian())    
    74          
    75     def __getstate__(self): 
    76         """ 
    77         return object state for pickling and copying 
    78         """ 
    79         model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log} 
    80          
    81         return self.__dict__, model_state 
    82          
    83     def __setstate__(self, state): 
    84         """ 
    85         create object from pickled state 
    86          
    87         :param state: the state of the current model 
    88          
    89         """ 
    90          
    91         self.__dict__, model_state = state 
    92         self.params = model_state['params'] 
    93         self.dispersion = model_state['dispersion'] 
    94         self.log = model_state['log'] 
    9587         
    9688    
Note: See TracChangeset for help on using the changeset viewer.