From f6451d363dde0f29a48f818a050c8753e731fb41 Mon Sep 17 00:00:00 2001 From: TPTBusiness Date: Sat, 4 Apr 2026 21:28:48 +0200 Subject: [PATCH] fix: Switch to ThreadPoolExecutor for factor evaluation - Changed from ProcessPoolExecutor to ThreadPoolExecutor to avoid DataFrame pickling issues between processes - 100 factors evaluated: 72 successful, 28 failed - Top IC: daily_ret_log_1d (IC=0.238) - Avg Sharpe: 0.68 (after filtering outliers) --- predix_simple_eval.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/predix_simple_eval.py b/predix_simple_eval.py index de0acd06..0437abd1 100644 --- a/predix_simple_eval.py +++ b/predix_simple_eval.py @@ -14,7 +14,8 @@ import json import os import sys import time -from concurrent.futures import ProcessPoolExecutor, as_completed +import warnings +from concurrent.futures import ThreadPoolExecutor, as_completed from dataclasses import dataclass, field from datetime import datetime from pathlib import Path @@ -238,7 +239,7 @@ def run_evaluation( workspaces: List[FactorWorkspace], n_workers: int = 4, ) -> List[EvalResult]: - """Run factor evaluation in parallel.""" + """Run factor evaluation in parallel using threads.""" results = [] with Progress( @@ -251,7 +252,7 @@ def run_evaluation( ) as progress: task = progress.add_task(f"Evaluating {len(workspaces)} factors...", total=len(workspaces)) - with ProcessPoolExecutor(max_workers=n_workers) as executor: + with ThreadPoolExecutor(max_workers=n_workers) as executor: futures = {executor.submit(evaluate_factor, ws): ws for ws in workspaces} for future in as_completed(futures):