Changeset 60a4e71 in sasview
- Timestamp:
- Sep 11, 2018 2:50:23 AM (6 years ago)
- Parents:
- 343d7fd (diff), 8e674ccf (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/11/18 02:50:23)
- git-committer:
- GitHub <noreply@…> (09/11/18 02:50:23)
- Location:
- src/sas/qtgui
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/DataExplorer.py
r2b8286c r8e674ccf 95 95 self.communicator.activeGraphsSignal.connect(self.updateGraphCount) 96 96 self.communicator.activeGraphName.connect(self.updatePlotName) 97 self.communicator.plotUpdateSignal.connect(self. updatePlot)97 self.communicator.plotUpdateSignal.connect(self.displayData) 98 98 self.communicator.maskEditorSignal.connect(self.showEditDataMask) 99 99 self.communicator.extMaskEditorSignal.connect(self.extShowEditDataMask) … … 572 572 # Each fitpage contains the name based on fit widget number 573 573 fitpage_name = "" if id is None else "M"+str(id) 574 new_plots = [] 574 # groups plots which move into an own window 575 new_plots = dict(int = [], res = [], pd = []) 575 576 for item, plot in plots.items(): 576 if self.updatePlot(plot) and filename != plot.name:577 if (self.updatePlot(plot) and filename != plot.name) or plot.hidden: 577 578 continue 578 579 # Don't plot intermediate results, e.g. P(Q), S(Q) 579 580 match = GuiUtils.theory_plot_ID_pattern.match(plot.id) 580 # 2nd match group contains the identifier for the intermediate result, if present (e.g. "[P(Q)]") 581 # 2nd match group contains the identifier for the intermediate 582 # result, if present (e.g. "[P(Q)]") 581 583 if match and match.groups()[1] != None: 582 584 continue 583 # Don't include plots from different fitpages, but always include the original data 585 # Don't include plots from different fitpages, 586 # but always include the original data 584 587 if fitpage_name in plot.name or filename == plot.name: 585 588 # 'sophisticated' test to generate standalone plot for residuals 589 # this should be done by some kind of grouping by lists 590 # which helps to indicate which go into a single plot window 586 591 if 'esiduals' in plot.title: 587 plot.yscale='linear' 588 self.plotData([(item, plot)]) 592 plot.yscale = 'linear' 593 new_plots['res'].append((item, plot)) 594 elif 'olydispersity' in plot.title: 595 plot.yscale = 'linear' 596 new_plots['pd'].append((item, plot)) 589 597 else: 590 new_plots.append((item, plot)) 591 592 if new_plots: 593 self.plotData(new_plots) 598 new_plots['int'].append((item, plot)) 599 600 # create entirely new plots for those which could not be updated 601 for plots in new_plots.values(): 602 if len(plots): 603 self.plotData(plots) 594 604 595 605 def displayData(self, data_list, id=None): … … 597 607 Forces display of charts for the given data set 598 608 """ 599 plot_to_show = data_list[0] 600 # passed plot is used ONLY to figure out its title, 601 # so all the charts related by it can be pulled from 602 # the data explorer indices. 603 filename = plot_to_show.filename 604 self.displayFile(filename=filename, is_data=plot_to_show.is_data, id=id) 609 for plot_to_show in data_list: 610 # may there be duplicates? list(OrderedDict.fromkeys(data_list)) 611 # passed plot is used ONLY to figure out its title, 612 # so all the charts related by it can be pulled from 613 # the data explorer indices. 614 filename = plot_to_show.filename 615 self.displayFile(filename=filename, is_data=plot_to_show.is_data, id=id) 605 616 606 617 def addDataPlot2D(self, plot_set, item): -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
rf3cc979 r60a4e71 1088 1088 return True 1089 1089 1090 def updateDataVisibility(self, updateOnly): 1091 self.dataUpdateOnly = updateOnly 1092 for dataitem in self.all_data: 1093 data = GuiUtils.dataFromItem(dataitem) 1094 data.hidden = self.dataUpdateOnly 1095 self.updateModelIndex(data) 1096 1090 1097 def updateData(self): 1091 1098 """ … … 1093 1100 """ 1094 1101 # Update the chart 1102 self.updateDataVisibility(True) 1095 1103 if self.data_is_loaded: 1096 1104 self.cmdPlot.setText("Show Plot") … … 1815 1823 self.cmdPlot.setText("Show Plot") 1816 1824 # Force data recalculation so existing charts are updated 1817 self.showPlot()1825 # self.showPlot() 1818 1826 # This is an important processEvent. 1819 1827 # This allows charts to be properly updated in order 1820 1828 # of plots being applied. 1821 QtWidgets.QApplication.processEvents()1829 # QtWidgets.QApplication.processEvents() 1822 1830 self.recalculatePlotData() 1823 1831 … … 2272 2280 Create a model or theory index with passed Data1D/Data2D 2273 2281 """ 2282 # set some flag which decides if new plots should be created or 2283 # just existing ones updated, selectively hiding indiv. plot will also work 2284 fitted_data.hidden = getattr(self, 'dataUpdateOnly', True) 2274 2285 if self.data_is_loaded: 2275 2286 if not fitted_data.name: … … 2442 2453 for plot in new_plots: 2443 2454 self.communicate.plotUpdateSignal.emit([plot]) 2455 # enable plots to be shown next time if updateData() wasn't called 2456 self.updateDataVisibility(False) 2444 2457 2445 2458 def complete2D(self, return_data): -
src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
r01b4877 rf3cc979 128 128 129 129 # Find param in volume_params 130 for p in parameters.form_volume_parameters: 130 poly_pars = parameters.form_volume_parameters 131 if is2D: 132 poly_pars += parameters.orientation_parameters 133 for p in poly_pars: 131 134 if p.name != param.name: 132 135 continue -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py
r4ea8020 rf712bf30 613 613 614 614 # Check that the number of rows increased 615 # (note that n == 1 by default in core_multi_shell so this increases index by 2) 615 616 more_rows = self.widget._model_model.rowCount() - last_row 616 self.assertEqual(more_rows, 6) # 6new rows: 2 params per index617 618 # Backto 0617 self.assertEqual(more_rows, 4) # 4 new rows: 2 params per index 618 619 # Set to 0 619 620 self.widget.lstParams.indexWidget(func_index).setCurrentIndex(0) 620 self.assertEqual(self.widget._model_model.rowCount(), last_row )621 self.assertEqual(self.widget._model_model.rowCount(), last_row - 2) # 2 fewer rows than default 621 622 622 623 def testPlotTheory(self): -
src/sas/qtgui/Plotting/PlotterBase.py
rd9150d8 r343d7fd 10 10 11 11 import matplotlib.pyplot as plt 12 from matplotlib import rcParams 12 13 13 14 DEFAULT_CMAP = pylab.cm.jet … … 29 30 self.manager = manager 30 31 self.quickplot = quickplot 32 33 # Set auto layout so x/y axis captions don't get cut off 34 rcParams.update({'figure.autolayout': True}) 31 35 32 36 #plt.style.use('ggplot')
Note: See TracChangeset
for help on using the changeset viewer.