Ignore:
Timestamp:
Dec 14, 2009 8:39:21 AM (15 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
6e9976b
Parents:
7975f2b
Message:

implement set and get state

File:
1 edited

Legend:

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

    r27972c1d rfe9c19b4  
    2828class CoreShellEllipsoidModel(CCoreShellEllipsoidModel, BaseComponent): 
    2929    """ Class that evaluates a CoreShellEllipsoidModel model.  
    30         This file was auto-generated from ..\c_extensions\spheroid.h. 
    31         Refer to that file and the structure it contains 
    32         for details of the model. 
    33         List of default parameters: 
     30        This file was auto-generated from ..\c_extensions\spheroid.h. 
     31        Refer to that file and the structure it contains 
     32        for details of the model. 
     33        List of default parameters: 
    3434         scale           = 1.0  
    3535         equat_core      = 200.0 [A] 
     
    7575                prolate :  polar radius > equatorial radius""" 
    7676        
    77                 ## Parameter details [units, min, max] 
     77        ## Parameter details [units, min, max] 
    7878        self.details = {} 
    7979        self.details['scale'] = ['', None, None] 
     
    8888        self.details['axis_phi'] = ['[rad]', None, None] 
    8989 
    90                 ## fittable parameters 
     90        ## fittable parameters 
    9191        self.fixed=['equat_core.width', 'polar_core.width', 'equat_shell.width', 'polar_shell.width', 'axis_phi.width', 'axis_theta.width'] 
    9292         
     
    9797        """ Return a identical copy of self """ 
    9898        return self._clone(CoreShellEllipsoidModel())    
     99         
     100    def __getstate__(self): 
     101        """ return object state for pickling and copying """ 
     102        print "__dict__",self.__dict__ 
     103        #self.__dict__['params'] = self.params 
     104        #self.__dict__['dispersion'] = self.dispersion 
     105        #self.__dict__['log'] = self.log 
     106        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log} 
     107         
     108        return self.__dict__, model_state 
     109         
     110    def __setstate__(self, state): 
     111        """ create object from pickled state """ 
     112         
     113        self.__dict__, model_state = state 
     114        self.params = model_state['params'] 
     115        self.dispersion = model_state['dispersion'] 
     116        self.log = model_state['log'] 
     117         
    99118    
    100119    def run(self, x = 0.0): 
Note: See TracChangeset for help on using the changeset viewer.