refactor: rename project from Predix to NexQuant

Rename all source files, scripts, tests, documentation, and configuration
from Predix/predix to NexQuant/nexquant across the entire codebase.
This commit is contained in:
TPTBusiness
2026-05-09 17:48:22 +02:00
parent 70029b4577
commit 9d6c6d1d5f
92 changed files with 3690 additions and 1015 deletions
+10 -10
View File
@@ -123,9 +123,9 @@ class TestWebDashboard:
class TestScriptsImportable:
def test_predix_full_eval(self):
def test_nexquant_full_eval(self):
import importlib
spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/predix_full_eval.py")
spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/nexquant_full_eval.py")
assert spec is not None
def test_extract_results(self):
@@ -153,24 +153,24 @@ class TestScriptsImportable:
spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/kronos_model_eval.py")
assert spec is not None
def test_predix_add_risk_management(self):
def test_nexquant_add_risk_management(self):
import importlib
spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/predix_add_risk_management.py")
spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/nexquant_add_risk_management.py")
assert spec is not None
def test_predix_gen_strategies(self):
def test_nexquant_gen_strategies(self):
import importlib
spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/predix_gen_strategies_real_bt.py")
spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/nexquant_gen_strategies_real_bt.py")
assert spec is not None
def test_predix_quick_daytrading(self):
def test_nexquant_quick_daytrading(self):
import importlib
spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/predix_quick_daytrading.py")
spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/nexquant_quick_daytrading.py")
assert spec is not None
def test_predix_rebacktest_unified(self):
def test_nexquant_rebacktest_unified(self):
import importlib
spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/predix_rebacktest_unified.py")
spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/nexquant_rebacktest_unified.py")
assert spec is not None
def test_realistic_backtest_all(self):
+3 -3
View File
@@ -196,7 +196,7 @@ class TestInfNanHandlingInsertion:
# =============================================================================
# Bug 5: scan_factors reads factor_code twice (predix_full_eval.py:174 + 195)
# Bug 5: scan_factors reads factor_code twice (nexquant_full_eval.py:174 + 195)
# =============================================================================
class TestScanFactorsDoubleRead:
@@ -205,9 +205,9 @@ class TestScanFactorsDoubleRead:
def test_factor_code_read_only_when_needed(self):
"""Confirm the scan_factors double-read behavior (line 174+195)."""
import inspect
from scripts import predix_full_eval
from scripts import nexquant_full_eval
source = inspect.getsource(predix_full_eval.scan_factors)
source = inspect.getsource(nexquant_full_eval.scan_factors)
# Count occurrences of `.read_text()`
count = source.count(".read_text()")
+3 -3
View File
@@ -18,8 +18,8 @@ class TestContinuousGenerator:
def test_module_imports(self):
import importlib.util
spec = importlib.util.spec_from_file_location(
"predix_autopilot",
PROJECT_ROOT / "scripts/predix_autopilot.py",
"nexquant_autopilot",
PROJECT_ROOT / "scripts/nexquant_autopilot.py",
)
assert spec is not None
@@ -107,6 +107,6 @@ class TestAutopilotIntegration:
def test_autopilot_pid_running(self):
import os
result = os.system("pgrep -f predix_autopilot > /dev/null 2>&1")
result = os.system("pgrep -f nexquant_autopilot > /dev/null 2>&1")
# 0 = running, 1 = not running — both are valid states
assert result in (0, 1)
@@ -1,4 +1,4 @@
"""Tests for scripts/predix_full_eval.py pure functions and dataclasses."""
"""Tests for scripts/nexquant_full_eval.py pure functions and dataclasses."""
from __future__ import annotations
@@ -13,7 +13,7 @@ sys.path.insert(0, str(PROJECT_ROOT))
class TestFactorInfo:
def test_construction(self):
from scripts.predix_full_eval import FactorInfo
from scripts.nexquant_full_eval import FactorInfo
fi = FactorInfo(
workspace_hash="abc123",
factor_name="test_factor",
@@ -26,7 +26,7 @@ class TestFactorInfo:
class TestEvalResult:
def test_defaults(self):
from scripts.predix_full_eval import EvalResult
from scripts.nexquant_full_eval import EvalResult
er = EvalResult(factor_name="f1", workspace_hash="h1")
assert er.status == ""
assert er.ic is None
@@ -34,7 +34,7 @@ class TestEvalResult:
assert er.non_null_count == 0
def test_failed_result(self):
from scripts.predix_full_eval import EvalResult
from scripts.nexquant_full_eval import EvalResult
er = EvalResult(
factor_name="f1", workspace_hash="h1",
status="failed", error_message="timeout",
@@ -43,7 +43,7 @@ class TestEvalResult:
assert er.error_message == "timeout"
def test_to_dict(self):
from scripts.predix_full_eval import EvalResult
from scripts.nexquant_full_eval import EvalResult
er = EvalResult(factor_name="f1", workspace_hash="h1", status="success", ic=0.05)
d = er.to_dict()
assert d["factor_name"] == "f1"
@@ -53,26 +53,26 @@ class TestEvalResult:
class TestExtractFactorDescription:
def test_docstring_extracted(self):
from scripts.predix_full_eval import _extract_factor_description
from scripts.nexquant_full_eval import _extract_factor_description
code = '"""This is a test factor.\nComputes momentum."""\nx=1'
desc = _extract_factor_description(code)
assert "test factor" in desc
def test_comment_extraction(self):
from scripts.predix_full_eval import _extract_factor_description
from scripts.nexquant_full_eval import _extract_factor_description
code = "# Momentum factor\n# Uses 20-bar window\nx=1"
desc = _extract_factor_description(code)
assert "Momentum factor" in desc
assert "20-bar window" in desc
def test_no_docstring_or_comments(self):
from scripts.predix_full_eval import _extract_factor_description
from scripts.nexquant_full_eval import _extract_factor_description
code = "x = 1\ny = 2\n"
desc = _extract_factor_description(code)
assert desc == "No description available"
def test_shebang_skipped(self):
from scripts.predix_full_eval import _extract_factor_description
from scripts.nexquant_full_eval import _extract_factor_description
code = "#!/usr/bin/env python\n# Real comment\nx=1"
desc = _extract_factor_description(code)
assert "Real comment" in desc
+2 -2
View File
@@ -16,10 +16,10 @@ PROJECT_ROOT = Path(__file__).parent.parent.parent
sys.path.insert(0, str(PROJECT_ROOT))
class TestPredixCLI:
class TestNexQuantCLI:
def test_cli_commands_available(self):
import subprocess
r = subprocess.run([sys.executable, "predix.py", "--help"], capture_output=True, text=True, timeout=10)
r = subprocess.run([sys.executable, "nexquant.py", "--help"], capture_output=True, text=True, timeout=10)
assert r.returncode == 0
for cmd in ["evaluate", "top", "best", "portfolio", "build-strategies", "generate-strategies", "health"]:
assert cmd in r.stdout.lower(), f"Missing command: {cmd}"