Ignore:
Timestamp:
Apr 18, 2012 1:26:13 PM (12 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:
499fe7a
Parents:
3ee4d96
Message:

Fixing code style problems

File:
1 edited

Legend:

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

    r1ed3834 r279e371  
    1 #!/usr/bin/env python 
    21"""  
    32    Provide I(q) = I_0 exp ( - R_g^2 q^2 / 3.0) 
    43    Guinier function as a BaseComponent model 
    54""" 
    6  
    75from sans.models.BaseComponent import BaseComponent 
    86import math 
     
    2826        ## Name of the model 
    2927        self.name = "Guinier" 
    30         self.description=""" I(q) = I_0 exp ( - R_g^2 q^2 / 3.0 ) 
     28        self.description = """ I(q) = I_0 exp ( - R_g^2 q^2 / 3.0 ) 
    3129         
    3230                        List of default parameters: 
     
    4341        self.details['rg']    = ['[A]', None, None] 
    4442        #list of parameter that cannot be fitted 
    45         self.fixed= []   
     43        self.fixed = []   
     44         
    4645    def _guinier(self, x): 
    47         return self.params['scale'] * math.exp( -(self.params['rg']*x)**2 / 3.0 )   
     46        """ 
     47            Evaluate guinier function 
     48            :param x: q-value 
     49        """ 
     50        return self.params['scale']*math.exp( -(self.params['rg']*x)**2/3.0 )   
    4851    
    4952    def run(self, x = 0.0): 
    50         """ Evaluate the model 
     53        """  
     54            Evaluate the model 
    5155            @param x: input q-value (float or [float, float] as [r, theta]) 
    5256            @return: (guinier value) 
     
    5559            return self._guinier(x[0]) 
    5660        elif x.__class__.__name__ == 'tuple': 
    57             raise ValueError, "Tuples are not allowed as input to BaseComponent models" 
     61            raise ValueError, "Tuples are not allowed as input to models" 
    5862        else: 
    5963            return self._guinier(x) 
     
    6872            return self._guinier(q) 
    6973        elif x.__class__.__name__ == 'tuple': 
    70             raise ValueError, "Tuples are not allowed as input to BaseComponent models" 
     74            raise ValueError, "Tuples are not allowed as input to models" 
    7175        else: 
    7276            return self._guinier(x) 
Note: See TracChangeset for help on using the changeset viewer.