Changeset b8080e1 in sasview for src/sas/sascalc/fit


Ignore:
Timestamp:
Aug 29, 2018 8:01:23 AM (6 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
9463ca2
Parents:
ce30949
git-author:
Piotr Rozyczko <rozyczko@…> (08/29/18 07:59:56)
git-committer:
Piotr Rozyczko <rozyczko@…> (08/29/18 08:01:23)
Message:

cherry picking sascalc changes from master SASVIEW-996
minor unit test fixes

Location:
src/sas/sascalc/fit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/fit/AbstractFitEngine.py

    racd9c311 rb8080e1  
    7878    def get_params(self, fitparams): 
    7979        """ 
    80         return a list of value of paramter to fit 
    81  
    82         :param fitparams: list of paramaters name to fit 
     80        return a list of value of parameter to fit 
     81 
     82        :param fitparams: list of parameters name to fit 
    8383 
    8484        """ 
  • src/sas/sascalc/fit/MultiplicationModel.py

    r574adc7 rb8080e1  
    6868        try: 
    6969            multiplicity = p_model.multiplicity 
    70         except: 
     70        except AttributeError: 
    7171            multiplicity = 1 
    7272        ## functional multiplicity of the model 
     
    7676        self.non_fittable = p_model.non_fittable 
    7777        self.multiplicity_info = [] 
    78         self.fun_list = {} 
     78        self.fun_list = [] 
    7979        if self.non_fittable > 1: 
    8080            try: 
     
    8282                self.fun_list = p_model.fun_list 
    8383                self.is_multiplicity_model = True 
    84             except: 
     84            except AttributeError: 
    8585                pass 
    8686        else: 
  • src/sas/sascalc/fit/pagestate.py

    r9e6aeaf rb8080e1  
    1313################################################################################ 
    1414import time 
     15import re 
    1516import os 
    1617import sys 
     
    646647                    name = value.split(':', 1)[1].strip() 
    647648                    file_value = "File name:" + name 
     649                    #Truncating string so print doesn't complain of being outside margins 
     650                    if sys.platform != "win32": 
     651                        MAX_STRING_LENGHT = 50 
     652                        if len(file_value) > MAX_STRING_LENGHT: 
     653                            file_value = "File name:.."+file_value[-MAX_STRING_LENGHT+10:] 
    648654                    file_name = CENTRE % file_value 
    649655                    if len(title) == 0: 
     
    721727        html_str, text_str, title = self._get_report_string() 
    722728        # Allow 2 figures to append 
    723         image_links = [FEET_2%fig for fig in fig_urls] 
    724  
     729        #Constraining image width for OSX and linux, so print doesn't complain of being outside margins 
     730        if sys.platform == "win32": 
     731            image_links = [FEET_2%fig for fig in fig_urls] 
     732        else: 
     733            image_links = [FEET_2_unix%fig for fig in fig_urls] 
    725734        # final report html strings 
    726735        report_str = html_str + ELINE.join(image_links) 
    727  
     736        report_str += FEET_3 
    728737        return report_str, text_str 
    729738 
     
    954963        if node.get('version'): 
    955964            # Get the version for model conversion purposes 
    956             self.version = tuple(int(e) for e in 
    957                                  str.split(node.get('version'), ".")) 
     965            x = re.sub('[^\d.]', '', node.get('version')) 
     966            self.version = tuple(int(e) for e in str.split(x, ".")) 
    958967            # The tuple must be at least 3 items long 
    959968            while len(self.version) < 3: 
     
    13681377""" 
    13691378FEET_2 = \ 
    1370 """<img src="%s" ></img> 
     1379"""<img src="%s"></img> 
     1380""" 
     1381FEET_2_unix = \ 
     1382"""<img src="%s" width="540"></img> 
    13711383""" 
    13721384FEET_3 = \ 
  • src/sas/sascalc/fit/qsmearing.py

    r50fcb09 rb8080e1  
    9090            #print "data1D.dx[0]",data1D.dx[0],data1D.dxl[0] 
    9191    # If we found resolution smearing data, return a QSmearer 
    92     if _found_resolution == True: 
     92    if _found_resolution: 
    9393         return pinhole_smear(data, model) 
    9494 
     
    113113                break 
    114114    # If we found slit smearing data, return a slit smearer 
    115     if _found_slit == True: 
     115    if _found_slit: 
    116116        return slit_smear(data, model) 
    117117    return None 
Note: See TracChangeset for help on using the changeset viewer.