Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GUI + Shuffle API Structure #31

Merged
merged 8 commits into from
Jul 21, 2023
Merged

Add GUI + Shuffle API Structure #31

merged 8 commits into from
Jul 21, 2023

Conversation

j9ac9k
Copy link
Collaborator

@j9ac9k j9ac9k commented Jul 21, 2023

This PR adds the doppkit-gui entry point, where a desktop application will launch if the required dependencies are installed (pip install doppkit[GUI]). The application is to be considered extreme BETA, there is no progress feedback incorporated yet, and while it has been demonstrated to work in limited cases, it is highly experimental.

To accommodate the GUI, significant restructuring of the project has been made. Type annotations have been added, and a Progress typing.Protocol object is added to grid.py that describes what methods and signatures need to be implemented for progress to be reported back should a developer not want to rely on the GUI or rich.

j9ac9k added 6 commits July 13, 2023 10:16
Earlier to get the GUI to work, we duplicated grid.py and cache.py
as asyncio.run needed to be called in a different place. This commit
reshuffles things around so the cache and grid methods can be called
from both Qt and Rich.
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

def columnCount(self, parent: QtCore.QModelIndex = QtCore.QModelIndex()) -> int:
return 1

def data(self, index: QtCore.QModelIndex, role=QtCore.Qt.ItemDataRole.DisplayRole) -> Optional[str]:

Check notice

Code scanning / CodeQL

Explicit returns mixed with implicit (fall through) returns

Mixing implicit and explicit returns may indicate an error as implicit returns always return None.
@@ -0,0 +1,117 @@
from typing import Optional, Union
from qtpy import QtCore, QtWidgets

Check notice

Code scanning / CodeQL

Unused import

Import of 'QtWidgets' is not used.
src/doppkit/__main__.py Show resolved Hide resolved
signal.signal(signal.SIGTERM, close)
qApp.aboutToQuit.connect(close)
with contextlib.suppress(asyncio.CancelledError):
await future

Check notice

Code scanning / CodeQL

Statement has no effect

This statement has no effect.
class Progress(Protocol):

def update(self, name: str, completed: int) -> None:
...

Check notice

Code scanning / CodeQL

Statement has no effect

This statement has no effect.

def create_task(self, name: str, total: int) -> None:
...

Check notice

Code scanning / CodeQL

Statement has no effect

This statement has no effect.
...

def complete_task(self, name: str) -> None:
...

Check notice

Code scanning / CodeQL

Statement has no effect

This statement has no effect.
for export_file in export_files:
filename = export_file["name"]
download_url = export_file["url"]
size = export_file.get("filesize", 0)

Check notice

Code scanning / CodeQL

Unused local variable

Variable size is not used.
@@ -0,0 +1,46 @@
from typing import Iterable, Union, TYPE_CHECKING

Check notice

Code scanning / CodeQL

Unused import

Import of 'TYPE_CHECKING' is not used.
@@ -0,0 +1,285 @@
import os
from .. import __version__
from ..grid import Grid, AOI, Exportfile, Export

Check notice

Code scanning / CodeQL

Unused import

Import of 'Exportfile' is not used. Import of 'Export' is not used.
@j9ac9k j9ac9k merged commit ff18b21 into hobuinc:main Jul 21, 2023
@j9ac9k j9ac9k deleted the add-gui branch July 21, 2023 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant