Commit e5d9a610 authored by James Harle's avatar James Harle
Browse files

Further QT4 > QT5

parent a1e57f44
......@@ -6,13 +6,13 @@ Created on 21 Jan 2015
# pylint: disable=E1103
# pylint: disable=no-name-in-module
# pylint: disable=E1002
from PyQt5 import QtGui
from PyQt5 import QtGui, QtWidgets
from .nemo_bdy_namelist_edit import NameListEditor
from .nemo_bdy_mask_gui import MatplotlibWidget
from PyQt5.QtGui import QSizePolicy
from PyQt5.QtWidgets import QSizePolicy
from PyQt5.Qt import Qt
class InputWindow(QtGui.QDialog):
class InputWindow(QtWidgets.QDialog):
'''
Input Window for editing pyNEMO settings
'''
......
......@@ -13,12 +13,12 @@ import os.path
from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt
from .nemo_bdy_mask import Mask
import logging
from PyQt5.QtGui import QSizePolicy
from PyQt5.QtWidgets import QSizePolicy
from matplotlib.colors import Normalize
mask_alpha = 0.3
from PyQt5 import QtGui
from PyQt5 import QtGui, QtWidgets
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from matplotlib.path import Path
......@@ -26,7 +26,7 @@ from matplotlib.transforms import Bbox
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
# pylint: disable=E1002
class MatplotlibWidget(QtGui.QWidget):
class MatplotlibWidget(QtWidgets.QWidget):
"""This class is a QWidget for pyNEMO mask plot"""
min_depth = 200.0
shelfbreak_dist = 200.0
......@@ -34,7 +34,7 @@ class MatplotlibWidget(QtGui.QWidget):
def __init__(self, parent=None, mask=None, min_depth = 200.0, shelfbreak_dist = 200.0,*args, **kwargs):
""" Initialises the mask, matplot and the navigation toolbar """
super(MatplotlibWidget, self).__init__(parent)
#QtGui.QWidget.__init__(self, parent)
#QtWidgets.QWidget.__init__(self, parent)
self.figure = Figure(*args, **kwargs)
self.canvas = FigureCanvas(self.figure)
self.mask = mask
......
......@@ -210,8 +210,8 @@ class Boundary:
t -- input 2D array
"""
sh = np.shape(t)
if (len(sh)> 2) or (sh[0] ==0) or (sh[1] == 0):
print('Warning: Shape of expected 2D array:', sh)
if (len(sh)> 2) or (sh[0] ==0) or (sh[1] == 0):
print('Warning: Shape of expected 2D array:', sh)
tlist = t.tolist()
sortt = []
indx = list(zip(*sorted([(val, i) for i,val in enumerate(tlist)])))[1]
......@@ -224,7 +224,7 @@ class Boundary:
indx[i] = -1
# all the rows are identical, set the first as the unique row
if sortt[0] == sortt[-1]:
indx[0] = 0
indx[0] = 0
return indx[indx != -1]
......@@ -68,7 +68,7 @@ class Depth:
v_ind = sub2ind(mbathy.shape, bdy_v[:,0], bdy_v[:,1])
v_ind2 = sub2ind(mbathy.shape, bdy_v[:,0], bdy_v[:,1] + 1)
[tmp_zt, tmp_zw] = e3_to_depth(np.squeeze(nc['e3t'][:,:,:,:]), np.squeeze(nc['e3w'][:,:,:,:]), nz)
[tmp_zt, tmp_zw] = e3_to_depth(np.squeeze(nc['e3t'][:,:,:,:]), np.squeeze(nc['e3w'][:,:,:,:]), nz)
# This is very slow
self.logger.debug( 'starting nc reads loop' )
for k in range(nz):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment