From adc8ee88e2ec72aafe8c02af591127512dbf7ef8 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 10 Aug 2022 08:57:19 +0000 Subject: [PATCH] Move periodicCache to Utils package --- freqtrade/configuration/__init__.py | 1 - freqtrade/data/dataprovider.py | 2 +- freqtrade/plugins/pairlist/AgeFilter.py | 2 +- freqtrade/util/__init__.py | 2 ++ .../{configuration/PeriodicCache.py => util/periodic_cache.py} | 0 tests/test_periodiccache.py | 2 +- 6 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 freqtrade/util/__init__.py rename freqtrade/{configuration/PeriodicCache.py => util/periodic_cache.py} (100%) diff --git a/freqtrade/configuration/__init__.py b/freqtrade/configuration/__init__.py index cf41c0ca9..730a4e47f 100644 --- a/freqtrade/configuration/__init__.py +++ b/freqtrade/configuration/__init__.py @@ -4,5 +4,4 @@ from freqtrade.configuration.check_exchange import check_exchange from freqtrade.configuration.config_setup import setup_utils_configuration from freqtrade.configuration.config_validation import validate_config_consistency from freqtrade.configuration.configuration import Configuration -from freqtrade.configuration.PeriodicCache import PeriodicCache from freqtrade.configuration.timerange import TimeRange diff --git a/freqtrade/data/dataprovider.py b/freqtrade/data/dataprovider.py index e21f10193..21cead77f 100644 --- a/freqtrade/data/dataprovider.py +++ b/freqtrade/data/dataprovider.py @@ -12,12 +12,12 @@ from typing import Any, Dict, List, Optional, Tuple from pandas import DataFrame from freqtrade.configuration import TimeRange -from freqtrade.configuration.PeriodicCache import PeriodicCache from freqtrade.constants import ListPairsWithTimeframes, PairWithTimeframe from freqtrade.data.history import load_pair_history from freqtrade.enums import CandleType, RunMode from freqtrade.exceptions import ExchangeError, OperationalException from freqtrade.exchange import Exchange, timeframe_to_seconds +from freqtrade.util import PeriodicCache logger = logging.getLogger(__name__) diff --git a/freqtrade/plugins/pairlist/AgeFilter.py b/freqtrade/plugins/pairlist/AgeFilter.py index 786f32e88..13c992c87 100644 --- a/freqtrade/plugins/pairlist/AgeFilter.py +++ b/freqtrade/plugins/pairlist/AgeFilter.py @@ -8,11 +8,11 @@ from typing import Any, Dict, List, Optional import arrow from pandas import DataFrame -from freqtrade.configuration import PeriodicCache from freqtrade.constants import ListPairsWithTimeframes from freqtrade.exceptions import OperationalException from freqtrade.misc import plural from freqtrade.plugins.pairlist.IPairList import IPairList +from freqtrade.util import PeriodicCache logger = logging.getLogger(__name__) diff --git a/freqtrade/util/__init__.py b/freqtrade/util/__init__.py new file mode 100644 index 000000000..fc4d66380 --- /dev/null +++ b/freqtrade/util/__init__.py @@ -0,0 +1,2 @@ +# flake8: noqa: F401 +from freqtrade.util.periodic_cache import PeriodicCache diff --git a/freqtrade/configuration/PeriodicCache.py b/freqtrade/util/periodic_cache.py similarity index 100% rename from freqtrade/configuration/PeriodicCache.py rename to freqtrade/util/periodic_cache.py diff --git a/tests/test_periodiccache.py b/tests/test_periodiccache.py index b2bd8ba2b..df05de4ef 100644 --- a/tests/test_periodiccache.py +++ b/tests/test_periodiccache.py @@ -1,6 +1,6 @@ import time_machine -from freqtrade.configuration import PeriodicCache +from freqtrade.util import PeriodicCache def test_ttl_cache():