Skip to content

Commit

Permalink
We're not ready for unicode_literals in GUI layer either
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Jun 13, 2016
1 parent 023c7d7 commit 00354ae
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 27 deletions.
2 changes: 1 addition & 1 deletion MantidPlot/ipython_widget/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import (absolute_import, division,
print_function, unicode_literals)
print_function)

from .mantid_ipython_widget import *
3 changes: 1 addition & 2 deletions MantidPlot/ipython_widget/mantid_ipython_widget.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import (absolute_import, division,
print_function, unicode_literals)
print_function)

import inspect
import threading
Expand Down Expand Up @@ -82,4 +82,3 @@ def __init__(self, *args, **kw):

self.kernel_manager = kernel_manager
self.kernel_client = kernel_client

6 changes: 3 additions & 3 deletions MantidPlot/mantidplot.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#-------------------------------------------------------------------
# mantidplot.py
#
# Load 'pymantidplot' which cannot be called 'mantidplot' because of
#
# Load 'pymantidplot' which cannot be called 'mantidplot' because of
# name conflict with the MantidPlot binary (especially on osx)
#-------------------------------------------------------------------
from __future__ import (absolute_import, division,
print_function, unicode_literals)
print_function)

import pymantidplot
from pymantidplot import *
Expand Down
2 changes: 1 addition & 1 deletion MantidPlot/mantidplotrc.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
#----------------------------------------------
from __future__ import (absolute_import, division,
print_function, unicode_literals)
print_function)

if __name__ == '__main__':
from six import iteritems as _iteritems
Expand Down
6 changes: 3 additions & 3 deletions MantidPlot/pymantidplot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Requires that the main script be run from within MantidPlot
"""
from __future__ import (absolute_import, division,
print_function, unicode_literals)
print_function)
# Requires MantidPlot
try:
import _qti
Expand Down Expand Up @@ -201,7 +201,7 @@ def newTiledWindow(name=None, sources = None, ncols = None):

if ncols is None:
ncols = proxy.columnCount()

if not sources is None:
row = 0
col = 0
Expand Down Expand Up @@ -679,7 +679,7 @@ def getMantidMatrix(name):
"""Get a handle to the named Mantid matrix"""
return new_proxy(proxies.MantidMatrix, _qti.app.mantidUI.getMantidMatrix, name)


InstrumentWidget = mantidqtpython.MantidQt.MantidWidgets.InstrumentWidget
InstrumentWidgetRenderTab = mantidqtpython.MantidQt.MantidWidgets.InstrumentWidgetRenderTab
InstrumentWidgetPickTab = mantidqtpython.MantidQt.MantidWidgets.InstrumentWidgetPickTab
Expand Down
2 changes: 1 addition & 1 deletion MantidPlot/pymantidplot/proxies.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
reference to None, thus ensuring that further attempts at access do not cause a crash.
"""
from __future__ import (absolute_import, division,
print_function, unicode_literals)
print_function)

from PyQt4 import QtCore, QtGui
from PyQt4.QtCore import Qt, pyqtSlot
Expand Down
30 changes: 15 additions & 15 deletions MantidPlot/pymantidplot/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@
# File change history is stored at: <https://github.com/mantidproject/mantid>.
# Code Documentation is available at: <http://doxygen.mantidproject.org>
from __future__ import (absolute_import, division,
print_function, unicode_literals)
print_function)

try:
import _qti
Expand Down Expand Up @@ -761,10 +761,10 @@ def __is_array(arg):
"""
Is the argument a python or numpy list?
@param arg :: argument
Returns :: True if the argument is a python or numpy list
"""
return isinstance(arg, list) or isinstance(arg, np.ndarray)
return isinstance(arg, list) or isinstance(arg, np.ndarray)

