Leomrlin commented on code in PR #737:
URL: https://github.com/apache/geaflow/pull/737#discussion_r2791241022


##########
geaflow-ai/src/operator/casts/tests/test_execution_lifecycle.py:
##########
@@ -0,0 +1,580 @@
+"""Unit tests for Execution Lifecycle (Precheck → Execute → Postcheck)."""
+
+from unittest.mock import Mock
+
+from casts.core.config import DefaultConfiguration
+from casts.simulation.engine import SimulationEngine
+from casts.simulation.metrics import MetricsCollector
+
+
+class MockSKU:
+    """Mock SKU for testing."""
+
+    def __init__(self, confidence_score: float = 0.5):
+        self.confidence_score = confidence_score
+
+
+class TestExecutePrechecker:

Review Comment:
   Can these tests be added, either in full or in part, to the GitHub CI/CD 
system for execution?



##########
geaflow-ai/src/operator/casts/casts/utils/helpers.py:
##########
@@ -0,0 +1,250 @@
+"""Utility functions for JSON parsing, similarity calculations, and 
mathematical operations."""
+
+import json
+import math
+import re
+from typing import Any
+import uuid
+
+import numpy as np
+
+from casts.core.models import StrategyKnowledgeUnit
+
+
+def cosine_similarity(vector1: np.ndarray, vector2: np.ndarray) -> float:
+    """
+    Calculate cosine similarity between two vectors.
+
+    Args:
+        vector1: First vector
+        vector2: Second vector
+
+    Returns:
+        Cosine similarity score between 0 and 1
+    """
+    norm1 = np.linalg.norm(vector1)
+    norm2 = np.linalg.norm(vector2)
+    if norm1 == 0 or norm2 == 0:
+        return 0.0
+    return np.dot(vector1, vector2) / (norm1 * norm2)
+
+
+def calculate_dynamic_similarity_threshold(
+    sku: StrategyKnowledgeUnit, kappa: float = 0.05, beta: float = 0.2
+) -> float:
+    """
+    Calculate dynamic similarity threshold based on manifold density.
+
+    Mathematical formula (see 数学建模.md Section 4.6.2, line 952):

Review Comment:
   Where is this `.md` document?



##########
geaflow-ai/src/operator/casts/pyproject.toml:
##########
@@ -0,0 +1,92 @@
+[project]
+name = "CASTS"
+version = "0.1.0"
+description = "CASTS: ..."
+authors = [
+    {name = "Kuda", email = "[email protected]"}
+]
+requires-python = ">=3.10,<3.12"
+dependencies = [

Review Comment:
   Please carefully review the open-source licenses of externally referenced 
projects to ensure compliance with Apache open-source project conventions.



##########
geaflow-ai/src/operator/casts/pyproject.toml:
##########
@@ -0,0 +1,92 @@
+[project]
+name = "CASTS"
+version = "0.1.0"
+description = "CASTS: ..."
+authors = [
+    {name = "Kuda", email = "[email protected]"}
+]
+requires-python = ">=3.10,<3.12"
+dependencies = [
+    "openai>=1.86.0",
+    "numpy>=2.0.0",
+    "matplotlib>=3.8.0",
+    "networkx>=3.2.0",
+    "python-dotenv>=0.21.0",
+    "pytest>=8.4.0",
+    "mypy>=1.19.1",
+    "types-networkx>=3.6.1.20251220",
+    "ruff>=0.14.9",
+]
+
+[project.optional-dependencies]
+dev = [
+    "pytest>=8.4.0",
+    "ruff>=0.11.13",
+    "mypy>=1.18.1",
+]
+service = [
+    "flask==3.1.1",
+    "flask-sqlalchemy==3.1.1",
+    "flask-cors==6.0.1",
+]
+test = [
+    "pytest==8.4.0",
+    "pytest-cov==6.2.1",
+    "pytest-mock>=3.14.1",
+    "pytest-asyncio>=0.24.0",
+]
+
+[build-system]
+requires = ["hatchling"]
+build-backend = "hatchling.build"
+
+[[tool.uv.index]]
+name = "aliyun"
+url = "https://mirrors.aliyun.com/pypi/simple/";

Review Comment:
   Avoid binding to specific third-party mirror sources here to maintain Apache 
project compliance. However, a few can be recommended in the form of 
annotations.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to