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

    r4628e31 r96656e3  
    2828from sans_extension.c_models import CSCCrystalModel 
    2929import copy     
    30      
     30 
     31def create_SCCrystalModel(): 
     32    obj = SCCrystalModel() 
     33    #CSCCrystalModel.__init__(obj) is called by SCCrystalModel constructor 
     34    return obj 
     35 
    3136class SCCrystalModel(CSCCrystalModel, BaseComponent): 
    3237    """  
     
    5459        # Initialize BaseComponent first, then sphere 
    5560        BaseComponent.__init__(self) 
     61        #apply(CSCCrystalModel.__init__, (self,))  
    5662        CSCCrystalModel.__init__(self) 
    5763         
     
    95101         
    96102        ## non-fittable parameters 
    97         self.non_fittable=[] 
     103        self.non_fittable = [] 
    98104         
    99105        ## parameters with orientation 
    100         self.orientation_params =['phi', 'psi', 'theta', 'phi.width', 'psi.width', 'theta.width'] 
     106        self.orientation_params = ['phi', 'psi', 'theta', 'phi.width', 'psi.width', 'theta.width'] 
    101107    
     108    def __reduce_ex__(self, proto): 
     109        """ 
     110        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of  
     111        c model. 
     112        """ 
     113        return (create_SCCrystalModel,tuple()) 
     114         
    102115    def clone(self): 
    103116        """ Return a identical copy of self """ 
    104117        return self._clone(SCCrystalModel())    
    105          
    106     def __getstate__(self): 
    107         """ 
    108         return object state for pickling and copying 
    109         """ 
    110         model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log} 
    111          
    112         return self.__dict__, model_state 
    113          
    114     def __setstate__(self, state): 
    115         """ 
    116         create object from pickled state 
    117          
    118         :param state: the state of the current model 
    119          
    120         """ 
    121          
    122         self.__dict__, model_state = state 
    123         self.params = model_state['params'] 
    124         self.dispersion = model_state['dispersion'] 
    125         self.log = model_state['log'] 
    126118         
    127119    
Note: See TracChangeset for help on using the changeset viewer.