Changeset 988130c6 in sasview for sansmodels


Ignore:
Timestamp:
Dec 20, 2008 2:32:46 PM (16 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
2e10b70
Parents:
08b9c6c8
Message:

self.fixed field added in models but need to change wrapper generator

Location:
sansmodels/src/sans/models
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/BEPolyelectrolyte.py

    r96672c0 r988130c6  
    7272        self.details['c']    = ['mol/L', None, None] 
    7373        self.details['background'] = ['cm-1', None, None] 
    74         
     74        #list of parameter that cannot be fitted 
     75        self.fixed= [] 
    7576                
    7677    def _BEPoly(self, x): 
  • sansmodels/src/sans/models/BaseComponent.py

    r5f89fb8 r988130c6  
    66# imports    
    77import copy 
    8     
     8#TO DO: that about a way to make the parameter 
     9#is self return if it is fittable or not   
    910class BaseComponent: 
    1011    """  
     
    2930        #of the given model, exception or possible use 
    3031        self.description='' 
     32        #list of parameter that cannot be fitted 
     33        self.fixed= [] 
    3134            
    3235    def __str__(self): 
     
    3538        """ 
    3639        return self.name 
     40    
     41    def is_fittable(self, par_name): 
     42        return par_name.lower() not in self.fixed 
     43        #For the future 
     44        #return self.params['par_name'].is_fittable() 
    3745    
    3846    def run(self, x): return NotImplemented 
  • sansmodels/src/sans/models/Constant.py

    r96672c0 r988130c6  
    2525        self.details['value'] = ['', None, None] 
    2626        self.params['value'] = 1.0 
    27     
     27        #list of parameter that cannot be fitted 
     28        self.fixed= [] 
    2829    def clone(self): 
    2930        """ Return a identical copy of self """ 
  • sansmodels/src/sans/models/CoreShellCylinderModel.py

    r95986b5 r988130c6  
    8484        self.details['axis_theta'] = ['rad', None, None] 
    8585        self.details['axis_phi'] = ['rad', None, None] 
    86  
     86        # fixed paramaters 
     87        self.fixed=['axis_phi.npts','axis_phi.nsigmas', 
     88                                    'axis_theta.npts','axis_theta.nsigmas', 
     89                                    'length.npts','length.nsigmas', 
     90                                    'radius.npts','radius.nsigmas', 
     91                                    'thickness.npts','thickness.nsigmas' ] 
    8792    
    8893    def clone(self): 
  • sansmodels/src/sans/models/CoreShellModel.py

    r95986b5 r988130c6  
    6161        self.details['solvent_sld'] = ['A-2', None, None] 
    6262        self.details['background'] = ['cm-1', None, None] 
    63  
     63         
     64        self.fixed = ['radius.npts','radius.nsigmas','thickness.npts','thickness.nsigmas'] 
    6465    
    6566    def clone(self): 
  • sansmodels/src/sans/models/CylinderModel.py

    r95986b5 r988130c6  
    7070        self.details['cyl_theta'] = ['rad', None, None] 
    7171        self.details['cyl_phi'] = ['rad', None, None] 
    72  
     72        # fixed parameters 
     73        self.fixed = ['cyl_phi.npts','cyl_phi.nsigmas','cyl_theta.npts','cyl_theta.nsigmas', 
     74                                          'length.npts','length.nsigmas','radius.npts','radius.nsigmas']  
    7375    
    7476    def clone(self): 
  • sansmodels/src/sans/models/DABModel.py

    r753552d r988130c6  
    4646        self.details['scale']             = ['', None, None] 
    4747        self.details['background']        = ['', None, None] 
    48                 
     48        #list of parameter that cannot be fitted 
     49        self.fixed= []       
    4950    def _DAB(self, x): 
    5051        """ 
  • sansmodels/src/sans/models/DebyeModel.py

    r96672c0 r988130c6  
    5151        self.details['scale']      = ['', None, None] 
    5252        self.details['background'] = ['', None, None] 
    53                 
     53        #list of parameter that cannot be fitted 
     54        self.fixed= []       
    5455    def _debye(self, x): 
    5556        """ 
  • sansmodels/src/sans/models/DisperseModel.py

    r5f89fb8 r988130c6  
    4141        self.model = model 
    4242        self.description='' 
     43        #list of parameter that cannot be fitted 
     44        self.fixed= [] 
    4345    def clone(self): 
    4446        """ Return a identical copy of self """ 
  • sansmodels/src/sans/models/EllipsoidModel.py

    r95986b5 r988130c6  
    6969        self.details['axis_theta'] = ['rad', None, None] 
    7070        self.details['axis_phi'] = ['rad', None, None] 
    71  
     71        # fixed paramaters 
     72        self.fixed=['axis_phi.npts','axis_phi.nsigmas', 
     73                                    'axis_theta.npts','axis_theta.nsigmas', 
     74                                    'radius_a.npts','radius_a.nsigmas', 
     75                                    'radius_b.npts','radius_b.nsigmas' ] 
    7276    
    7377    def clone(self): 
  • sansmodels/src/sans/models/EllipticalCylinderModel.py

    r95986b5 r988130c6  
    6565        self.details['cyl_phi'] = ['rad', None, None] 
    6666        self.details['cyl_psi'] = ['rad', None, None] 
    67  
     67        # fixed paramaters 
     68        self.fixed=['cyl_phi.npts','cyl_phi.nsigmas', 
     69                                    'cyl_psi.npts','cyl_phi.nsigmas', 
     70                                    'cyl_theta.npts','cyl_theta.nsigmas', 
     71                                    'length.npts','length.nsigmas', 
     72                                    'r_minor.npts','r_miror.nsigmas', 
     73                                    'r_ratio.npts','r_ratio.nsigmas' ] 
    6874    
    6975    def clone(self): 
  • sansmodels/src/sans/models/Gaussian.py

    r95986b5 r988130c6  
    5353        self.details['sigma'] = ['', None, None] 
    5454        self.details['center'] = ['', None, None] 
    55  
     55        #list of parameter that cannot be fitted 
     56        self.fixed= [] 
    5657    
    5758    def clone(self): 
  • sansmodels/src/sans/models/GuinierModel.py

    r922b0d1 r988130c6  
    4141        self.details['scale'] = ['cm-1', None, None] 
    4242        self.details['rg']    = ['A', None, None] 
    43                 
     43        #list of parameter that cannot be fitted 
     44        self.fixed= []   
    4445    def _guinier(self, x): 
    4546        return self.params['scale'] * math.exp( -(self.params['rg']*x)**2 / 3.0 )   
  • sansmodels/src/sans/models/LineModel.py

    r9696b075 r988130c6  
    3737        self.details['A'] = ['', None, None] 
    3838        self.details['B'] = ['', None, None] 
    39                 
     39        # fixed paramaters 
     40        self.fixed=[] 
    4041    def _line(self, x): 
    4142        """ 
  • sansmodels/src/sans/models/LorentzModel.py

    r753552d r988130c6  
    4545        self.details['scale']      = ['', None, None] 
    4646        self.details['background'] = ['cm-1', None, None] 
    47                 
     47        #list of parameter that cannot be fitted 
     48        self.fixed= []       
    4849    def _lorentz(self, x): 
    4950        """ 
  • sansmodels/src/sans/models/Lorentzian.py

    r95986b5 r988130c6  
    5353        self.details['gamma'] = ['', None, None] 
    5454        self.details['center'] = ['', None, None] 
    55  
     55        #list of parameter that cannot be fitted 
     56        self.fixed= [] 
    5657    
    5758    def clone(self): 
  • sansmodels/src/sans/models/NewCylinderModel.py

    r8809e48 r988130c6  
    6868        self.details['cyl_theta'] = ['rad', None, None] 
    6969        self.details['cyl_phi'] = ['rad', None, None] 
    70  
     70        #list of parameter that cannot be fitted 
     71        self.fixed= [] 
    7172        # The C models have a self.params dictionary 
    7273        for item in self.params: 
  • sansmodels/src/sans/models/PorodModel.py

    r753552d r988130c6  
    3535        self.details['scale']      = ['', None, None] 
    3636        self.details['background'] = ['', None, None] 
    37        
     37        #list of parameter that cannot be fitted 
     38        self.fixed= [] 
    3839                
    3940    def _porod(self, x): 
  • sansmodels/src/sans/models/PowerLawModel.py

    r753552d r988130c6  
    4646        self.details['scale']       = ['', None, None] 
    4747        self.details['background']  = ['', None, None] 
    48                 
     48        #list of parameter that cannot be fitted 
     49        self.fixed= []     
    4950    def _PowerLaw(self, x): 
    5051        """ 
  • sansmodels/src/sans/models/Sin.py

    r753552d r988130c6  
    2323        ## Parameter details [units, min, max] 
    2424        self.details = {} 
    25     
     25        #list of parameter that cannot be fitted 
     26        self.fixed= [] 
    2627    def clone(self): 
    2728        """ Return a identical copy of self """ 
  • sansmodels/src/sans/models/SphereModel.py

    r95986b5 r988130c6  
    6161        self.details['contrast'] = ['A-2', None, None] 
    6262        self.details['background'] = ['cm-1', None, None] 
    63  
     63        # Fixed parameters 
     64        self.fixed = ['radius.npts','radius.nsigmas'] 
    6465    
    6566    def clone(self): 
  • sansmodels/src/sans/models/TeubnerStreyModel.py

    r753552d r988130c6  
    5151        self.details['scale'] = ['', None, None] 
    5252        self.details['background']   = ['', None, None] 
    53      
     53        #list of parameter that cannot be fitted 
     54        self.fixed= [] 
    5455                
    5556    def _TeubnerStrey(self, x): 
  • sansmodels/src/sans/models/dispersion_models.py

    r0f5bc9f r988130c6  
    4343""" 
    4444import sans_extension.c_models as c_models  
     45 
     46 
    4547 
    4648class DispersionModel: 
     
    9799         
    98100        c_models.set_dispersion_weights(self.cdisp, values, weights) 
     101  
     102models = {GaussianDispersion:"GaussianModel", ArrayDispersion:"MyModel"}        
    99103         
    100          
Note: See TracChangeset for help on using the changeset viewer.