Changeset 96656e3 in sasview for sansmodels/src/sans/models/Schulz.py
- Timestamp:
- Jan 6, 2011 2:42:14 PM (14 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/Schulz.py
r35aface r96656e3 28 28 from sans_extension.c_models import CSchulz 29 29 import copy 30 30 31 def create_Schulz(): 32 obj = Schulz() 33 #CSchulz.__init__(obj) is called by Schulz constructor 34 return obj 35 31 36 class Schulz(CSchulz, BaseComponent): 32 37 """ … … 47 52 # Initialize BaseComponent first, then sphere 48 53 BaseComponent.__init__(self) 54 #apply(CSchulz.__init__, (self,)) 49 55 CSchulz.__init__(self) 50 56 … … 66 72 67 73 ## non-fittable parameters 68 self.non_fittable =[]74 self.non_fittable = [] 69 75 70 76 ## parameters with orientation 71 self.orientation_params = []77 self.orientation_params = [] 72 78 79 def __reduce_ex__(self, proto): 80 """ 81 Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 82 c model. 83 """ 84 return (create_Schulz,tuple()) 85 73 86 def clone(self): 74 87 """ Return a identical copy of self """ 75 88 return self._clone(Schulz()) 76 77 def __getstate__(self):78 """79 return object state for pickling and copying80 """81 model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}82 83 return self.__dict__, model_state84 85 def __setstate__(self, state):86 """87 create object from pickled state88 89 :param state: the state of the current model90 91 """92 93 self.__dict__, model_state = state94 self.params = model_state['params']95 self.dispersion = model_state['dispersion']96 self.log = model_state['log']97 89 98 90
Note: See TracChangeset
for help on using the changeset viewer.