Changeset 96656e3 in sasview for sansmodels/src/sans/models/SphereModel.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/SphereModel.py
r35aface r96656e3 28 28 from sans_extension.c_models import CSphereModel 29 29 import copy 30 30 31 def create_SphereModel(): 32 obj = SphereModel() 33 #CSphereModel.__init__(obj) is called by SphereModel constructor 34 return obj 35 31 36 class SphereModel(CSphereModel, BaseComponent): 32 37 """ … … 49 54 # Initialize BaseComponent first, then sphere 50 55 BaseComponent.__init__(self) 56 #apply(CSphereModel.__init__, (self,)) 51 57 CSphereModel.__init__(self) 52 58 … … 75 81 76 82 ## non-fittable parameters 77 self.non_fittable =[]83 self.non_fittable = [] 78 84 79 85 ## parameters with orientation 80 self.orientation_params = []86 self.orientation_params = [] 81 87 88 def __reduce_ex__(self, proto): 89 """ 90 Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 91 c model. 92 """ 93 return (create_SphereModel,tuple()) 94 82 95 def clone(self): 83 96 """ Return a identical copy of self """ 84 97 return self._clone(SphereModel()) 85 86 def __getstate__(self):87 """88 return object state for pickling and copying89 """90 model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}91 92 return self.__dict__, model_state93 94 def __setstate__(self, state):95 """96 create object from pickled state97 98 :param state: the state of the current model99 100 """101 102 self.__dict__, model_state = state103 self.params = model_state['params']104 self.dispersion = model_state['dispersion']105 self.log = model_state['log']106 98 107 99
Note: See TracChangeset
for help on using the changeset viewer.