Ignore:
Timestamp:
Sep 21, 2018 5:41:31 AM (6 years ago)
Author:
GitHub <noreply@…>
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:
c928e81
Parents:
33d5956 (diff), d8d81ea (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Ingo Breßler <dev@…> (09/21/18 05:41:31)
git-committer:
GitHub <noreply@…> (09/21/18 05:41:31)
Message:

Merge pull request #181 from SasView?/ESS_GUI_poly_plot2

plot polydispersity (SASVIEW-1035 and trac ticket 17)

File:
1 edited

Legend:

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

    r33d5956 r30bed93  
    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        """ 
     66        Returns the polydispersity distribution for parameter *name* as *value* and *weight* arrays. 
     67        """ 
     68        # type: (str) -> Tuple(np.ndarray, np.ndarray) 
     69        _, x, w = self._get_weights(self._model_info.parameters[name]) 
     70        return x, w 
     71 
     72    SasviewModel.get_weights = get_weights 
    6073 
    6174logger = logging.getLogger(__name__) 
     
    24882501 
    24892502        if self.data_is_loaded: 
    2490             # delete any plots associated with the data that were not updated (e.g. to remove beta(Q), S_eff(Q)) 
     2503            # delete any plots associated with the data that were not updated 
     2504            # (e.g. to remove beta(Q), S_eff(Q)) 
    24912505            GuiUtils.deleteRedundantPlots(self.all_data[self.data_index], new_plots) 
    24922506            pass 
    24932507        else: 
    2494             # delete theory items for the model, in order to get rid of any redundant items, e.g. beta(Q), S_eff(Q) 
     2508            # delete theory items for the model, in order to get rid of any 
     2509            # redundant items, e.g. beta(Q), S_eff(Q) 
    24952510            self.communicate.deleteIntermediateTheoryPlotsSignal.emit(self.kernel_module.id) 
     2511 
     2512        # Create plots for parameters with enabled polydispersity 
     2513        for plot in FittingUtilities.plotPolydispersities(return_data.get('model', None)): 
     2514            data_id = fitted_data.id.split() 
     2515            plot.id = "{} [{}] {}".format(data_id[0], plot.name, " ".join(data_id[1:])) 
     2516            data_name = fitted_data.name.split() 
     2517            plot.name = " ".join([data_name[0], plot.name] + data_name[1:]) 
     2518            self.createNewIndex(plot) 
     2519            new_plots.append(plot) 
    24962520 
    24972521        # Create plots for intermediate product data 
Note: See TracChangeset for help on using the changeset viewer.