Skip to content

Commit

Permalink
cleaned up dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
pcolange committed Feb 11, 2025
1 parent 6e77423 commit fe8612c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 276 deletions.
3 changes: 2 additions & 1 deletion src/digest/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ def load_model(self, file_path: str) -> None:
self.load_progress.step()

self.load_progress.setLabelText(
"Creating a Digest model. Please be patient as this could take a minute."
"Creating a Digest model. "
"Please be patient as this could take a minute."
)

# Initialize worker variable
Expand Down
247 changes: 0 additions & 247 deletions src/digest/model_load.py

This file was deleted.

3 changes: 1 addition & 2 deletions src/digest/modelsummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import os
from datetime import datetime

# pylint: disable=invalid-name
from typing import Optional, Union
from typing import Optional

# pylint: disable=no-name-in-module
from PySide6.QtWidgets import QWidget, QTableWidgetItem
Expand Down
26 changes: 0 additions & 26 deletions src/digest/qt_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

# pylint: disable=no-name-in-module
from PySide6.QtWidgets import QWidget, QApplication
from PySide6.QtCore import QThread, QEventLoop, QTimer
from PySide6.QtCore import QFile, QTextStream

from digest.dialog import StatusDialog
Expand All @@ -15,31 +14,6 @@
BASE_STYLE_FILE = os.path.join(ROOT_FOLDER, "styles", "darkstyle.qss")


def wait_threads(threads: List[QThread], timeout=10000) -> bool:

loop = QEventLoop()
timer = QTimer()
timer.setSingleShot(True)
timer.timeout.connect(loop.quit)

def check_threads():
if all(thread.isFinished() for thread in threads):
loop.quit()

check_timer = QTimer()
check_timer.timeout.connect(check_threads)
check_timer.start(100) # Check every 100ms

timer.start(timeout)
loop.exec()

check_timer.stop()
timer.stop()

# Return True if all threads finished, False if timed out
return all(thread.isFinished() for thread in threads)


def get_ram_utilization() -> float:
mem = psutil.virtual_memory()
ram_util_perc = mem.percent
Expand Down

0 comments on commit fe8612c

Please sign in to comment.