chore(lint): adaptive_threshold imports + entry_validator top-level import
- Sequence importato da collections.abc invece di typing (PYI001). - compute_adaptive_threshold spostato a top-level (PLC0415): niente circular dep risk perché adaptive_threshold non importa da entry_validator. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,8 +8,8 @@ Deterministic, no I/O. La query del repository è effettuata dal caller
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Sequence
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from typing import Sequence
|
|
||||||
|
|
||||||
__all__ = ["compute_adaptive_threshold"]
|
__all__ = ["compute_adaptive_threshold"]
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ from decimal import Decimal
|
|||||||
from pydantic import BaseModel, ConfigDict
|
from pydantic import BaseModel, ConfigDict
|
||||||
|
|
||||||
from cerbero_bite.config import SpreadType, StrategyConfig
|
from cerbero_bite.config import SpreadType, StrategyConfig
|
||||||
|
from cerbero_bite.core.adaptive_threshold import compute_adaptive_threshold
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"EntryContext",
|
"EntryContext",
|
||||||
@@ -159,10 +160,6 @@ def validate_entry(ctx: EntryContext, cfg: StrategyConfig) -> EntryDecision:
|
|||||||
# soglia statica `iv_minus_rv_min`.
|
# soglia statica `iv_minus_rv_min`.
|
||||||
if entry_cfg.iv_minus_rv_filter_enabled and ctx.iv_minus_rv is not None:
|
if entry_cfg.iv_minus_rv_filter_enabled and ctx.iv_minus_rv is not None:
|
||||||
if entry_cfg.iv_minus_rv_adaptive_enabled:
|
if entry_cfg.iv_minus_rv_adaptive_enabled:
|
||||||
from cerbero_bite.core.adaptive_threshold import (
|
|
||||||
compute_adaptive_threshold,
|
|
||||||
)
|
|
||||||
|
|
||||||
threshold = compute_adaptive_threshold(
|
threshold = compute_adaptive_threshold(
|
||||||
history=ctx.iv_rv_history,
|
history=ctx.iv_rv_history,
|
||||||
percentile=entry_cfg.iv_minus_rv_percentile,
|
percentile=entry_cfg.iv_minus_rv_percentile,
|
||||||
|
|||||||
Reference in New Issue
Block a user