Changeset 4396300 in sasview for src


Ignore:
Timestamp:
Oct 31, 2018 8:27:23 AM (5 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:
17e2d502
Parents:
48df831
Message:

Finalize backward compatibility mode for project read for simple fitting

Location:
src/sas/qtgui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/MainWindow/DataExplorer.py

    r186d678 r4396300  
    402402 
    403403            # Convert fitpage properties and update the dict 
    404             all_data = GuiUtils.convertFromSVS(datasets) 
     404            try: 
     405                all_data = GuiUtils.convertFromSVS(datasets) 
     406            except Exception as ex: 
     407                # disregard malformed SVS and try to recover regardless 
     408                msg = "Error while reading the project file: "+str(ex) 
     409                logging.error(msg) 
     410                pass 
    405411        else: 
    406412            with open(filename, 'r') as infile: 
  • src/sas/qtgui/Utilities/GuiUtils.py

    rb1b71ad r4396300  
    13451345                w = 0 
    13461346            param_dict['smearing'] = [str(w)] 
    1347         # weighting is a bit trickier. 4.x has multiple keywords, 
     1347        # weighting is also tricky. 4.x has multiple keywords, 
    13481348        # one for each radio box. 
    13491349        if params.dI_noweight: 
     
    13761376            for p in params.orientation_params: 
    13771377                p_name = p[1] 
    1378                 param_dict[p_name] = [str(p[0]), str(p[2]), None, str(p[5][1]), str(p[6][1])] 
     1378                p_min = "-360.0" 
     1379                p_max = "360.0" 
     1380                if p[5][1] != "": 
     1381                    p_min = p[5][1] 
     1382                if p[6][1] != "": 
     1383                    p_max = p[6][1] 
     1384                param_dict[p_name] = [str(p[0]), str(p[2]), None, p_min, p_max] 
    13791385 
    13801386        # disperse parameters 
     
    13821388            for p in params.fittable_param: 
    13831389                p_name = p[1] 
    1384                 param_dict[p_name] = [str(p[0]), str(p[2]), None, str(35), str(3)] 
    1385  
    1386         # magnetic parameters 
     1390                p_opt = str(p[0]) 
     1391                p_err = "0" 
     1392                p_width = str(p[2]) 
     1393                p_min = str(0) 
     1394                p_max = "inf" 
     1395                param_npts = p_name.replace('.width','.npts') 
     1396                param_nsigmas = p_name.replace('.width', '.nsigmas') 
     1397                if params.is_2D and p_name in params.disp_obj_dict: 
     1398                    lookup = params.orientation_params_disp 
     1399                    p_min = "-360.0" 
     1400                    p_max = "360.0" 
     1401                else: 
     1402                    lookup = params.fixed_param 
     1403                p_npts = [s[2] for s in lookup if s[1] == param_npts][0] 
     1404                p_nsigmas = [s[2] for s in lookup if s[1] == param_nsigmas][0] 
     1405                if p_name in params.disp_obj_dict: 
     1406                    p_disp = params.disp_obj_dict[p_name] 
     1407                else: 
     1408                    p_disp = "gaussian" 
     1409                param_dict[p_name] = [p_opt, p_width, p_min, p_max, p_npts, p_nsigmas, p_disp] 
    13871410 
    13881411        content[params.data_id]['fit_params'] = param_dict 
Note: See TracChangeset for help on using the changeset viewer.