Changeset 8389beb in sasview


Ignore:
Timestamp:
Jul 25, 2012 5:31:31 PM (12 years ago)
Author:
Jae Cho <jhjcho@…>
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:
32ea318
Parents:
a8d3b4f
Message:

some pylint cleanups

Location:
sansmodels/src/python_wrapper
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/python_wrapper/WrapperGenerator.py

    r5da3cc5 r8389beb  
    4444        cylinder.h defines the following: 
    4545         
    46             /// 1D scattering function 
    47             double cylinder_analytical_1D(CylinderParameters *pars, double q); 
    48              
    49             /// 2D scattering function 
    50             double cylinder_analytical_2D(CylinderParameters *pars, double q, double phi); 
     46        /// 1D scattering function 
     47        double cylinder_analytical_1D(CylinderParameters *pars, double q); 
     48             
     49        /// 2D scattering function 
     50        double cylinder_analytical_2D(CylinderParameters *pars, double q, double phi); 
    5151             
    5252        The .c file implements those functions. 
     
    318318            The file is written in C[PYTHONCLASS].c 
    319319        """ 
    320         file_path = os.path.join(self.c_wrapper_dir, "C"+self.pythonClass+'.cpp') 
     320        file_path = os.path.join(self.c_wrapper_dir,  
     321                                 "C"+self.pythonClass+'.cpp') 
    321322        file = open(file_path, 'w') 
    322323         
    323         template = open(os.path.join(os.path.dirname(__file__), "classTemplate.txt"), 'r') 
     324        template = open(os.path.join(os.path.dirname(__file__),  
     325                                     "classTemplate.txt"), 'r') 
    324326         
    325327        tmp_buf = template.read() 
     
    405407            if self.foundCPP: 
    406408                newline = self.replaceToken(newline,  
    407                                             "[C_INCLUDE_FILE]", "")   
     409                            "[C_INCLUDE_FILE]", "")   
    408410                newline = self.replaceToken(newline,  
    409                                             "[CPP_INCLUDE_FILE]", "#include \"%s\"" % basename)   
     411                            "[CPP_INCLUDE_FILE]", "#include \"%s\"" % basename)   
    410412            else:   
    411413                newline = self.replaceToken(newline,  
    412                                             "[C_INCLUDE_FILE]", "#include \"%s\"" % basename)    
     414                            "[C_INCLUDE_FILE]", "#include \"%s\"" % basename)    
    413415                newline = self.replaceToken(newline,  
    414                                             "[CPP_INCLUDE_FILE]", "#include \"models.hh\"")   
     416                            "[CPP_INCLUDE_FILE]", "#include \"models.hh\"")   
    415417                 
    416418            # Numerical calcs dealloc 
     
    458460        file_path = os.path.join(self.output_dir, self.pythonClass+'.py') 
    459461        file = open(file_path, 'w') 
    460         template = open(os.path.join(os.path.dirname(__file__), "modelTemplate.txt"), 'r') 
     462        template = open(os.path.join(os.path.dirname(__file__),  
     463                                     "modelTemplate.txt"), 'r') 
    461464         
    462465        tmp_buf = template.read() 
     
    490493            if self.is_multifunc: 
    491494                newline = self.replaceToken(newline,"[CALL_CPYTHON_INIT]", 
    492                                             'C' + self.pythonClass + ".__init__(self,multfactor)\n\tself.is_multifunc = True") 
    493                 newline = self.replaceToken(newline,"[MULTIPLICITY_INFO]",self.multiplicity_info) 
     495                    'C' + self.pythonClass + \ 
     496                    ".__init__(self,multfactor)\n\tself.is_multifunc = True") 
     497                newline = self.replaceToken(newline,"[MULTIPLICITY_INFO]",  
     498                                            self.multiplicity_info) 
    494499            else: 
    495500                newline = self.replaceToken(newline,"[CALL_CPYTHON_INIT]", 
    496                                             'C' + self.pythonClass + ".__init__(self)\n\tself.is_multifunc = False") 
    497                 newline = self.replaceToken(newline,"[MULTIPLICITY_INFO]","None") 
     501                    'C' + self.pythonClass + \ 
     502                    ".__init__(self)\n        self.is_multifunc = False") 
     503                newline = self.replaceToken(newline,  
     504                                            "[MULTIPLICITY_INFO]","None") 
    498505 
    499506            
  • sansmodels/src/python_wrapper/modelTemplate.txt

    r5da3cc5 r8389beb  
    5151        #apply([CPYTHONCLASS].__init__, (self,))  
    5252 
    53         [CALL_CPYTHON_INIT] 
     53        [CALL_CPYTHON_INIT] 
    5454                         
    5555        ## Name of the model 
Note: See TracChangeset for help on using the changeset viewer.