[refactor] v2: use absolute imports (v2.*) everywhere instead of relative

Mechanical conversion of every relative import under v2/ to an absolute v2.* path
(from .x / ..x / ...x -> from v2.<pkg>.x) so imports are unambiguous, grep-able, and
stable when code is copied/moved between entrypoints (VideoGenerator, CLI, server).

Surgical prefix-only rewrite: only the 'from <dots><module>' prefix changed — import
names, parentheses, multi-line formatting, comments, and ordering are byte-for-byte
preserved (no collapsing, no reorder, no unrelated reformatting).

- 471 imports across 125 files; v2/tests/ was already absolute (untouched).
- Validated: all 125 files compile, every 'from v2.* import' target resolves to a real
  module/package, zero relative imports remain (full sweep), CPU mini suite green
  (202 passed, 2 skipped).
This commit is contained in:
SolitaryThinker
2026-07-04 17:15:34 +00:00
committed by Peiyuan Zhang
parent c6d2976fc2
commit 4e331eb7ff
125 changed files with 471 additions and 471 deletions
+4 -4
View File
@@ -1,8 +1,8 @@
"""Loop plane — driven loops + policies (design_v3 §5)."""
from __future__ import annotations
from .._enums import LoopKind, WorkUnitKind
from .contracts import (
from v2._enums import LoopKind, WorkUnitKind
from v2.loop.contracts import (
CacheOp,
CachePlan,
Done,
@@ -17,8 +17,8 @@ from .contracts import (
StepResult,
WorkPlan,
)
from .driver import LoopRunner
from .sampler import add_noise, build_flow_sigmas, flow_match_euler_step, x0_from_velocity
from v2.loop.driver import LoopRunner
from v2.loop.sampler import add_noise, build_flow_sigmas, flow_match_euler_step, x0_from_velocity
__all__ = [
"Loop", "LoopContext", "LoopState", "LoopResult", "WorkPlan", "Done", "StepResult",
+3 -3
View File
@@ -26,9 +26,9 @@ from __future__ import annotations
from dataclasses import dataclass, field
from typing import Any, Protocol, runtime_checkable
from .._enums import ExecutionProfile, WorkUnitKind
from .._types import TensorLike
from ..request.streams import StreamChunk
from v2._enums import ExecutionProfile, WorkUnitKind
from v2._types import TensorLike
from v2.request.streams import StreamChunk
# --------------------------------------------------------------------------- #
+1 -1
View File
@@ -10,7 +10,7 @@ from __future__ import annotations
from typing import Any
from .contracts import Done, LoopContext, LoopResult, LoopState, WorkPlan
from v2.loop.contracts import Done, LoopContext, LoopResult, LoopState, WorkPlan
class LoopRunner:
+2 -2
View File
@@ -1,7 +1,7 @@
"""Policies — the default step decomposition (design_v3 §5.1, §6.2.3)."""
from __future__ import annotations
from .base import (
from v2.loop.policies.base import (
BoundaryTimestepRouting,
ConditioningInjector,
ExpertRouting,
@@ -10,7 +10,7 @@ from .base import (
PassthroughConditioning,
PrecisionPolicy,
)
from .cfg import (
from v2.loop.policies.cfg import (
AdaptiveGateCFG,
BatchedCFG,
CFGPolicy,
+2 -2
View File
@@ -15,8 +15,8 @@ from typing import Any
import numpy as np
from ..contracts import StepContext
from ..sampler import build_flow_sigmas
from v2.loop.contracts import StepContext
from v2.loop.sampler import build_flow_sigmas
# --------------------------------------------------------------------------- #
+1 -1
View File
@@ -17,7 +17,7 @@ from typing import Any
import numpy as np
from ..contracts import StepContext
from v2.loop.contracts import StepContext
class CFGPolicy(ABC):