Changes in / [60a4e71:8e674ccf] in sasview
- Location:
- src/sas/qtgui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
rf3cc979 r70f4458 128 128 129 129 # Find param in volume_params 130 poly_pars = parameters.form_volume_parameters 131 if is2D: 132 poly_pars += parameters.orientation_parameters 133 for p in poly_pars: 130 for p in parameters.form_volume_parameters: 134 131 if p.name != param.name: 135 132 continue -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
rf3cc979 rc71b20a 569 569 menu.exec_(self.lstParams.viewport().mapToGlobal(position)) 570 570 except AttributeError as ex: 571 logg er.error("Error generating context menu: %s" % ex)571 logging.error("Error generating context menu: %s" % ex) 572 572 return 573 573 … … 1227 1227 if model_column in [delegate.poly_pd, delegate.poly_error, delegate.poly_min, delegate.poly_max]: 1228 1228 row = self.getRowFromName(parameter_name) 1229 param_item = self._model_model.item(row).child(0).child(0, model_column) 1230 if param_item is None: 1231 return 1229 param_item = self._model_model.item(row) 1232 1230 self._model_model.blockSignals(True) 1233 param_item. setText(item.text())1231 param_item.child(0).child(0, model_column).setText(item.text()) 1234 1232 self._model_model.blockSignals(False) 1235 1233 … … 1466 1464 self.communicate.statusBarUpdateSignal.emit(msg) 1467 1465 msg += results.mesg 1468 logg er.error(msg)1466 logging.error(msg) 1469 1467 return 1470 1468 … … 1509 1507 if self.calc_fit._interrupting: 1510 1508 msg = "Fitting cancelled by user after: %s s." % GuiUtils.formatNumber(elapsed) 1511 logg er.warning("\n"+msg+"\n")1509 logging.warning("\n"+msg+"\n") 1512 1510 else: 1513 1511 msg = "Fitting completed successfully in: %s s." % GuiUtils.formatNumber(elapsed) … … 2062 2060 kernel_module = generate.load_kernel_module(name) 2063 2061 except ModuleNotFoundError as ex: 2064 logg er.error("Can't find the model "+ str(ex))2062 logging.error("Can't find the model "+ str(ex)) 2065 2063 return 2066 2064 … … 2530 2528 """ 2531 2529 # TODO: remimplement thread cancellation 2532 logg er.error("".join(traceback.format_exception(etype, value, tb)))2530 logging.error("".join(traceback.format_exception(etype, value, tb))) 2533 2531 2534 2532 def setTableProperties(self, table): … … 2712 2710 2713 2711 if not datafile: 2714 logg er.info("No weight data chosen.")2712 logging.info("No weight data chosen.") 2715 2713 raise IOError 2716 2714 … … 2811 2809 2812 2810 func = QtWidgets.QComboBox() 2811 # Available range of shells displayed in the combobox 2812 func.addItems([str(i) for i in range(param_length+1)]) 2813 2814 # Respond to index change 2815 func.currentIndexChanged.connect(self.modifyShellsInList) 2813 2816 2814 2817 # cell 2: combobox 2815 2818 item2 = QtGui.QStandardItem() 2816 2817 # cell 3: min value 2818 item3 = QtGui.QStandardItem() 2819 2820 # cell 4: max value 2821 item4 = QtGui.QStandardItem() 2822 2823 self._model_model.appendRow([item1, item2, item3, item4]) 2819 self._model_model.appendRow([item1, item2]) 2824 2820 2825 2821 # Beautify the row: span columns 2-4 … … 2830 2826 self._n_shells_row = shell_row - 1 2831 2827 2832 # Get the default number of shells for the model 2833 kernel_pars = self.kernel_module._model_info.parameters.kernel_parameters 2834 shell_par = None 2835 for par in kernel_pars: 2836 if par.name == param_name: 2837 shell_par = par 2838 break 2839 if not shell_par: 2840 logger.error("Could not find %s in kernel parameters.", param_name) 2841 default_shell_count = shell_par.default 2842 shell_min = 0 2843 shell_max = 0 2844 try: 2845 shell_min = int(shell_par.limits[0]) 2846 shell_max = int(shell_par.limits[1]) 2847 except IndexError as ex: 2848 # no info about limits 2849 pass 2850 item3.setText(str(shell_min)) 2851 item4.setText(str(shell_max)) 2852 2853 # Respond to index change 2854 func.currentTextChanged.connect(self.modifyShellsInList) 2855 2856 # Available range of shells displayed in the combobox 2857 func.addItems([str(i) for i in range(shell_min, shell_max+1)]) 2858 2859 # Add default number of shells to the model 2860 func.setCurrentText(str(default_shell_count)) 2861 2862 def modifyShellsInList(self, text): 2828 # Set the index to the state-kept value 2829 func.setCurrentIndex(self.current_shell_displayed 2830 if self.current_shell_displayed < func.count() else 0) 2831 2832 def modifyShellsInList(self, index): 2863 2833 """ 2864 2834 Add/remove additional multishell parameters … … 2867 2837 first_row = self._n_shells_row + 1 2868 2838 remove_rows = self._num_shell_params 2869 try:2870 index = int(text)2871 except ValueError:2872 # bad text on the control!2873 index = 02874 logger.error("Multiplicity incorrect! Setting to 0")2875 2839 2876 2840 if remove_rows > 1: … … 2887 2851 self.current_shell_displayed = index 2888 2852 2889 # Param values for existing shells were reset to default; force all changes into kernel module 2890 for row in new_rows: 2891 par = row[0].text() 2892 val = GuiUtils.toDouble(row[1].text()) 2893 self.kernel_module.setParam(par, val) 2894 2895 # Change 'n' in the parameter model; also causes recalculation 2853 # Change 'n' in the parameter model, thereby updating the underlying model 2896 2854 self._model_model.item(self._n_shells_row, 1).setText(str(index)) 2897 2855 -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py
rf712bf30 r3fbd77b 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)616 615 more_rows = self.widget._model_model.rowCount() - last_row 617 self.assertEqual(more_rows, 4) # 4new rows: 2 params per index618 619 # Setto 0616 self.assertEqual(more_rows, 6) # 6 new rows: 2 params per index 617 618 # Back to 0 620 619 self.widget.lstParams.indexWidget(func_index).setCurrentIndex(0) 621 self.assertEqual(self.widget._model_model.rowCount(), last_row - 2) # 2 fewer rows than default620 self.assertEqual(self.widget._model_model.rowCount(), last_row) 622 621 623 622 def testPlotTheory(self): -
src/sas/qtgui/Plotting/PlotterBase.py
r343d7fd rd9150d8 10 10 11 11 import matplotlib.pyplot as plt 12 from matplotlib import rcParams13 12 14 13 DEFAULT_CMAP = pylab.cm.jet … … 30 29 self.manager = manager 31 30 self.quickplot = quickplot 32 33 # Set auto layout so x/y axis captions don't get cut off34 rcParams.update({'figure.autolayout': True})35 31 36 32 #plt.style.use('ggplot')
Note: See TracChangeset
for help on using the changeset viewer.