Changeset 79ac6f8 in sasview for sansmodels/src/sans/models/BaseModel.py
- Timestamp:
- Jun 4, 2010 5:04:49 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:
- 5062bbf
- Parents:
- 7116b6e0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/BaseModel.py
rf9bf661 r79ac6f8 1 1 #!/usr/bin/env python 2 """3 This software was developed by the University of Tennessee as part of the4 Distributed Data Analysis of Neutron Scattering Experiments (DANSE)5 project funded by the US National Science Foundation.6 2 7 If you use DANSE applications to do scientific research that leads to 8 publication, we ask that you acknowledge the use of the software with the 9 following sentence: 10 11 "This work benefited from DANSE software developed under NSF award DMR-0520547." 12 13 copyright 2008, University of Tennessee 14 """ 3 ############################################################################ 4 #This software was developed by the University of Tennessee as part of the 5 #Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 6 #project funded by the US National Science Foundation. 7 # 8 #If you use DANSE applications to do scientific research that leads to 9 #publication, we ask that you acknowledge the use of the software with the 10 #following sentence: 11 # 12 #"This work benefited from DANSE software developed 13 # under NSF award DMR-0520547." 14 # 15 #copyright 2008, University of Tennessee 16 ############################################################################# 15 17 16 18 """ 17 Provide base functionality for all model components 19 Provide base functionality for all model components 20 21 The following has changed since going from BaseComponent to BaseModel: 22 23 - Arithmetic operation between models is no longer supported. 24 It was found to be of little use and not very flexible. 18 25 19 The following has changed since going from BaseComponent to BaseModel: 20 21 - Arithmetic operation between models is no longer supported. 22 It was found to be of little use and not very flexible. 23 24 - Parameters are now stored as Parameter object to provide 25 the necessary extra information like limits, units, etc... 26 - Parameters are now stored as Parameter object to provide 27 the necessary extra information like limits, units, etc... 26 28 """ 27 29 … … 31 33 class Parameter(object): 32 34 """ 33 35 Parameter class 34 36 """ 35 37 name = '' … … 44 46 class ParameterProperty(object): 45 47 """ 46 47 48 Parameter property allow direct access to 49 the parameter values 48 50 """ 49 51 def __init__(self,name,**kw): … … 62 64 class BaseModel(ModelAdaptor): 63 65 """ 64 66 Basic model component 65 67 """ 66 68 ## Name of the model … … 77 79 def __call__(self, x=0): 78 80 """ 79 Evaluate the model. Equivalent to runXY(x) 80 @param x: input value 81 @return: value of the model 81 Evaluate the model. Equivalent to runXY(x) 82 83 :param x: input value 84 85 :return: value of the model 86 82 87 """ 83 88 return self.runXY(x) … … 89 94 obj.params = copy.deepcopy(self.params) 90 95 obj.details = copy.deepcopy(self.details) 91 92 96 return obj 93 97 94 98 def setParam(self, name, value): 95 99 """ 96 Set the value of a model parameter 100 Set the value of a model parameter 101 102 :param name: name of the parameter 103 :param value: value of the parameter 97 104 98 @param name: name of the parameter99 @param value: value of the parameter100 105 """ 101 106 # Lowercase for case insensitivity … … 108 113 def getParam(self, name): 109 114 """ 110 115 Set the value of a model parameter 111 116 112 @param name: name of the parameter 113 @param value: value of the parameter 117 :param name: name of the parameter 118 :param value: value of the parameter 119 114 120 """ 115 121 # Lowercase for case insensitivity … … 119 125 def getParamList(self): 120 126 """ 121 127 Return a list of all available parameters for the model 122 128 """ 123 129 param_list = self.params.keys()
Note: See TracChangeset
for help on using the changeset viewer.