Changeset 9817207 in sasview for src/sas


Ignore:
Timestamp:
Nov 23, 2018 8:48:03 AM (6 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
9c05f22
Parents:
72651df
Message:

Added polydisp. and magnetic parameters to the Report Result page.
SASVIEW-1190

Location:
src/sas/qtgui/Perspectives/Fitting
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py

    r7f41584 r9817207  
    673673        unit = "" 
    674674        if model.item(row, 4+column_shift) is not None: 
    675             unit = model.item(row, 4+column_shift).text() 
    676  
     675            u = model.item(row, 4+column_shift).text() 
     676            # This isn't a unit if it is a number (polyd./magn.) 
     677            unit = "" if isNumber(u) else u 
    677678        param.append([checkbox_state, param_name, value, "", 
    678                         [error_state, error_value], 
    679                         [min_state, min_value], 
    680                         [max_state, max_value], unit]) 
     679                     [error_state, error_value], 
     680                     [min_state, min_value], 
     681                     [max_state, max_value], unit]) 
    681682 
    682683    return param 
     684 
     685def isNumber(s): 
     686    """ 
     687    Checks if string 's' is an int/float 
     688    """ 
     689    if s.isdigit(): 
     690        # check int 
     691        return True 
     692    else: 
     693        try: 
     694            # check float 
     695            _ = float(s) 
     696        except ValueError: 
     697            return False 
     698    return True 
    683699 
    684700def getOrientationParam(kernel_module=None): 
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    r21e71f1 r9817207  
    35333533            index = self.theory_item 
    35343534        params = FittingUtilities.getStandardParam(self._model_model) 
     3535        poly_params = [] 
     3536        magnet_params = [] 
     3537        if self.chkPolydispersity.isChecked() and self._poly_model.rowCount() > 0: 
     3538            poly_params = FittingUtilities.getStandardParam(self._poly_model) 
     3539        if self.chkMagnetism.isChecked() and self.canHaveMagnetism() and self._magnet_model.rowCount() > 0: 
     3540            magnet_params = FittingUtilities.getStandardParam(self._magnet_model) 
    35353541        report_logic = ReportPageLogic(self, 
    35363542                                       kernel_module=self.kernel_module, 
    35373543                                       data=self.data, 
    35383544                                       index=index, 
    3539                                        params=params) 
     3545                                       params=params+poly_params+magnet_params) 
    35403546 
    35413547        return report_logic.reportList() 
Note: See TracChangeset for help on using the changeset viewer.