chore: don't return what ain't being needed

This commit is contained in:
Matthias
2024-07-07 09:43:44 +02:00
parent cdae61e155
commit e705471946
4 changed files with 10 additions and 14 deletions

View File

@@ -64,7 +64,7 @@ class LookaheadAnalysisSubFunctions:
table = tabulate(data, headers=headers, tablefmt="orgtbl")
print(table)
return table, headers, data
return data
@staticmethod
def export_to_csv(config: Dict[str, Any], lookahead_analysis: List[LookaheadAnalysis]):

View File

@@ -34,9 +34,9 @@ class RecursiveAnalysisSubFunctions:
table = tabulate(data, headers=headers, tablefmt="orgtbl")
print(table)
return table, headers, data
return data
return None, None, data
return data
@staticmethod
def calculate_config_overrides(config: Config):

View File

@@ -147,7 +147,7 @@ def test_lookahead_helper_text_table_lookahead_analysis_instances(lookahead_conf
instance = LookaheadAnalysis(lookahead_conf, strategy_obj)
instance.current_analysis = analysis
_table, _headers, data = LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
data = LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
lookahead_conf, [instance]
)
@@ -163,14 +163,14 @@ def test_lookahead_helper_text_table_lookahead_analysis_instances(lookahead_conf
analysis.false_exit_signals = 10
instance = LookaheadAnalysis(lookahead_conf, strategy_obj)
instance.current_analysis = analysis
_table, _headers, data = LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
data = LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
lookahead_conf, [instance]
)
assert data[0][2].__contains__("error")
# edit it into not showing an error
instance.failed_bias_check = False
_table, _headers, data = LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
data = LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
lookahead_conf, [instance]
)
assert data[0][0] == "strategy_test_v3_with_lookahead_bias.py"
@@ -183,7 +183,7 @@ def test_lookahead_helper_text_table_lookahead_analysis_instances(lookahead_conf
analysis.false_indicators.append("falseIndicator1")
analysis.false_indicators.append("falseIndicator2")
_table, _headers, data = LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
data = LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
lookahead_conf, [instance]
)
@@ -193,7 +193,7 @@ def test_lookahead_helper_text_table_lookahead_analysis_instances(lookahead_conf
assert len(data) == 1
# check amount of multiple rows
_table, _headers, data = LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
data = LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
lookahead_conf, [instance, instance, instance]
)
assert len(data) == 3

View File

@@ -105,9 +105,7 @@ def test_recursive_helper_text_table_recursive_analysis_instances(recursive_conf
instance = RecursiveAnalysis(recursive_conf, strategy_obj)
instance.dict_recursive = dict_diff
_table, _headers, data = RecursiveAnalysisSubFunctions.text_table_recursive_analysis_instances(
[instance]
)
data = RecursiveAnalysisSubFunctions.text_table_recursive_analysis_instances([instance])
# check row contents for a try that has too few signals
assert data[0][0] == "rsi"
@@ -118,9 +116,7 @@ def test_recursive_helper_text_table_recursive_analysis_instances(recursive_conf
dict_diff = dict()
instance = RecursiveAnalysis(recursive_conf, strategy_obj)
instance.dict_recursive = dict_diff
_table, _headers, data = RecursiveAnalysisSubFunctions.text_table_recursive_analysis_instances(
[instance]
)
data = RecursiveAnalysisSubFunctions.text_table_recursive_analysis_instances([instance])
assert len(data) == 0