diff --git a/src/cerbero_bite/core/adaptive_threshold.py b/src/cerbero_bite/core/adaptive_threshold.py index 0fbc334..0a77133 100644 --- a/src/cerbero_bite/core/adaptive_threshold.py +++ b/src/cerbero_bite/core/adaptive_threshold.py @@ -8,8 +8,8 @@ Deterministic, no I/O. La query del repository รจ effettuata dal caller from __future__ import annotations +from collections.abc import Sequence from decimal import Decimal -from typing import Sequence __all__ = ["compute_adaptive_threshold"] diff --git a/src/cerbero_bite/core/entry_validator.py b/src/cerbero_bite/core/entry_validator.py index a823a9a..c9cd5ae 100644 --- a/src/cerbero_bite/core/entry_validator.py +++ b/src/cerbero_bite/core/entry_validator.py @@ -15,6 +15,7 @@ from decimal import Decimal from pydantic import BaseModel, ConfigDict from cerbero_bite.config import SpreadType, StrategyConfig +from cerbero_bite.core.adaptive_threshold import compute_adaptive_threshold __all__ = [ "EntryContext", @@ -159,10 +160,6 @@ def validate_entry(ctx: EntryContext, cfg: StrategyConfig) -> EntryDecision: # 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_adaptive_enabled: - from cerbero_bite.core.adaptive_threshold import ( - compute_adaptive_threshold, - ) - threshold = compute_adaptive_threshold( history=ctx.iv_rv_history, percentile=entry_cfg.iv_minus_rv_percentile,