Changeset 96656e3 in sasview for sansmodels/src/sans/models/TriaxialEllipsoidModel.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/TriaxialEllipsoidModel.py
r4628e31 r96656e3 28 28 from sans_extension.c_models import CTriaxialEllipsoidModel 29 29 import copy 30 30 31 def create_TriaxialEllipsoidModel(): 32 obj = TriaxialEllipsoidModel() 33 #CTriaxialEllipsoidModel.__init__(obj) is called by TriaxialEllipsoidModel constructor 34 return obj 35 31 36 class TriaxialEllipsoidModel(CTriaxialEllipsoidModel, BaseComponent): 32 37 """ … … 54 59 # Initialize BaseComponent first, then sphere 55 60 BaseComponent.__init__(self) 61 #apply(CTriaxialEllipsoidModel.__init__, (self,)) 56 62 CTriaxialEllipsoidModel.__init__(self) 57 63 … … 80 86 81 87 ## non-fittable parameters 82 self.non_fittable =[]88 self.non_fittable = [] 83 89 84 90 ## parameters with orientation 85 self.orientation_params = ['axis_psi', 'axis_phi', 'axis_theta', 'axis_psi.width', 'axis_phi.width', 'axis_theta.width']91 self.orientation_params = ['axis_psi', 'axis_phi', 'axis_theta', 'axis_psi.width', 'axis_phi.width', 'axis_theta.width'] 86 92 93 def __reduce_ex__(self, proto): 94 """ 95 Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 96 c model. 97 """ 98 return (create_TriaxialEllipsoidModel,tuple()) 99 87 100 def clone(self): 88 101 """ Return a identical copy of self """ 89 102 return self._clone(TriaxialEllipsoidModel()) 90 91 def __getstate__(self):92 """93 return object state for pickling and copying94 """95 model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}96 97 return self.__dict__, model_state98 99 def __setstate__(self, state):100 """101 create object from pickled state102 103 :param state: the state of the current model104 105 """106 107 self.__dict__, model_state = state108 self.params = model_state['params']109 self.dispersion = model_state['dispersion']110 self.log = model_state['log']111 103 112 104
Note: See TracChangeset
for help on using the changeset viewer.