chore: ruff format

This commit is contained in:
KingND 2024-09-08 13:57:48 -04:00
parent 69678574d4
commit f970454cb4
2 changed files with 17 additions and 26 deletions

View File

@ -68,10 +68,7 @@ class LookaheadAnalysisSubFunctions:
)
print_rich_table(
data,
headers,
summary="Lookahead Analysis",
table_kwargs={"caption": caption}
data, headers, summary="Lookahead Analysis", table_kwargs={"caption": caption}
)
return data
@ -247,12 +244,17 @@ class LookaheadAnalysisSubFunctions:
# report the results
if lookaheadAnalysis_instances:
caption: Union[str, None] = None
if any([
any([
indicator.startswith("&")
for indicator in inst.current_analysis.false_indicators
]) for inst in lookaheadAnalysis_instances
]):
if any(
[
any(
[
indicator.startswith("&")
for indicator in inst.current_analysis.false_indicators
]
)
for inst in lookaheadAnalysis_instances
]
):
caption = (
"Any indicators in 'biased_indicators' which are used within "
"set_freqai_targets() can be ignored."

View File

@ -154,14 +154,8 @@ def test_lookahead_helper_start(lookahead_conf, mocker) -> None:
["&indicator1", "&indicator2"],
IGNORE_BIASED_INDICATORS_CAPTION,
),
(
["indicator1", "indicator2"],
None
),
(
[],
None
),
(["indicator1", "indicator2"], None),
([], None),
],
ids=(
"First of two biased indicators starts with '&'",
@ -172,10 +166,7 @@ def test_lookahead_helper_start(lookahead_conf, mocker) -> None:
),
)
def test_lookahead_helper_start__caption_based_on_indicators(
indicators,
expected_caption_text,
lookahead_conf,
mocker
indicators, expected_caption_text, lookahead_conf, mocker
):
"""Test that the table caption is only populated if a biased_indicator starts with '&'."""
@ -196,9 +187,7 @@ def test_lookahead_helper_start__caption_based_on_indicators(
LookaheadAnalysisSubFunctions.start(lookahead_conf)
text_table_mock.assert_called_once_with(
lookahead_conf,
[lookahead_analysis],
caption=expected_caption_text
lookahead_conf, [lookahead_analysis], caption=expected_caption_text
)
@ -300,7 +289,7 @@ def test_lookahead_helper_text_table_lookahead_analysis_instances__caption(
{
"name": "strategy_test_v3_with_lookahead_bias",
"location": Path(lookahead_conf["strategy_path"], f"{lookahead_conf['strategy']}.py"),
}
},
)
kwargs = {}
if caption is not False: