Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
thopri
PyNEMO
Commits
e5d9a610
Commit
e5d9a610
authored
5 years ago
by
James Harle
Browse files
Options
Download
Email Patches
Plain Diff
Further QT4 > QT5
parent
a1e57f44
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
pynemo/gui/nemo_bdy_input_window.py
pynemo/gui/nemo_bdy_input_window.py
+3
-3
pynemo/gui/nemo_bdy_mask_gui.py
pynemo/gui/nemo_bdy_mask_gui.py
+4
-4
pynemo/nemo_bdy_gen_c.py
pynemo/nemo_bdy_gen_c.py
+3
-3
pynemo/nemo_bdy_zgrv2.py
pynemo/nemo_bdy_zgrv2.py
+1
-1
No files found.
pynemo/gui/nemo_bdy_input_window.py
View file @
e5d9a610
...
...
@@ -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.Qt
Gui
import
QSizePolicy
from
PyQt5.Qt
Widgets
import
QSizePolicy
from
PyQt5.Qt
import
Qt
class
InputWindow
(
Qt
Gui
.
QDialog
):
class
InputWindow
(
Qt
Widgets
.
QDialog
):
'''
Input Window for editing pyNEMO settings
'''
...
...
This diff is collapsed.
Click to expand it.
pynemo/gui/nemo_bdy_mask_gui.py
View file @
e5d9a610
...
...
@@ -13,12 +13,12 @@ import os.path
from
PyQt5.QtCore
import
pyqtSignal
,
pyqtSlot
,
Qt
from
.nemo_bdy_mask
import
Mask
import
logging
from
PyQt5.Qt
Gui
import
QSizePolicy
from
PyQt5.Qt
Widgets
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
(
Qt
Gui
.
QWidget
):
class
MatplotlibWidget
(
Qt
Widgets
.
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
)
#Qt
Gui
.QWidget.__init__(self, parent)
#Qt
Widgets
.QWidget.__init__(self, parent)
self
.
figure
=
Figure
(
*
args
,
**
kwargs
)
self
.
canvas
=
FigureCanvas
(
self
.
figure
)
self
.
mask
=
mask
...
...
This diff is collapsed.
Click to expand it.
pynemo/nemo_bdy_gen_c.py
View file @
e5d9a610
...
...
@@ -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
]
This diff is collapsed.
Click to expand it.
pynemo/nemo_bdy_zgrv2.py
View file @
e5d9a610
...
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment