mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 00:23:07 +00:00
chore: update to new syntax
This commit is contained in:
@@ -328,7 +328,7 @@ def refresh_backtest_ohlcv_data(
|
||||
erase: bool = False,
|
||||
data_format: str | None = None,
|
||||
prepend: bool = False,
|
||||
progress_tracker: Optional[ProgressLike] = None,
|
||||
progress_tracker: ProgressLike | None = None,
|
||||
) -> list[str]:
|
||||
"""
|
||||
Refresh stored ohlcv data for backtesting and hyperopt operations.
|
||||
@@ -495,7 +495,7 @@ def refresh_backtest_trades_data(
|
||||
new_pairs_days: int = 30,
|
||||
erase: bool = False,
|
||||
data_format: str = "feather",
|
||||
progress_tracker: Optional[ProgressLike] = None,
|
||||
progress_tracker: ProgressLike | None = None,
|
||||
) -> list[str]:
|
||||
"""
|
||||
Refresh stored trades data for backtesting and hyperopt operations.
|
||||
@@ -597,7 +597,7 @@ def download_data(
|
||||
config: Config,
|
||||
exchange: Exchange,
|
||||
*,
|
||||
progress_tracker: Optional[ProgressLike] = None,
|
||||
progress_tracker: ProgressLike | None = None,
|
||||
) -> None:
|
||||
"""
|
||||
Download data function. Used from both cli and API.
|
||||
|
||||
@@ -490,9 +490,9 @@ class PairListsPayload(ExchangeModePayloadMixin, BaseModel):
|
||||
|
||||
class DownloadDataPayload(ExchangeModePayloadMixin, BaseModel):
|
||||
pairs: list[str]
|
||||
timeframes: Optional[list[str]] = DL_DATA_TIMEFRAMES
|
||||
days: Optional[int] = None
|
||||
timerange: Optional[str] = None
|
||||
timeframes: list[str] | None = DL_DATA_TIMEFRAMES
|
||||
days: int | None = None
|
||||
timerange: str | None = None
|
||||
|
||||
@model_validator(mode="before")
|
||||
def check_mutually_exclusive(cls, values):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from contextlib import AbstractContextManager
|
||||
from typing import Optional, Protocol
|
||||
from typing import Protocol
|
||||
|
||||
from rich.progress import (
|
||||
BarColumn,
|
||||
@@ -20,7 +20,7 @@ class ProgressLike(Protocol, AbstractContextManager["ProgressLike"]):
|
||||
def update(self, task_id: TaskID, *, advance: float | None = None, **kwargs): ...
|
||||
|
||||
|
||||
def retrieve_progress_tracker(pt: Optional[ProgressLike]) -> ProgressLike:
|
||||
def retrieve_progress_tracker(pt: ProgressLike | None) -> ProgressLike:
|
||||
if pt is None:
|
||||
return get_progress_tracker()
|
||||
return pt
|
||||
|
||||
Reference in New Issue
Block a user