def __is_array_or_int(arg):
"""
Expand Down Expand Up @@ -840,7 +840,7 @@ def __is_workspace(arg):
"""
Is the argument a Mantid MatrixWorkspace?
@param arg :: argument
Returns :: True if the argument a MatrixWorkspace
"""
return isinstance(arg, MatrixWorkspace)
Expand All @@ -849,7 +849,7 @@ def __is_array_of_workspaces(arg):
"""
Is the argument a sequence of Mantid MatrixWorkspaces?
@param arg :: argument
Returns :: True if the argument is a sequence of MatrixWorkspace
"""
return __is_array(arg) and len(arg) > 0 and __is_workspace(arg[0])
Expand All @@ -861,11 +861,11 @@ def __create_workspace(x, y, name="__array_dummy_workspace"):
@param x :: x array
@param y :: y array
@param name :: workspace name
Returns :: Workspace
"""
"""
alg = AlgorithmManager.create("CreateWorkspace")
alg.setChild(True)
alg.setChild(True)
alg.initialize()
# fake empty workspace (when doing plot([]), cause setProperty needs non-empty data)
if [] == x:
Expand All @@ -875,7 +875,7 @@ def __create_workspace(x, y, name="__array_dummy_workspace"):
alg.setProperty("DataX", x)
alg.setProperty("DataY", y)
name = name + "_" + str(Figure.fig_seq())
alg.setPropertyValue("OutputWorkspace", name)
alg.setPropertyValue("OutputWorkspace", name)
alg.execute()
ws = alg.getProperty("OutputWorkspace").value
ADS.addOrReplace(name, ws) # Cannot plot a workspace that is not in the ADS
Expand Down Expand Up @@ -1178,13 +1178,13 @@ def __process_multiplot_command(plots_seq, **kwargs):

def __translate_hold_kwarg(**kwargs):
"""
Helper function to translate from hold='on'/'off' kwarg to a True/False value for the
Helper function to translate from hold='on'/'off' kwarg to a True/False value for the
mantidplot window and window error_bars
@param kwargs :: keyword arguments passed to a plot function, this function only cares about hold. Any
value different from 'on' will be considered as 'off'
Returns :: tuple with a couple of values: True/False value for window, and True/False for clearWindow,
Returns :: tuple with a couple of values: True/False value for window, and True/False for clearWindow,
to be used with plotSpectrum, plotBin, etc.
"""
# window and clearWindow
Expand All @@ -1204,7 +1204,7 @@ def __translate_hold_kwarg(**kwargs):

def __translate_error_bars_kwarg(**kwargs):
"""
Helper function to translate from error_bars=True/False kwarg to a True/False value for the
Helper function to translate from error_bars=True/False kwarg to a True/False value for the
mantidplot error_bars argument
@param kwargs :: keyword arguments passed to a plot function. This function only cares about 'error_bars'.
Expand Down Expand Up @@ -1261,7 +1261,7 @@ def __plot_as_workspaces_list(*args, **kwargs):
Plot a series of workspaces
@param args :: curve data and options.
@param kwargs :: plot line options
Returns :: List of line objects
"""
# mantidplot.plotSpectrum can already handle 1 or more input workspaces.
Expand All @@ -1273,7 +1273,7 @@ def __plot_as_array(*args, **kwargs):
Plot from an array
@param args :: curve data and options.
@param kwargs :: plot line options
Returns :: the list of curves (1) included in the plot
"""
y = args[0]
Expand Down Expand Up @@ -1342,7 +1342,7 @@ def plot_bin(workspaces, indices, *args, **kwargs):
"""
X-Y plot of the bin counts in a workspace.
Plots one or more bin, selected by indices, using spectra numbers as x-axis and bin counts for
Plots one or more bin, selected by indices, using spectra numbers as x-axis and bin counts for
each spectrum as y-axis.
@param workspaces :: workspace or list of workspaces (both workspace objects and names accepted)
Expand Down
2 changes: 1 addition & 1 deletion MantidPlot/pymantidplot/qtiplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""
from __future__ import (absolute_import, division,
print_function, unicode_literals)
print_function)

# Require MantidPlot
try:
Expand Down

0 comments on commit 00354ae

Please sign in to comment.