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