Skip to content

Commit

Permalink
Merge branch 'release_6.0.0' into sasview-counterpart-to-sasdata-mani…
Browse files Browse the repository at this point in the history
…pulations-rewrite
  • Loading branch information
Wojciech Potrzebowski authored Dec 3, 2023
2 parents 88d8a00 + ac73cd6 commit e64b046
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions installers/sasview.spec
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ datas = [
datas.append((os.path.join(PYTHON_PACKAGES, 'debugpy'), 'debugpy'))
datas.append((os.path.join(PYTHON_PACKAGES, 'jedi'), 'jedi'))
datas.append((os.path.join(PYTHON_PACKAGES, 'zmq'), 'zmq'))
datas.append((os.path.join(PYTHON_PACKAGES, 'freetype'), 'freetype'))

def add_data(data):
for component in data:
Expand Down
2 changes: 1 addition & 1 deletion src/sas/qtgui/Calculators/SlitSizeCalculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def calculateSlitSize(self, data=None):
try:
xdata = data.x
ydata = data.y
if xdata.size == 0 or xdata is None or ydata.size == 0 or ydata is None:
if xdata is None or len(xdata) == 0 or ydata is None or len(ydata) == 0:
msg = "The current data is empty please check x and y"
logging.error(msg)
return
Expand Down
2 changes: 1 addition & 1 deletion src/sas/qtgui/Plotting/Plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def addPlotsToContextMenu(self):

if plot.is_data:
self.actionHideError = plot_menu.addAction("Hide Error Bar")
if plot.dy is not None and plot.dy != []:
if plot.dy is not None and len(plot.dy)>0:
if plot.hide_error:
self.actionHideError.setText('Show Error Bar')
else:
Expand Down
2 changes: 1 addition & 1 deletion src/sas/qtgui/Plotting/UnitTesting/PlotterBaseTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def testDefaults(self, plotter):
assert isinstance(plotter.canvas, FigureCanvas)
assert isinstance(plotter.properties, ScaleProperties)

assert plotter._data == []
assert len(plotter._data) == 0
assert plotter._xscale == 'log'
assert plotter._yscale == 'log'
assert plotter.scale == 'linear'
Expand Down
2 changes: 1 addition & 1 deletion src/sas/qtgui/Utilities/Reports/ReportDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def onPrint(self):
try:
# pylint chokes on this line with syntax-error
# pylint: disable=syntax-error doesn't seem to help
document.print(printer)
document.print_(printer)
except Exception as ex:
# Printing can return various exceptions, let's catch them all
logging.error("Print report failed with: " + str(ex))
Expand Down
4 changes: 2 additions & 2 deletions src/sas/qtgui/Utilities/UnitTesting/ReportDialogTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def testDefaults(self, widget):
def testOnPrint(self, widget, mocker):
''' Printing the report '''
document = widget.txtBrowser.document()
mocker.patch.object(document, 'print')
mocker.patch.object(document, 'print_')

# test rejected dialog
mocker.patch.object(QtPrintSupport.QPrintDialog, 'exec_', return_value=QtWidgets.QDialog.Rejected)
Expand All @@ -60,7 +60,7 @@ def testOnPrint(self, widget, mocker):
widget.onPrint()

# Assure printing was not done
assert not document.print.called
assert not document.print_.called

# test accepted dialog
mocker.patch.object(QtPrintSupport.QPrintDialog, 'exec_', return_value=QtWidgets.QDialog.Accepted)
Expand Down

0 comments on commit e64b046

Please sign in to comment.