From eb0662e44d80f4f39f88bae22f434a1e7c8b054a Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 May 2026 23:20:54 +0000 Subject: [PATCH] chore(lint): adaptive_threshold imports + entry_validator top-level import MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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) --- src/cerbero_bite/core/adaptive_threshold.py | 2 +- src/cerbero_bite/core/entry_validator.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) 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,