Skip to content

Commit

Permalink
fix imports and update for newer qt versions to get talpa operational…
Browse files Browse the repository at this point in the history
… again
  • Loading branch information
emolch committed Mar 23, 2023
1 parent 81757ae commit 1cc13d4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
12 changes: 11 additions & 1 deletion kite/sources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@
PointCompoundSource,
)
from .okada import DislocProcessor, OkadaSource
from .pyrocko_gf import PyrockoMomentTensor, PyrockoProcessor, PyrockoRectangularSource
from .pyrocko_gf import (
PyrockoDoubleCouple,
PyrockoMomentTensor,
PyrockoProcessor,
PyrockoRectangularSource,
PyrockoRingfaultSource,
PyrockoVLVDSource,
)

__sources__ = [
OkadaSource,
PyrockoMomentTensor,
PyrockoRectangularSource,
PyrockoRingfaultSource,
PyrockoDoubleCouple,
PyrockoVLVDSource,
EllipsoidSource,
PointCompoundSource,
]
Expand Down
2 changes: 1 addition & 1 deletion kite/talpa/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def __init__(self, *args, **kwargs):
QtWidgets.QDialog.__init__(self, *args, **kwargs)

self.completer = QtWidgets.QCompleter()
self.completer_model = QtWidgets.QFileSystemModel(self.completer)
self.completer_model = QtGui.QFileSystemModel(self.completer)
self.completer.setModel(self.completer_model)
self.completer.setMaxVisibleItems(8)

Expand Down
2 changes: 1 addition & 1 deletion kite/talpa/multiplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def updateViews(self):
visible_plots = [plt for ip, plt in enumerate(self.plots) if config_mask[ip]]

for ip, plt in enumerate(visible_plots):
row = ip / 2
row = ip // 2
col = ip % 2 + 1

self.addItem(plt, row=row, col=col)
Expand Down
2 changes: 1 addition & 1 deletion kite/talpa/sources/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def __init__(self, delegate, ui_file, *args, **kwargs):
@QtCore.pyqtSlot()
def getSourceParameters(self):
for param, value in self.delegate.getSourceParameters().items():
self.__getattribute__(param).setValue(value)
self.__getattribute__(param).setValue(int(value))

@QtCore.pyqtSlot()
def setSourceParameters(self):
Expand Down
4 changes: 2 additions & 2 deletions kite/talpa/sources/pyrocko.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

import numpy as np
from PyQt5 import QtCore, QtGui
from PyQt5 import QtCore, QtGui, QtWidgets

from kite.sources import (
PyrockoDoubleCouple,
Expand All @@ -22,7 +22,7 @@ class PyrockoSourceDialog(SourceEditDialog):
def __init__(self, delegate, ui_file, *args, **kwargs):
SourceEditDialog.__init__(self, delegate, ui_file, *args, **kwargs)

self.completer = QtGui.QCompleter()
self.completer = QtWidgets.QCompleter()
self.completer_model = QtGui.QFileSystemModel(self.completer)
self.completer.setModel(self.completer_model)
self.completer.setMaxVisibleItems(8)
Expand Down
2 changes: 1 addition & 1 deletion kite/talpa/sources_dock.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def sizeHint(self, option, index):
doc.setHtml(options.text)
doc.setTextWidth(options.rect.width())

return QtCore.QSize(doc.idealWidth(), doc.size().height())
return QtCore.QSize(int(doc.idealWidth()), int(doc.size().height()))

class SourceContextMenu(QtWidgets.QMenu):
def __init__(self, parent, idx, *args, **kwargs):
Expand Down

0 comments on commit 1cc13d4

Please sign in to comment.