Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ IDE: (eg. PyCharm)

**Package versions**
TO GET ALL RELEVANT PACKAGE VERSIONS, RUN THIS COMMAND IN BASH AND PASTE THE OUTPUT
pip freeze | grep -i "pyqt\|pandasgui\|plotly\|ipython\|jupyter\|notebook"
pip freeze | grep -i "pyqt\|pyside\|pandasgui\|plotly\|ipython\|jupyter\|notebook"

EXAMPLE OUTPUT
```
Expand Down
4 changes: 2 additions & 2 deletions demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
show(**all_datasets)

# The only reserved argument name is `settings`, which accepts a dictionary of settings for the GUI.
show(pokemon, settings={'theme':'dark', ''})
show(pokemon, settings={'theme':'dark'})
# PandasGUI will attempt to convert any object you pass to `show` into a DataFrame
show(test1={'a': [1, 2, 3]}, test2=[5, 6, 7, 8, 9])

Expand All @@ -21,4 +21,4 @@
pokemon_new = gui['pokemon']

# Use the `pg` IPython magic command to directly modify DataFrames in the GUI
%pg pokemon['Null Type'] = pokemon['Type 1'].isna()
# %pg pokemon['Null Type'] = pokemon['Type 1'].isna()
4 changes: 2 additions & 2 deletions pandasgui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from dataclasses import dataclass
import pandas as pd
import pkg_resources
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import Qt
from qtpy import QtCore, QtGui, QtWidgets
from qtpy.QtCore import Qt

import pandasgui
from pandasgui.store import PandasGuiStore
Expand Down
4 changes: 2 additions & 2 deletions pandasgui/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from typing_extensions import Literal
import pandas as pd
from pandas import DataFrame
from PyQt5 import QtCore, QtWidgets
from qtpy import QtCore, QtWidgets
import traceback
from datetime import datetime
from pandasgui.utility import unique_name, in_interactive_console, refactor_variable, clean_dataframe, nunique, \
Expand Down Expand Up @@ -98,7 +98,7 @@ def __setattr__(self, key, value):

@dataclass
class SettingsStore(DictLike, QtCore.QObject):
settingsChanged = QtCore.pyqtSignal()
settingsChanged = QtCore.Signal()

block: Setting
editable: Setting
Expand Down
4 changes: 2 additions & 2 deletions pandasgui/utility.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
import pandas as pd
from PyQt5 import QtWidgets
from qtpy import QtWidgets
from typing import List, Union
import sys
import inspect
Expand Down Expand Up @@ -319,7 +319,7 @@ def test_logging():

# Resize a widget to a percentage of the screen size
def resize_widget(widget, x, y):
from PyQt5 import QtCore, QtWidgets
from qtpy import QtCore, QtWidgets
widget.resize(QtCore.QSize(int(x * QtWidgets.QDesktopWidget().screenGeometry().width()),
int(y * QtWidgets.QDesktopWidget().screenGeometry().height())))

Expand Down
6 changes: 3 additions & 3 deletions pandasgui/widgets/base_widgets.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from PyQt5 import QtGui, QtWidgets
from PyQt5.QtCore import pyqtSignal
from qtpy import QtGui, QtWidgets
from qtpy.QtCore import Signal


class QTreeWidget(QtWidgets.QTreeWidget):
onDropSignal = pyqtSignal()
onDropSignal = Signal()

# Autosize columns
def showEvent(self, event: QtGui.QShowEvent):
Expand Down
2 changes: 1 addition & 1 deletion pandasgui/widgets/code_history_viewer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import sys

from PyQt5 import QtCore, QtGui, QtWidgets
from qtpy import QtCore, QtGui, QtWidgets

from pandasgui.store import PandasGuiDataFrameStore, SETTINGS_STORE
import pandasgui
Expand Down
2 changes: 1 addition & 1 deletion pandasgui/widgets/collapsible_panel.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from PyQt5 import QtWidgets
from qtpy import QtWidgets


class CollapsiblePanel(QtWidgets.QGroupBox):
Expand Down
2 changes: 1 addition & 1 deletion pandasgui/widgets/column_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import sys

from PyQt5 import QtCore, QtGui, QtWidgets
from qtpy import QtCore, QtGui, QtWidgets

from pandasgui.store import PandasGuiDataFrameStore

Expand Down
8 changes: 4 additions & 4 deletions pandasgui/widgets/column_viewer.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import sys

from PyQt5 import QtWidgets, QtGui, QtCore
from PyQt5.QtCore import Qt, pyqtSignal
from PyQt5.QtGui import QMouseEvent
from qtpy import QtWidgets, QtGui, QtCore
from qtpy.QtCore import Qt, Signal
from qtpy.QtGui import QMouseEvent

from pandasgui.store import PandasGuiDataFrameStore
from pandasgui.utility import nunique
from pandasgui.widgets import base_widgets


class FlatDraggableTree(base_widgets.QTreeWidget):
mouseReleaseEventSignal = pyqtSignal(QMouseEvent)
mouseReleaseEventSignal = Signal(QMouseEvent)

def __init__(self):
super().__init__()
Expand Down
2 changes: 1 addition & 1 deletion pandasgui/widgets/containers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from PyQt5 import QtWidgets
from qtpy import QtWidgets


class Container(QtWidgets.QGroupBox):
Expand Down
4 changes: 2 additions & 2 deletions pandasgui/widgets/dataframe_explorer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
from typing import List
from PyQt5 import QtWidgets, QtGui, QtCore
from PyQt5.QtCore import Qt
from qtpy import QtWidgets, QtGui, QtCore
from qtpy.QtCore import Qt
from pandasgui.widgets.code_history_viewer import CodeHistoryViewer

from pandasgui.widgets.containers import Container
Expand Down
4 changes: 2 additions & 2 deletions pandasgui/widgets/dataframe_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import numpy as np
import pandas as pd
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import Qt
from qtpy import QtCore, QtGui, QtWidgets
from qtpy.QtCore import Qt
from typing_extensions import Literal
from pandasgui.store import PandasGuiDataFrameStore
import pandasgui
Expand Down
24 changes: 12 additions & 12 deletions pandasgui/widgets/detachable_tab_widget.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# https://stackoverflow.com/q/47267195/3620725

from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.QtCore import pyqtSignal, pyqtSlot
from qtpy import QtGui, QtCore, QtWidgets
from qtpy.QtCore import Signal, Slot


class DetachableTabWidget(QtWidgets.QTabWidget):
Expand Down Expand Up @@ -33,7 +33,7 @@ def setMovable(self, movable):
#
# @param fromIndex the original index location of the tab
# @param toIndex the new index location of the tab
@pyqtSlot(int, int)
@Slot(int, int)
def moveTab(self, fromIndex, toIndex):
widget = self.widget(fromIndex)
icon = self.tabIcon(fromIndex)
Expand All @@ -49,7 +49,7 @@ def moveTab(self, fromIndex, toIndex):
#
# @param index the index location of the tab to be detached
# @param point the screen position for creating the new DetachedTab window
@pyqtSlot(int, QtCore.QPoint)
@Slot(int, QtCore.QPoint)
def detachTab(self, index, point):

# Get the tab content
Expand Down Expand Up @@ -162,7 +162,7 @@ def removeTabByName(self, name):
# determined that the drop occurred on an
# existing tab)
# @param dropPos the mouse cursor position when the drop occurred
@QtCore.pyqtSlot(str, int, QtCore.QPoint)
@QtCore.Slot(str, int, QtCore.QPoint)
def detachedTabDrop(self, name, index, dropPos):

# If the drop occurred on an existing tab, insert the detached
Expand Down Expand Up @@ -217,8 +217,8 @@ def closeDetachedTabs(self):
# When a tab is detached, the contents are placed into this QMainWindow. The tab
# can be re-attached by closing the dialog or by dragging the window into the tab bar
class DetachedTab(QtWidgets.QMainWindow):
onCloseSignal = pyqtSignal(QtWidgets.QWidget, str, QtGui.QIcon)
onDropSignal = pyqtSignal(str, QtCore.QPoint)
onCloseSignal = Signal(QtWidgets.QWidget, str, QtGui.QIcon)
onDropSignal = Signal(str, QtCore.QPoint)

def __init__(self, name, contentWidget):
QtWidgets.QMainWindow.__init__(self, None)
Expand All @@ -238,7 +238,7 @@ def __init__(self, name, contentWidget):
# Handle a window drop event
#
# @param dropPos the mouse cursor position of the drop
@QtCore.pyqtSlot(QtCore.QPoint)
@QtCore.Slot(QtCore.QPoint)
def windowDropSlot(self, dropPos):
self.onDropSignal.emit(self.objectName(), dropPos)

Expand All @@ -253,7 +253,7 @@ def closeEvent(self, event):
##
# An event filter class to detect a QMainWindow drop event
class WindowDropFilter(QtCore.QObject):
onDropSignal = pyqtSignal(QtCore.QPoint)
onDropSignal = Signal(QtCore.QPoint)

def __init__(self):
QtCore.QObject.__init__(self)
Expand Down Expand Up @@ -285,9 +285,9 @@ def eventFilter(self, obj, event):
##
# The TabBar class re-implements some of the functionality of the QTabBar widget
class TabBar(QtWidgets.QTabBar):
onDetachTabSignal = pyqtSignal(int, QtCore.QPoint)
onMoveTabSignal = pyqtSignal(int, int)
detachedTabDropSignal = pyqtSignal(str, int, QtCore.QPoint)
onDetachTabSignal = Signal(int, QtCore.QPoint)
onMoveTabSignal = Signal(int, int)
detachedTabDropSignal = Signal(str, int, QtCore.QPoint)

def __init__(self, parent=None):
QtWidgets.QTabBar.__init__(self, parent)
Expand Down
2 changes: 1 addition & 1 deletion pandasgui/widgets/dialogs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys

from PyQt5 import QtWidgets
from qtpy import QtWidgets



Expand Down
6 changes: 3 additions & 3 deletions pandasgui/widgets/dock_widget.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import Qt
from qtpy import QtCore, QtGui, QtWidgets
from qtpy.QtCore import Qt


class DockWidget(QtWidgets.QDockWidget):
# This signal is used to track which dock is considered active or focussed
activated = QtCore.pyqtSignal()
activated = QtCore.Signal()

def __init__(self, title: str, pgdf_name: str = 'Untitled'):
super().__init__(title)
Expand Down
18 changes: 9 additions & 9 deletions pandasgui/widgets/figure_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import sys
import tempfile

from PyQt5 import QtCore, QtGui, QtWidgets, sip
from PyQt5.QtCore import Qt
import PyQt5
from qtpy import QtCore, QtGui, QtWidgets, sip
from qtpy.QtCore import Qt
import qtpy
import logging

from pandasgui.store import PandasGuiStoreItem
Expand All @@ -19,31 +19,31 @@
# we need to hack around this import restriction on QtWebEngineWidgets
# https://stackoverflow.com/a/57436077/3620725

if "PyQt5.QtWebEngineWidgets" not in sys.modules:
if "qtpy.QtWebEngineWidgets" not in sys.modules:
app = QtWidgets.QApplication.instance()

if app is None:
from PyQt5 import QtWebEngineWidgets
from qtpy import QtWebEngineWidgets
else:
logger.warning("Reinitializing existing QApplication to allow import of QtWebEngineWidgets. "
"This may cause problems. "
"To avoid this, import pandasgui or PyQt5.QtWebEngineWidgets before a QApplication is created.")
"To avoid this, import pandasgui or QtWebEngineWidgets before a QApplication is created.")
app.quit()
sip.delete(app)
from PyQt5 import QtWebEngineWidgets
from qtpy import QtWebEngineWidgets

app.__init__(sys.argv + ["--ignore-gpu-blacklist", "--enable-gpu-rasterization"])


class FigureViewer(PyQt5.QtWebEngineWidgets.QWebEngineView, PandasGuiStoreItem):
class FigureViewer(qtpy.QtWebEngineWidgets.QWebEngineView, PandasGuiStoreItem):
def __init__(self, fig=None, store=None):
super().__init__()
self.store = store
self.page().profile().downloadRequested.connect(self.on_downloadRequested)

# Fix scrollbar sometimes disappearing after Plotly autosizes and leaving behind white space
self.settings().setAttribute(self.settings().ShowScrollBars, False)
self.settings().setAttribute(PyQt5.QtWebEngineWidgets.QWebEngineSettings.WebGLEnabled, True)
self.settings().setAttribute(qtpy.QtWebEngineWidgets.QWebEngineSettings.WebGLEnabled, True)

# https://stackoverflow.com/a/8577226/3620725
self.temp_file = tempfile.NamedTemporaryFile(mode="w", suffix=".html", delete=False)
Expand Down
8 changes: 4 additions & 4 deletions pandasgui/widgets/filter_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import re
import sys

from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QDesktopServices
from PyQt5.QtCore import QUrl
from qtpy import QtCore, QtGui, QtWidgets
from qtpy.QtCore import Qt
from qtpy.QtGui import QDesktopServices
from qtpy.QtCore import QUrl
from pandasgui.utility import nunique, unique

from pandasgui.store import PandasGuiDataFrameStore
Expand Down
Loading