Changeset 3ee4d96 in sasview for sansmodels/src


Ignore:
Timestamp:
Apr 18, 2012 12:54:57 PM (13 years ago)
Author:
Mathieu Doucet <doucetm@…>
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:
279e371
Parents:
9e91546
Message:

Fixing code style problems

File:
1 edited

Legend:

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

    r8d97277 r3ee4d96  
    2929        ## Name of the model 
    3030        self.name = "DAB_Model" 
    31         self.description="""F(x) = scale*(L^3)/( 1 + (x*L)^2 )^(2) + background 
     31        self.description = """ 
     32        F(x) = scale*(L^3)/( 1 + (x*L)^2 )^(2) + background 
    3233         
    3334        The model has three parameters:  
     
    4748        self.details['background']        = ['[1/cm]', None, None] 
    4849        #list of parameter that cannot be fitted 
    49         self.fixed= []       
     50        self.fixed = []    
     51            
    5052    def _DAB(self, x): 
    5153        """ 
    5254            Evaluate  F(x) = (scale*L^3)/( 1 + (x*L)^2 )^(2) + background 
    53             
    5455        """ 
    55         # According to SRK (Igor/NIST code: 6 JUL 2009  changed definition of 'scale' to be uncorrelated with 'length') 
    56         return self.params['scale']*math.pow(self.params['length'],3)/math.pow(( 1 + math.pow(x * self.params['length'],2)),2) \ 
    57          + self.params['background'] 
    58         
     56        # According to SRK (Igor/NIST code: 6 JUL 2009 changed definition  
     57        # of 'scale' to be uncorrelated with 'length') 
     58        return self.params['scale']*math.pow(self.params['length'], 3)/\ 
     59            math.pow(( 1 + math.pow(x * self.params['length'], 2)), 2) \ 
     60            + self.params['background'] 
    5961    
    6062    def run(self, x = 0.0): 
     
    6668            return self._DAB(x[0]) 
    6769        elif x.__class__.__name__ == 'tuple': 
    68             raise ValueError, "Tuples are not allowed as input to BaseComponent models" 
     70            raise ValueError, "Tuples are not allowed as input to models" 
    6971        else: 
    7072            return self._DAB(x) 
     
    7981            return self._DAB(q) 
    8082        elif x.__class__.__name__ == 'tuple': 
    81             raise ValueError, "Tuples are not allowed as input to BaseComponent models" 
     83            raise ValueError, "Tuples are not allowed as input to models" 
    8284        else: 
    8385            return self._DAB(x) 
Note: See TracChangeset for help on using the changeset viewer.