Changeset c93122e in sasview


Ignore:
Timestamp:
Mar 2, 2015 3:46:50 PM (9 years ago)
Author:
Doucet, Mathieu <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:
6bd3a8d1
Parents:
e3f77d8b
Message:

Pylint for model template

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/models/c_extension/python_wrapper/modelTemplate.txt

    r8836849 rc93122e  
    1313############################################################################## 
    1414 
    15 """  
     15""" 
    1616Provide functionality for a C extension model 
    1717 
     
    3838 
    3939class [PYTHONCLASS]([CPYTHONCLASS], BaseComponent): 
    40     """  
    41     Class that evaluates a [PYTHONCLASS] model.  
     40    """ 
     41    Class that evaluates a [PYTHONCLASS] model. 
    4242    This file was auto-generated from [INCLUDE_FILE]. 
    4343    Refer to that file and the structure it contains 
     
    4545    [DEFAULT_LIST] 
    4646    """ 
    47          
     47 
    4848    def __init__(self, multfactor=1): 
    4949        """ Initialization """ 
    5050        self.__dict__ = {} 
    51          
     51 
    5252        # Initialize BaseComponent first, then sphere 
    5353        BaseComponent.__init__(self) 
     
    5555 
    5656        [CALL_CPYTHON_INIT] 
    57                          
     57 
    5858        ## Name of the model 
    5959        self.name = "[PYTHONCLASS]" 
     
    6262        [DESCRIPTION] 
    6363        """ 
    64         
     64 
    6565        [PAR_DETAILS] 
    6666        ## fittable parameters 
    6767        self.fixed = [FIXED] 
    68          
     68 
    6969        ## non-fittable parameters 
    7070        self.non_fittable = [NON_FITTABLE_PARAMS] 
    71          
     71 
    7272        ## parameters with orientation 
    7373        self.orientation_params = [ORIENTATION_PARAMS] 
     
    7878        self.category = [CATEGORY] 
    7979        self.multiplicity_info = [MULTIPLICITY_INFO] 
    80          
     80 
    8181    def __setstate__(self, state): 
    8282        """ 
     
    8484        """ 
    8585        self.__dict__, self.params, self.dispersion = state 
    86          
     86 
    8787    def __reduce_ex__(self, proto): 
    8888        """ 
    89         Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of  
     89        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
    9090        c model. 
    9191        """ 
    9292        state = (self.__dict__, self.params, self.dispersion) 
    9393        return (create_[PYTHONCLASS], tuple(), state, None, None) 
    94          
     94 
    9595    def clone(self): 
    9696        """ Return a identical copy of self """ 
    97         return self._clone([PYTHONCLASS]())    
    98          
     97        return self._clone([PYTHONCLASS]()) 
     98 
    9999    def run(self, x=0.0): 
    100         """  
     100        """ 
    101101        Evaluate the model 
    102          
    103102        :param x: input q, or [q,phi] 
    104          
    105103        :return: scattering function P(q) 
    106          
    107104        """ 
    108105        return [CPYTHONCLASS].run(self, x) 
    109     
     106 
    110107    def runXY(self, x=0.0): 
    111         """  
     108        """ 
    112109        Evaluate the model in cartesian coordinates 
    113          
    114110        :param x: input q, or [qx, qy] 
    115          
    116111        :return: scattering function P(q) 
    117          
    118112        """ 
    119113        return [CPYTHONCLASS].runXY(self, x) 
    120          
     114 
    121115    def evalDistribution(self, x): 
    122         """  
     116        """ 
    123117        Evaluate the model in cartesian coordinates 
    124          
    125118        :param x: input q[], or [qx[], qy[]] 
    126          
    127119        :return: scattering function P(q[]) 
    128          
    129120        """ 
    130121        return [CPYTHONCLASS].evalDistribution(self, x) 
    131          
     122 
    132123    def calculate_ER(self): 
    133         """  
     124        """ 
    134125        Calculate the effective radius for P(q)*S(q) 
    135          
    136126        :return: the value of the effective radius 
    137          
    138         """        
     127        """ 
    139128        return [CPYTHONCLASS].calculate_ER(self) 
    140          
     129 
    141130    def calculate_VR(self): 
    142         """  
     131        """ 
    143132        Calculate the volf ratio for P(q)*S(q) 
    144          
    145133        :return: the value of the volf ratio 
    146          
    147         """        
     134        """ 
    148135        return [CPYTHONCLASS].calculate_VR(self) 
    149                
     136 
    150137    def set_dispersion(self, parameter, dispersion): 
    151138        """ 
    152139        Set the dispersion object for a model parameter 
    153          
    154140        :param parameter: name of the parameter [string] 
    155141        :param dispersion: dispersion object of type DispersionModel 
    156          
    157142        """ 
    158143        return [CPYTHONCLASS].set_dispersion(self, 
    159144               parameter, dispersion.cdisp) 
    160          
    161     
     145 
    162146# End of file 
Note: See TracChangeset for help on using the changeset viewer.