Ignore:
Timestamp:
Sep 18, 2018 2:33:43 AM (6 years ago)
Author:
ibressler
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:
16287f3
Parents:
db500cb
git-author:
Ingo Breßler <dev@…> (09/18/18 02:33:38)
git-committer:
Ingo Breßler <dev@…> (09/18/18 02:33:43)
Message:

plotPolydispersities(): use precalc. weights from SasviewModel?

File:
1 edited

Legend:

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

    r3ae70f9 raa82f54  
    5858DEFAULT_POLYDISP_FUNCTION = 'gaussian' 
    5959 
     60# CRUFT: remove when new release of sasmodels is available 
     61# https://github.com/SasView/sasview/pull/181#discussion_r218135162 
     62from sasmodels.sasview_model import SasviewModel 
     63if not hasattr(SasviewModel, 'get_weights'): 
     64    def get_weights(self, name): 
     65        """Returns model weights by parameter name. 
     66        type: (str) -> Tuple(float, np.ndarray, np.ndarray) 
     67        Supposed to be a member of SasviewModel.""" 
     68        p = [p for p in self._model_info.parameters.call_parameters 
     69                        if name is p.name] 
     70        if not len(p): 
     71            return None, None, None 
     72        return self._get_weights(p[0]) 
     73 
     74    SasviewModel.get_weights = get_weights 
    6075 
    6176logger = logging.getLogger(__name__) 
Note: See TracChangeset for help on using the changeset viewer.