Changeset 40add21 in sasview for src/sas/sasgui


Ignore:
Timestamp:
Aug 4, 2017 11:31:27 AM (7 years ago)
Author:
lewis
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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
b1c2011
Parents:
1abd19c
Message:

Use comment as fitting parameter description

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/calculator/model_editor.py

    r490c617 r40add21  
    10651065                    p_line = param_line.lstrip().rstrip() 
    10661066                    if p_line: 
    1067                         pname, pvalue = self.get_param_helper(p_line) 
     1067                        pname, pvalue, desc = self.get_param_helper(p_line) 
    10681068                        param_names.append(pname) 
    1069                         out_f.write("%s['%s', '', %s, [-numpy.inf, numpy.inf], '', ''],\n" % (spaces16, pname, pvalue)) 
     1069                        out_f.write("%s['%s', '', %s, [-numpy.inf, numpy.inf], '', '%s'],\n" % (spaces16, pname, pvalue, desc)) 
    10701070                for param_line in pd_param_str.split('\n'): 
    10711071                    p_line = param_line.lstrip().rstrip() 
    10721072                    if p_line: 
    1073                         pname, pvalue = self.get_param_helper(p_line) 
     1073                        pname, pvalue, desc = self.get_param_helper(p_line) 
    10741074                        param_names.append(pname) 
    1075                         out_f.write("%s['%s', '', %s, [-numpy.inf, numpy.inf], 'volume', ''],\n" % (spaces16, pname, pvalue)) 
     1075                        out_f.write("%s['%s', '', %s, [-numpy.inf, numpy.inf], 'volume', '%s'],\n" % (spaces16, pname, pvalue, desc)) 
    10761076                out_f.write('%s]\n' % spaces13) 
    10771077 
     
    11141114        for item in items: 
    11151115            name = item.split("=")[0].strip() 
     1116            description = "" 
    11161117            try: 
    11171118                value = item.split("=")[1].strip() 
    11181119                if value.count("#"): 
    11191120                    # If line ends in a comment, remove it before parsing float 
     1121                    index = value.index("#") 
     1122                    description = value[(index + 1):].strip() 
    11201123                    value = value[:value.index("#")].strip() 
    11211124                float(value) 
     
    11231126                value = 1.0 # default 
    11241127 
    1125         return name, value 
     1128        return name, value, description 
    11261129 
    11271130    def set_function_helper(self, line): 
Note: See TracChangeset for help on using the changeset viewer.