Changeset 5062bbf in sasview for sansview/plugins
- Timestamp:
- Jun 7, 2010 10:26:43 AM (15 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:
- b94945d
- Parents:
- 79ac6f8
- Location:
- sansview/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/plugins/testmodel.py
rf99a6b1 r5062bbf 1 1 """ 2 2 Test plug-in model 3 3 """ 4 4 from sans.models.pluginmodel import Model1DPlugin … … 9 9 # Your model HAS to be called Model 10 10 class Model(Model1DPlugin): 11 """ Class that evaluates a cos(x) model. 11 """ 12 Class that evaluates a cos(x) model. 12 13 """ 13 14 … … 16 17 17 18 def __init__(self): 18 """ Initialization """ 19 """ 20 Initialization 21 """ 19 22 Model1DPlugin.__init__(self, name= self.name) 20 23 … … 33 36 34 37 def function(self, x = 0.0): 35 """ Evaluate the model 36 @param x: input x 37 @return: function value 38 """ 39 Evaluate the model 40 41 :param x: input x 42 43 :return: function value 44 38 45 """ 39 46 return self.params['A']+self.params['B']*math.cos(2.0*x)+self.params['C']*math.sin(2.0*x) -
sansview/plugins/testmodel_2.py
raaea3714 r5062bbf 1 1 """ 2 2 Test plug-in model 3 3 """ 4 4 from sans.models.pluginmodel import Model1DPlugin ##Do not change this line!!! … … 8 8 # Your model HAS to be called Model 9 9 class Model(Model1DPlugin): ##Do not change this line!!! 10 """ Class that evaluates a ploynomial model. 10 """ 11 Class that evaluates a ploynomial model. 11 12 """ 12 13 … … 15 16 16 17 def __init__(self): ##Do not change this line!!! 17 """ Initialization """ 18 """ 19 Initialization 20 """ 18 21 Model1DPlugin.__init__(self, name= self.name) ##Do not change this line!!! 19 22 … … 41 44 42 45 def function(self, x = 0.0): ##Do not change this line!!! 43 """ Evaluate the model 44 @param x: input x 45 @return: function value 46 """ 47 Evaluate the model 48 49 :param x: input x 50 51 :return: function value 52 46 53 """ 47 54 ##You can modify from HERE to the END of this function!!!
Note: See TracChangeset
for help on using the changeset viewer.