Changeset b4d05bd in sasview


Ignore:
Timestamp:
Aug 13, 2018 9:48:38 AM (3 years ago)
Author:
Torin Cooper-Bennun <torin.cooper-bennun@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
e752ab8
Parents:
6b3a231
Message:

allow for only P(Q) or S(Q) to be present in intermediate results; improve comments

Location:
src/sas/qtgui
Files:
3 edited

Legend:

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

    r3ae9179 rb4d05bd  
    3737    # The controller which is responsible for managing signal slots connections 
    3838    # for the gui and providing an interface to the data model. 
     39 
     40    # This matches the ID of a plot created using FittingLogic._create1DPlot, e.g. 
     41    # "5 [P(Q)] modelname" 
     42    # or 
     43    # "4 modelname". 
     44    # Useful for determining whether the plot in question is for an intermediate result, such as P(Q) or S(Q) in the 
     45    # case of a product model; the identifier for this is held in square brackets, as in the example above. 
    3946    theory_plot_ID_pattern = re.compile(r"^([0-9]+)\s+(\[(.*)\]\s+)?(.*)$") 
    4047 
     
    506513                self.active_plots[plot_id].replacePlot(plot_id, plot) 
    507514            else: 
    508                 # Don't plot intermediate data e.g. P(Q), S(Q) 
     515                # Don't plot intermediate results, e.g. P(Q), S(Q) 
    509516                match = self.theory_plot_ID_pattern.match(plot_id) 
     517                # 2nd match group contains the identifier for the intermediate result, if present (e.g. "[P(Q)]") 
    510518                if match and match.groups()[1] != None: 
    511519                    continue 
  • src/sas/qtgui/Perspectives/Fitting/FittingLogic.py

    r6b3a231 rb4d05bd  
    215215    def new1DProductPlots(self, return_data, tab_id): 
    216216        """ 
    217         If return_data contains separated P(Q) and S(Q) data, create 1D plots for each and return as a tuple. 
    218         Returns (None, None) if this data is unavailable. 
     217        If return_data contains separated P(Q) and/or S(Q) data, create 1D plots for each and return as the tuple 
     218        (pq_plot, sq_plot). If either are unavailable, the corresponding plot is None. 
    219219        """ 
    220220        # Unpack return data from Calc1D 
     
    226226        pq_values, sq_values = return_data 
    227227 
    228         if pq_values is not None and sq_values is not None: 
     228        pq_plot = None 
     229        sq_plot = None 
     230 
     231        if pq_values is not None: 
    229232            pq_plot = self._create1DPlot(tab_id, x, pq_values, model, data, component="P(Q)") 
     233        if sq_values is not None: 
    230234            sq_plot = self._create1DPlot(tab_id, x, sq_values, model, data, component="S(Q)") 
    231             return pq_plot, sq_plot 
    232         else: 
    233             return None, None 
     235 
     236        return pq_plot, sq_plot 
    234237 
    235238    def computeDataRange(self): 
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    r6b3a231 rb4d05bd  
    22332233        # Create plots for intermediate product data 
    22342234        pq_data, sq_data = self.logic.new1DProductPlots(return_data, self.tab_id) 
    2235         if pq_data is not None and sq_data is not None: 
     2235        if pq_data is not None: 
    22362236            pq_data.symbol = "Line" 
     2237            self.createNewIndex(pq_data) 
     2238        if sq_data is not None: 
    22372239            sq_data.symbol = "Line" 
    2238             self.createNewIndex(pq_data) 
    22392240            self.createNewIndex(sq_data) 
    22402241 
Note: See TracChangeset for help on using the changeset viewer.