reduce complexity inside start_download_data() in an effort to appease flake8

This commit is contained in:
robcaulk
2022-05-25 15:31:50 +02:00
parent d79983c791
commit ff531c416f
2 changed files with 14 additions and 7 deletions

View File

@@ -40,3 +40,14 @@ def expand_pairlist(wildcardpl: List[str], available_pairs: List[str],
except re.error as err:
raise ValueError(f"Wildcard error in {pair_wc}, {err}")
return result
def dynamic_expand_pairlist(config: dict, markets: list) -> List[str]:
if config.get('freqai', {}):
full_pairs = config['pairs'] + [pair for pair in config['freqai']['corr_pairlist']
if pair not in config['pairs']]
expanded_pairs = expand_pairlist(full_pairs, markets)
else:
expanded_pairs = expand_pairlist(config['pairs'], markets)
return expanded_pairs