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/GuinierPorodModel.py

    r8f20419d r279e371  
    1 #!/usr/bin/env python 
    21"""  
    3 I(q) = scale/q^s* exp ( - R_g^2 q^2 / (3-s) ) for q<= ql 
    4     = scale/q^m*exp((-ql^2*Rg^2)/(3-s))*ql^(m-s) for q>=ql 
    5 Guinier function as a BaseComponent model 
     2    I(q) = scale/q^s* exp ( - R_g^2 q^2 / (3-s) ) for q<= ql 
     3        = scale/q^m*exp((-ql^2*Rg^2)/(3-s))*ql^(m-s) for q>=ql 
     4    Guinier function as a BaseComponent model 
    65""" 
    7  
    86from sans.models.BaseComponent import BaseComponent 
    97from math import sqrt,exp 
     
    2422        ## Name of the model 
    2523        self.name = "GuinierPorod" 
    26         self.description=""" I(q) = scale/q^s* exp ( - R_g^2 q^2 / (3-s) ) for q<= ql 
     24        self.description = """ 
     25         I(q) = scale/q^s* exp ( - R_g^2 q^2 / (3-s) ) for q<= ql 
    2726         = scale/q^m*exp((-ql^2*Rg^2)/(3-s))*ql^(m-s) for q>=ql 
    2827                        where ql = sqrt((m-s)(3-s)/2)/Rg. 
     
    4948 
    5049        #list of parameter that cannot be fitted 
    51         self.fixed= []   
     50        self.fixed = []   
    5251         
    5352    def _guinier_porod(self, x): 
     
    6564         
    6665        #do the calculation and return the function value 
    67         q1=sqrt((n-3.0+m)*n/2.0)/Rg 
     66        q1 = sqrt((n-3.0+m)*n/2.0)/Rg 
    6867        if qval < q1: 
    6968            F = (G/pow(qval,(3.0-n)))*exp((-qval*qval*Rg*Rg)/n)  
    7069        else: 
    71             F = (G/pow(qval,m))*exp(-(n-3.0+m)/2.0)*pow(((n-3.0+m)*n/2.0), 
     70            F = (G/pow(qval, m))*exp(-(n-3.0+m)/2.0)*pow(((n-3.0+m)*n/2.0), 
    7271                                        ((n-3.0+m)/2.0))/pow(Rg,(n-3.0+m)) 
    7372        inten = F + bgd 
     
    8382            return self._guinier_porod(x[0]) 
    8483        elif x.__class__.__name__ == 'tuple': 
    85             raise ValueError, "Tuples are not allowed as input to BaseComponent models" 
     84            raise ValueError, "Tuples are not allowed as input to models" 
    8685        else: 
    8786            return self._guinier_porod(x) 
     
    9695            return self._guinier_porod(q) 
    9796        elif x.__class__.__name__ == 'tuple': 
    98             raise ValueError, "Tuples are not allowed as input to BaseComponent models" 
     97            raise ValueError, "Tuples are not allowed as input to models" 
    9998        else: 
    10099            return self._guinier_porod(x) 
Note: See TracChangeset for help on using the changeset viewer.