Changeset 9d8d52c in sasview for src


Ignore:
Timestamp:
Jan 30, 2018 8:54:09 AM (7 years ago)
Author:
krzywon
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
72670ad2
Parents:
b6f9c9f
Message:

Use distribution name to check for array distribution instead of index.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/basepage.py

    r58a8f76 r9d8d52c  
    13671367            except Exception: 
    13681368                logger.error(traceback.format_exc()) 
    1369             selection = self._find_polyfunc_selection(disp_model) 
     1369            index, selection = self._find_polyfunc_selection(disp_model) 
    13701370            for list in self.fittable_param: 
    13711371                if list[1] == key and list[7] is not None: 
    1372                     list[7].SetSelection(selection) 
     1372                    list[7].SetSelection(index) 
    13731373                    # For the array disp_model, set the values and weights 
    1374                     if selection == 1: 
     1374                    if selection == 'array': 
    13751375                        disp_model.set_weights(self.values[key], 
    13761376                                               self.weights[key]) 
     
    13851385                            logger.error(traceback.format_exc()) 
    13861386            # For array, disable all fixed params 
    1387             if selection == 1: 
     1387            if selection == 'array': 
    13881388                for item in self.fixed_param: 
    13891389                    if item[1].split(".")[0] == key.split(".")[0]: 
     
    26682668    def _find_polyfunc_selection(self, disp_func=None): 
    26692669        """ 
    2670         FInd Comboox selection from disp_func 
     2670        Find Combobox selection from disp_func 
    26712671 
    26722672        :param disp_function: dispersion distr. function 
     
    26752675        if disp_func is not None: 
    26762676            try: 
    2677                 return POLYDISPERSITY_MODELS.values().index(disp_func.__class__) 
     2677                index = POLYDISPERSITY_MODELS.values().index(disp_func.__class__) 
     2678                return index, POLYDISPERSITY_MODELS.keys()[index] 
    26782679            except ValueError: 
    26792680                pass  # Fall through to default class 
    2680         return POLYDISPERSITY_MODELS.keys().index('gaussian') 
     2681        return POLYDISPERSITY_MODELS.keys().index('gaussian'), 'gaussian' 
    26812682 
    26822683    def on_reset_clicked(self, event): 
Note: See TracChangeset for help on using the changeset viewer.