This commit is contained in:
parent
a7ba0f950b
commit
a604397c41
|
|
@ -312,7 +312,7 @@ _PHASE1_RE = re.compile(r"(\d+)/(\d+)\s+scanned\s+valid=(\d+)")
|
|||
class _WorkerSignals(QObject):
|
||||
progress = Signal(int, int, int, int, float)
|
||||
status = Signal(str)
|
||||
done = Signal(object, object, object, int)
|
||||
done = Signal(int)
|
||||
error = Signal(str)
|
||||
stopped = Signal()
|
||||
|
||||
|
|
@ -1798,6 +1798,9 @@ class ScreenerPage(QWidget):
|
|||
self._df = None
|
||||
self._df_raw = None
|
||||
self._sector_stats = {}
|
||||
self._pending_df_raw = None
|
||||
self._pending_df_scored = None
|
||||
self._pending_sector_stats = {}
|
||||
self._stop_event = threading.Event()
|
||||
self._run_id = 0
|
||||
self._rescoring = False
|
||||
|
|
@ -2019,7 +2022,11 @@ class ScreenerPage(QWidget):
|
|||
signals.status.emit(f"Computing scores for {len(df_raw)} stocks…")
|
||||
df_scored = score_stocks(df_raw, weights=settings.get("weights"), sector_stats=sector_stats)
|
||||
_log(f"score_stocks done: {len(df_scored)} rows")
|
||||
signals.done.emit(df_raw, df_scored, sector_stats, len(df_scored))
|
||||
# Store results in instance vars — avoids passing large objects through signal
|
||||
self._pending_df_raw = df_raw
|
||||
self._pending_df_scored = df_scored
|
||||
self._pending_sector_stats = sector_stats
|
||||
signals.done.emit(len(df_scored))
|
||||
_log("done signal emitted")
|
||||
except Exception as exc:
|
||||
_log(f"EXCEPTION: {_tb.format_exc()}")
|
||||
|
|
@ -2038,8 +2045,16 @@ class ScreenerPage(QWidget):
|
|||
def _on_status(self, text):
|
||||
self._status_lbl.setText(" " + text)
|
||||
|
||||
@Slot(object, object, object, int)
|
||||
def _on_done(self, df_raw, df_scored, sector_stats, total):
|
||||
@Slot(int)
|
||||
def _on_done(self, total):
|
||||
df_raw = getattr(self, "_pending_df_raw", None)
|
||||
df_scored = getattr(self, "_pending_df_scored", None)
|
||||
sector_stats = getattr(self, "_pending_sector_stats", {})
|
||||
if df_scored is None:
|
||||
self._status_lbl.setText(" Error: result data missing.")
|
||||
self._run_btn.setEnabled(True)
|
||||
self._stop_btn.setEnabled(False)
|
||||
return
|
||||
self._df_raw = df_raw
|
||||
self._df = df_scored
|
||||
self._sector_stats = sector_stats
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import requests
|
|||
# ---------------------------------------------------------------------------
|
||||
# Current app version — kept in sync by push_update.py before each build.
|
||||
# ---------------------------------------------------------------------------
|
||||
APP_VERSION = "1.4.6"
|
||||
APP_VERSION = "1.4.7"
|
||||
|
||||
|
||||
def _exe_dir() -> str:
|
||||
|
|
|
|||
Loading…
Reference in New Issue