Ignore:
Timestamp:
May 3, 2012 11:23:15 AM (13 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:
56acb5d
Parents:
74d7b59
Message:

set all the custom model names same as its filename

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fittingview/src/sans/perspectives/fitting/plugin_models/sph_bessel_jn.py

    r19e614a r316e231  
    1919import numpy                 ##DO NOT CHANGE THIS LINE!!! 
    2020import scipy.special            ##CHANGE THIS LINE WITH CAUTION!!! 
    21  
     21import os 
     22import sys 
    2223##PLEASE READ COMMENTS CAREFULLY !!! COMMENT ARE IN CAPITAL LETTERS AND AFTER ## 
    2324## THESE COMMENTS ARE THERE TO GUIDE YOU. YOU CAN REMOVE THEM ONLY WHEN YOU ARE 
     
    3435    ##EXAMPLE: Class that evaluates a polynomial model.  
    3536    """ 
    36     ## YOU CAN MODIFY THE LINE BELLOW. CHANGE ONLY WORDS BETWEEN " "  
    37     ## TO RENAME YOUR MODEL 
    38     name = "sph_bessel_jn" ## <----- FILE NAME (NAME OF THE MODEL)    
     37    name = ""  
    3938                                 
    4039    def __init__(self):      ##DO NOT CHANGE THIS LINE!!! 
     
    4746        ## DELETE MODIFIABLE LINE HERE WILL REDUCE THE NUMBER OF PARAMETERS 
    4847        self.params = {}                ##DO NOT CHANGE THIS LINE!!! 
    49          
     48        # Set the name same as the file name 
     49        self.name = self.get_fname()     ##DO NOT CHANGE THIS LINE!!! 
    5050        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ' AND NUMBER  
    5151        ## YOU CAN ALSO DELETE THIS LINE 
     
    112112 
    113113        return result ## MODIFY ONLY RESULT. DON'T DELETE RETURN!!!! 
    114  
     114     
     115    ## DO NOT MODIFY THE FOLLOWING LINES!!!!!!!!!!!!!!!!       
     116    def get_fname(self): 
     117        """ 
     118        Get the model name same as the file name 
     119        """ 
     120        path = sys._getframe().f_code.co_filename 
     121        basename  = os.path.basename(path) 
     122        name, _ = os.path.splitext(basename) 
     123        return name 
     124             
    115125###############################################################################    
    116126## DO NOT MODIFY THE FOLLOWING LINES!!!!!!!!!!!!!!!!        
Note: See TracChangeset for help on using the changeset viewer.